Public report of fschutt/azul, 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, 18:19 UTC · Survey ID cd_dc885c9aebef411ebbfd1519bc3ccce5

fschutt/azul

Measured 14 November 2026, 18:16 UTC, at code version 011ae09

Dependency hygiene is not measured: Go module pinning and checksum coverage read, no direct requirement to grade for currency.

CAI score 53out of 100 At risk Down 2 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 very large codebase: 1,066,612 lines of product code in 11 projects, tests not counted · Estimated rebuild effort: about 7.1 person-years · Weakest lens: Code Health, 37

Findings by how serious they are

34 critical 5915 serious 127 minor

8 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, 18:16 UTC

A measurement, not a certificate. The Code Assurance Index records a number together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee the code. The standard was written by Canine Development, which also builds 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.

A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.

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 ▸

48of 48 dimensions measured by tools.
6026of 6076 findings point to an exact file and line, so you can open each one in the code. The other 50 concern the repository as a whole, such as missing documentation.
48dimensions across 7 lenses, read from 1,066,612 lines of product code in 11 projects.
Chapters

Executive summary

fschutt/azul is rated At risk because critical security findings are open. It scores 53 out of 100, which the At risk rating leaves unchanged.

Code Health, at 37, is the weakest lens and counts most in the score. The best first steps are adding type checking and simplifying the most tangled functions, each worth about 7 points. Raising Code Health to 70 would lift the score to about 65.

Thirteen weaknesses in the code could be used by an attacker. Five pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with, and five settings leave the servers or containers unsafe. Fixing the weaknesses the scanner points to, pinning each tool to an exact version and correcting the unsafe settings would close these risks. Updating the vulnerable packages would fix the four packages with a known security hole, and passing outside input through environment variables would deal with the three pipeline steps that put outside input straight into a shell command. Moving the write out of the read operation would take care of the read operation that also writes data.

The product code is 1,066,612 lines, about €1,000,000 to rebuild.

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

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

If Code Health rose from 37 to 70, the lowest score rated Strong, the score would rise from 53 to about 65.

Code composition: what the lines of code are
Product code 85%Tests 15%
New since the last survey: 1464 findings

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

  • Code Duplication · Near-duplicate member family (9 members, 29 shared lines) dll/src/desktop/shell2/linux/wayland/defines.rs
  • Code Duplication · Near-duplicate member family (8 members, 23 shared lines) dll/src/desktop/shell2/linux/wayland/defines.rs
  • Code Duplication · Near-duplicate member family (5 members, 15 shared lines) layout/src/callbacks.rs
  • Code Duplication · Near-duplicate member family (4 members, 113 shared lines) doc/src/reftest/autodoc.rs
  • Code Duplication · Near-duplicate member family (4 members, 30 shared lines) doc/src/codegen/v2/lang_cpp/cpp03.rs
  • Code Duplication · Near-duplicate member family (4 members, 22 shared lines) dll/src/desktop/shell2/linux/wayland/defines.rs
  • Code Duplication · Near-duplicate member family (4 members, 18 shared lines) doc/src/reftest/autodebug.rs
  • Code Duplication · Near-duplicate member family (4 members, 12 shared lines) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs
  • Code Duplication · Near-duplicate member family (3 members, 34 shared lines) doc/src/codegen/v2/lang_csharp/wrappers.rs
  • Code Duplication · Near-duplicate member family (3 members, 21 shared lines) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs
  • Code Duplication · Near-duplicate member family (3 members, 21 shared lines) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs
  • Code Duplication · Near-duplicate member family (3 members, 10 shared lines) doc/src/codegen/v2/lang_java/managed.rs
  • Code Duplication · Near-duplicate member pair (205 shared lines) dll/src/desktop/shell2/linux/wayland/mod.rs
  • Code Duplication · Near-duplicate member pair (111 shared lines) layout/src/widgets/themes/flat.rs
  • Code Duplication · Near-duplicate member pair (105 shared lines) doc/src/codegen/v2/lang_java/types.rs
  • Code Duplication · Near-duplicate member pair (104 shared lines) doc/src/api.rs
  • Code Duplication · Near-duplicate member pair (67 shared lines) dll/src/desktop/shell2/linux/wayland/mod.rs
  • Code Duplication · Near-duplicate member pair (67 shared lines) layout/src/widgets/themes/flat.rs
  • Code Duplication · Near-duplicate member pair (64 shared lines) layout/src/widgets/themes/flat.rs
  • Code Duplication · Near-duplicate member pair (62 shared lines) layout/src/widgets/themes/flat.rs
  • Code Duplication · Near-duplicate member pair (58 shared lines) doc/src/reftest/autoreview.rs
  • Code Duplication · Near-duplicate member pair (57 shared lines) dll/src/desktop/tray/linux.rs
  • Code Duplication · Near-duplicate member pair (57 shared lines) doc/src/autofix/diff.rs
  • Code Duplication · Near-duplicate member pair (53 shared lines) dll/src/desktop/shell2/linux/wayland/mod.rs
  • Code Duplication · Near-duplicate member pair (52 shared lines) doc/src/codegen/v2/lang_rust.rs
  • Code Duplication · Near-duplicate member pair (51 shared lines) doc/src/codegen/v2/lang_d/model.rs
  • Code Duplication · Near-duplicate member pair (51 shared lines) layout/src/text3/cache.rs
  • Code Duplication · Near-duplicate member pair (49 shared lines) dll/src/desktop/shell2/linux/x11/mod.rs
  • Code Duplication · Near-duplicate member pair (46 shared lines) webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs
  • Code Duplication · Near-duplicate member pair (45 shared lines) doc/src/codegen/v2/lang_java/wrappers.rs
  • Code Duplication · Near-duplicate member pair (45 shared lines) layout/src/widgets/text_area.rs
  • Code Duplication · Near-duplicate member pair (41 shared lines) doc/src/codegen/v2/lang_rust.rs
  • Code Duplication · Near-duplicate member pair (40 shared lines) doc/src/codegen/v2/lang_cpp/common.rs
  • Code Duplication · Near-duplicate member pair (29 shared lines) webrender/swgl/src/shaders/brush_blend.rs
  • Code Duplication · Edited copy of a member (32 corresponding lines) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs
  • Code Duplication · Members sharing a duplicated core (38 members, 50+ identical tokens) webrender/swgl/src/shaders/brush_blend.rs
  • Code Duplication · Members sharing a duplicated core (36 members, 50+ identical tokens) webrender/swgl/src/shaders/brush_blend.rs
  • Code Duplication · Members sharing a duplicated core (36 members, 50+ identical tokens) webrender/swgl/src/shaders/brush_blend.rs
  • Code Duplication · Members sharing a duplicated core (30 members, 50+ identical tokens) webrender/swgl/src/shaders/brush_blend.rs
  • Code Duplication · Members sharing a duplicated core (30 members, 50+ identical tokens) webrender/swgl/src/shaders/brush_blend.rs
  • Code Duplication · Members sharing a duplicated core (29 members, 50+ identical tokens) webrender/swgl/src/shaders/brush_blend.rs
  • Code Duplication · Members sharing a duplicated core (27 members, 50+ identical tokens) webrender/swgl/src/shaders/brush_blend.rs
  • Code Duplication · Members sharing a duplicated core (13 members, 50+ identical tokens) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs
  • Code Duplication · Members sharing a duplicated core (9 members, 50+ identical tokens) dll/src/desktop/extra/file_picker/android.rs
  • Code Duplication · Members sharing a duplicated core (9 members, 50+ identical tokens) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs
  • Code Duplication · Members sharing a duplicated core (9 members, 50+ identical tokens) webrender/swgl/src/shaders/brush_linear_gradient.rs
  • Code Duplication · Members sharing a duplicated core (8 members, 50+ identical tokens) layout/src/cpurender/compositor.rs
  • Code Duplication · Members sharing a duplicated core (8 members, 50+ identical tokens) webrender/swgl/src/shaders/composite_texture_2d.rs
  • Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) dll/src/desktop/shell2/linux/wayland/screencopy.rs
  • Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) layout/src/widgets/node_graph.rs
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) layout/src/cpurender/pixmap.rs
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) layout/src/text3/cache.rs
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) webrender/swgl/src/shaders/brush_blend.rs
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) dll/src/desktop/shell2/headless/mod.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) doc/src/autofix/discovery/parallel.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) doc/src/codegen/v2/lang_python.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) layout/src/callbacks.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) webrender/swgl/src/shaders/brush_linear_gradient.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) webrender/swgl/src/shaders/ps_quad_conic_gradient.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) webrender/swgl/src/shaders/ps_quad_conic_gradient.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) doc/src/codegen/v2/lang_java/managed.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) doc/src/codegen/v2/lang_rust.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) layout/src/solver3/layout_tree.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) layout/src/text3/edit.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) webrender/swgl/src/shaders/brush_opacity.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) webrender/swgl/src/shaders/composite_fast_path_texture_2d.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) webrender/swgl/src/shaders/composite_texture_2d_yuv.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs
  • Code Duplication · Edited copy of a member (297 corresponding lines) layout/src/widgets/themes/flat.rs
  • Code Duplication · Edited copy of a member (151 corresponding lines) dll/src/desktop/shell2/common/event.rs
  • Code Duplication · Edited copy of a member (174 corresponding lines) doc/src/codegen/v2/lang_csharp/types.rs
  • Code Duplication · Edited copy of a member (119 corresponding lines) doc/src/codegen/v2/lang_d/wrappers.rs
  • Code Duplication · Edited copy of a member (134 corresponding lines) webrender/core/src/picture.rs
  • Code Duplication · Edited copy of a member (136 corresponding lines) doc/src/codegen/v2/lang_rust.rs
  • Code Duplication · Edited copy of a member (82 corresponding lines) doc/src/codegen/v2/lang_d/wrappers.rs
  • Code Duplication · Edited copy of a member (103 corresponding lines) layout/src/widgets/themes/flat.rs
  • Code Duplication · Edited copy of a member (43 corresponding lines) webrender/swgl/src/shaders/brush_mix_blend.rs
  • Code Duplication · Edited copy of a member (76 corresponding lines) doc/src/codegen/v2/lang_lisp/mod.rs
  • Code Duplication · Edited copy of a member (102 corresponding lines) doc/src/codegen/v2/lang_java/wrappers.rs
  • Code Duplication · Edited copy of a member (70 corresponding lines) doc/src/codegen/v2/lang_crystal/types.rs
  • Code Duplication · Edited copy of a member (1 corresponding lines) layout/src/widgets/map.rs
  • Code Duplication · Edited copies of one member (4 members, 1+ corresponding lines) core/src/callbacks.rs
  • Code Duplication · Edited copies of one member (3 members, 1+ corresponding lines) core/src/callbacks.rs
  • Code Duplication · Edited copy of a member (112 corresponding lines) core/src/diff.rs
  • Code Duplication · Edited copies of one member (5 members, 1+ corresponding lines) core/src/db.rs
  • Code Duplication · Edited copies of one member (3 members, 97+ corresponding lines) layout/src/widgets/alert.rs
  • Code Duplication · Edited copy of a member (72 corresponding lines) doc/src/codegen/v2/lang_lisp/types.rs
  • Code Duplication · Edited copy of a member (92 corresponding lines) doc/src/codegen/v2/lang_csharp/mod.rs
  • Code Duplication · Edited copy of a member (32 corresponding lines) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs
  • Code Duplication · Edited copy of a member (80 corresponding lines) doc/src/codegen/v2/lang_java/types.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: 497 findings

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

  • Cyclomatic Complexity · lockfile_guard.main (cyclomatic 43) scripts/supply-chain/lockfile_guard.py
  • Cyclomatic Complexity · azinput-portal.main (cyclomatic 29) scripts/debugging/azinput-portal.py
  • Cyclomatic Complexity · check_dep_justifications.main (cyclomatic 28) scripts/check_dep_justifications.py
  • Cyclomatic Complexity · env_guard.main (cyclomatic 28) scripts/supply-chain/env_guard.py
  • Cyclomatic Complexity · run_install_steps.run_route (cyclomatic 26) scripts/run_install_steps.py
  • Cyclomatic Complexity · strip_coff_lib.main (cyclomatic 26) scripts/strip_coff_lib.py
  • Cyclomatic Complexity · analyze_coverage.main (cyclomatic 21) scripts/analyze_coverage.py
  • Cyclomatic Complexity · check_links.check_live (cyclomatic 19) scripts/check_links.py
  • Cyclomatic Complexity · env_guard.scan_crate (cyclomatic 19) scripts/supply-chain/env_guard.py
  • Cyclomatic Complexity · sc_common._skip_to_item_body (cyclomatic 19) scripts/supply-chain/sc_common.py
  • Cyclomatic Complexity · scan_build_scripts.main (cyclomatic 19) scripts/supply-chain/scan_build_scripts.py
  • Cyclomatic Complexity · AzulGamepad.onCapturedPointer (cyclomatic 18) scripts/android/AzulGamepad.java
  • Cyclomatic Complexity · cargo_bin_path.main (cyclomatic 18) scripts/cargo_bin_path.py
  • Cyclomatic Complexity · sc_common._follow_includes (cyclomatic 16) scripts/supply-chain/sc_common.py
  • Cognitive Complexity · lockfile_guard.main (cognitive 81) scripts/supply-chain/lockfile_guard.py
  • Cognitive Complexity · run_install_steps.run_route (cognitive 47) scripts/run_install_steps.py
  • Cognitive Complexity · strip_coff_lib.main (cognitive 45) scripts/strip_coff_lib.py
  • Cognitive Complexity · env_guard.main (cognitive 44) scripts/supply-chain/env_guard.py
  • Cognitive Complexity · check_dep_justifications.main (cognitive 38) scripts/check_dep_justifications.py
  • Cognitive Complexity · azinput-portal.main (cognitive 33) scripts/debugging/azinput-portal.py
  • Cognitive Complexity · check_links.check_live (cognitive 32) scripts/check_links.py
  • Cognitive Complexity · sc_common._follow_includes (cognitive 30) scripts/supply-chain/sc_common.py
  • Cognitive Complexity · cargo_bin_path.main (cognitive 27) scripts/cargo_bin_path.py
  • Cognitive Complexity · scan_build_scripts.main (cognitive 27) scripts/supply-chain/scan_build_scripts.py
  • Cognitive Complexity · preflight_contracts.check_demo_naming (cognitive 26) scripts/preflight_contracts.py
  • Cognitive Complexity · env_guard.scan_crate (cognitive 26) scripts/supply-chain/env_guard.py
  • Cognitive Complexity · scan_build_scripts.evaluate (cognitive 26) scripts/supply-chain/scan_build_scripts.py
  • Cognitive Complexity · lockfile_guard.verify_vendor (cognitive 25) scripts/supply-chain/lockfile_guard.py
  • Cognitive Complexity · preflight_contracts.check_widget_wiring (cognitive 24) scripts/preflight_contracts.py
  • Cognitive Complexity · AzulGamepad.onCapturedPointer (cognitive 23) scripts/android/AzulGamepad.java
  • Cognitive Complexity · analyze_coverage.main (cognitive 23) scripts/analyze_coverage.py
  • Cognitive Complexity · check_links.check_local (cognitive 23) scripts/check_links.py
  • Cognitive Complexity · sc_common._skip_to_item_body (cognitive 22) scripts/supply-chain/sc_common.py
  • Cognitive Complexity · preflight_contracts.check_sparse_checkout (cognitive 19) scripts/preflight_contracts.py
  • Cognitive Complexity · scan_build_scripts.classify (cognitive 19) scripts/supply-chain/scan_build_scripts.py
  • Cognitive Complexity · scan_build_scripts.collect (cognitive 17) scripts/supply-chain/scan_build_scripts.py
  • Cognitive Complexity · sc_common.build_dependency_closure (cognitive 16) scripts/supply-chain/sc_common.py
  • Code Duplication · Near-duplicate member family (5 members, 35 shared lines) layout/src/widgets/node_graph.rs
  • Code Duplication · Near-duplicate member family (4 members, 113 shared lines) doc/src/reftest/autodoc.rs
  • Code Duplication · Near-duplicate member family (4 members, 30 shared lines) doc/src/codegen/v2/lang_cpp/cpp03.rs
  • Code Duplication · Near-duplicate member family (4 members, 10 shared lines) doc/src/reftest/autodebug.rs
  • Code Duplication · Near-duplicate member family (3 members, 8 shared lines) layout/src/solver3/display_list.rs
  • Code Duplication · Near-duplicate member pair (205 shared lines) dll/src/desktop/shell2/linux/wayland/mod.rs
  • Code Duplication · Near-duplicate member pair (138 shared lines) layout/src/widgets/themes/flat.rs
  • Code Duplication · Near-duplicate member pair (111 shared lines) layout/src/widgets/themes/flat.rs
  • Code Duplication · Near-duplicate member pair (104 shared lines) doc/src/api.rs
  • Code Duplication · Near-duplicate member pair (85 shared lines) layout/src/widgets/themes/flat.rs
  • Code Duplication · Near-duplicate member pair (67 shared lines) dll/src/desktop/shell2/linux/wayland/mod.rs
  • Code Duplication · Near-duplicate member pair (67 shared lines) layout/src/widgets/themes/flat.rs
  • Code Duplication · Near-duplicate member pair (64 shared lines) layout/src/widgets/themes/flat.rs
  • Code Duplication · Near-duplicate member pair (58 shared lines) doc/src/reftest/autoreview.rs
  • Code Duplication · Near-duplicate member pair (57 shared lines) dll/src/desktop/tray/linux.rs
  • Code Duplication · Near-duplicate member pair (57 shared lines) doc/src/autofix/diff.rs
  • Code Duplication · Near-duplicate member pair (57 shared lines) dll/src/desktop/shell2/linux/wayland/mod.rs
  • Code Duplication · Near-duplicate member pair (53 shared lines) doc/src/codegen/v2/lang_java/types.rs
  • Code Duplication · Near-duplicate member pair (52 shared lines) doc/src/codegen/v2/lang_rust.rs
  • Code Duplication · Near-duplicate member pair (51 shared lines) layout/src/text3/cache.rs
  • Code Duplication · Near-duplicate member pair (49 shared lines) dll/src/desktop/shell2/linux/x11/mod.rs
  • Code Duplication · Near-duplicate member pair (47 shared lines) layout/src/widgets/themes/flat.rs
  • Code Duplication · Near-duplicate member pair (45 shared lines) doc/src/codegen/v2/lang_java/wrappers.rs
  • Code Duplication · Near-duplicate member pair (45 shared lines) layout/src/widgets/text_area.rs
  • Code Duplication · Near-duplicate member pair (41 shared lines) doc/src/codegen/v2/lang_rust.rs
  • Code Duplication · Near-duplicate member pair (40 shared lines) doc/src/codegen/v2/lang_cpp/common.rs
  • Code Duplication · Near-duplicate member pair (38 shared lines) layout/src/text3/edit.rs
  • Code Duplication · Near-duplicate member pair (29 shared lines) dll/src/desktop/shell2/headless/mod.rs
  • Code Duplication · Edited copy of a member (36 corresponding lines) dll/src/desktop/extra/geolocation/ios.rs
  • Code Duplication · Members sharing a duplicated core (16 members, 50+ identical tokens) dll/src/desktop/shell2/linux/wayland/defines.rs
  • Code Duplication · Members sharing a duplicated core (14 members, 50+ identical tokens) dll/src/desktop/shell2/linux/wayland/defines.rs
  • Code Duplication · Members sharing a duplicated core (10 members, 50+ identical tokens) layout/src/callbacks.rs
  • Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) doc/src/codegen/v2/lang_java/derives.rs
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) dll/src/desktop/shell2/linux/wayland/screencopy.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) dll/src/desktop/shell2/linux/wayland/defines.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) layout/src/cpurender/pixmap.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) dll/src/desktop/shell2/linux/wayland/screencopy.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) doc/src/codegen/v2/lang_crystal/functions.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) doc/src/codegen/v2/lang_csharp/wrappers.rs
  • Code Duplication · Duplicated block (121 lines × 3) webrender/core/src/batch.rs
  • Code Duplication · Duplicated block (65–70 lines × 2) layout/src/widgets/themes/flat.rs
  • Code Duplication · Duplicated block (39–54 lines × 2) dll/src/desktop/shell2/headless/mod.rs
  • Code Duplication · Duplicated block (48 lines × 2) layout/src/widgets/themes/flat.rs
  • Code Duplication · Duplicated block (46 lines × 2) doc/src/codegen/v2/lang_odin/types.rs
  • Code Duplication · Duplicated block (41–42 lines × 2) doc/src/codegen/v2/lang_rust.rs
  • Code Duplication · Duplicated block (40–41 lines × 2) webrender/core/src/batch.rs
  • Code Duplication · Duplicated block (38–39 lines × 2) layout/src/cpurender/compositor.rs
  • Code Duplication · Duplicated block (36–37 lines × 3) doc/src/codegen/v2/lang_cpp/cpp03.rs
  • Code Duplication · Duplicated block (35–37 lines × 2) doc/src/autofix/function_diff.rs
  • Code Duplication · Duplicated block (37 lines × 2) layout/src/solver3/fc.rs
  • Code Duplication · Duplicated block (35–36 lines × 5) layout/src/widgets/node_graph.rs
  • Code Duplication · Duplicated block (31–35 lines × 2) doc/src/reftest/autoreview.rs
  • Code Duplication · Duplicated block (34 lines × 3) doc/src/codegen/v2/lang_cpp/cpp03.rs
  • Code Duplication · Duplicated block (34 lines × 2) layout/src/widgets/themes/flat.rs
  • Code Duplication · Duplicated block (30–33 lines × 2) doc/src/api.rs
  • Code Duplication · Duplicated block (31–32 lines × 2) doc/src/codegen/v2/lang_rust.rs
  • Code Duplication · Duplicated block (26–31 lines × 2) webrender/core/src/quad.rs
  • Code Duplication · Duplicated block (30 lines × 2) dll/src/desktop/shell2/linux/x11/mod.rs
  • Code Duplication · Duplicated block (30 lines × 2) doc/src/codegen/v2/lang_python.rs
  • Code Duplication · Duplicated block (20–28 lines × 3) doc/src/codegen/v2/lang_cpp/cpp03.rs
  • Code Duplication · Duplicated block (25–28 lines × 3) doc/src/reftest/autodoc.rs
  • Code Duplication · Duplicated block (28 lines × 2) doc/src/autofix/debug.rs
  • Code Duplication · Duplicated block (28 lines × 2) layout/src/text3/cache.rs
Rebuild cost: about €1,000,000 · Estimate
Cost to rebuild€340,000 to €1,700,000, for 5,744 to 18,224 hours of work, about 7.1 person-years for 4 to 14 engineers
Difficulty of the problemLow, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 53. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeVery large: 1,066,612 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
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
Raises the score by about 7 points · Medium effort · Type Safety
2
Resolve the 33 finding(s) in Cyclomatic Complexity.
Raises the score by about 7 points · Medium effort · Cyclomatic Complexity
3
Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life — start with rust-toolchain.toml.
Raises the score by about 1 point · Low effort · Platform End-of-Life

Diagnosis: what the measurements show together

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

Where the investment is most exposed · Value at risk
This code would cost about €1,000,000 to build again, about 7.1 person-years of work. Its weakest lens is Code Health, at 37 (Weak). Code Health is about how easy the code is to read and change safely, and code that is hard to read is slow and risky to change, so every future change costs more than it should. Because the weakest lens counts most in the score, work on Code Health also moves the score most.
Based on: the rebuild estimate · the Code Health grade · how much each lens counts
What to do: Start with the Code Health actions in Top priorities.
If you do one thing first · First action
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up. Of all the actions in this report, it raises the score most for the work it takes: about 7 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 6.0 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 5% to 11% on every change. The history of the code shows how much it changes: about 952,759 lines over the last 90 days, which is about 3,863,967 lines a year. At that pace, the extra work comes to an estimated 476 to 2856.2 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture — module dependency graph

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

arch aztest aztest azul-core azul-core azul-css azul-css azul-core->azul-css azul-dll azul-dll azul-dll->azul-core azul-dll->azul-css azul-layout azul-layout azul-dll->azul-layout webrender webrender azul-dll->webrender azul-doc azul-doc azul-doc->azul-core azul-doc->azul-css azul-doc->azul-layout azul-layout->azul-core azul-layout->azul-css swgl_shaders swgl_shaders webrender->azul-core webrender->azul-css webrender_api webrender_api webrender->webrender_api webrender_build webrender_build webrender->webrender_build wr_azul_glyph_rasterizer wr_azul_glyph_rasterizer webrender->wr_azul_glyph_rasterizer webrender_api->azul-core wr_azul_glyph_rasterizer->azul-core wr_azul_glyph_rasterizer->azul-css wr_azul_glyph_rasterizer->azul-layout wr_azul_glyph_rasterizer->webrender_api

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.

1003 modules, with 3936 dependencies between them. 20 loops run through 183 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 963 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 azul_core.geom2 azul_core.id.node_id3 azul_css.corety4 azul_css.props.basic.geometry5 azul_doc.autofix.patch_format6 swgl_shaders.traits7 swgl_shaders.types8 azul_core.refany9 azul_css.props.basic.pixel10 azul_doc.codegen.v2.ir11 swgl_shaders.common12 azul_core.task13 azul_css.props.property14 azul_doc.codegen.v2.config15 swgl_shaders.shaders.brush_blend16 azul_css.dynamic_selector17 azul_doc.codegen.v2.generator18 azul_layout.font_traits.stub19 azul_css.system20 azul_css.props.basic.color21 azul_css.codegen.format22 azul_css.css23 azul_core.styled_dom24 azul_core.resources25 azul_core.window26 webrender.resource_cache27 webrender.scene_building28 azul_core.events29 webrender.picture30 azul_core.dom31 webrender.prim_store32 azul_core.callbacks33 azul_layout.solver3.layout_tree34 webrender.internal_types35 azul_layout.solver3.getters36 webrender.frame_builder37 azul_layout.solver3.display_list38 azul_layout.window39 azul_layout.callbacks40 azul_dll.desktop.shell2.common.event
1 azul_core.geom
2 azul_core.id.node_id
3 azul_css.corety
4 azul_css.props.basic.geometry
5 azul_doc.autofix.patch_format
6 swgl_shaders.traits
7 swgl_shaders.types
8 azul_core.refany3
9 azul_css.props.basic.pixel2211
10 azul_doc.codegen.v2.ir4
11 swgl_shaders.common8
12 azul_core.task1
13 azul_css.props.property211
14 azul_doc.codegen.v2.config1
15 swgl_shaders.shaders.brush_blend362
16 azul_css.dynamic_selector325
17 azul_doc.codegen.v2.generator32
18 azul_layout.font_traits.stub1
19 azul_css.system84241
20 azul_css.props.basic.color2
21 azul_css.codegen.format212
22 azul_css.css5451
23 azul_core.styled_dom923218
24 azul_core.resources33231351251134
25 azul_core.window8107113
26 webrender.resource_cache1189
27 webrender.scene_building61491261
28 azul_core.events122353199
29 webrender.picture56262783
30 azul_core.dom1891454743
31 webrender.prim_store1221131
32 azul_core.callbacks1312151519716
33 azul_layout.solver3.layout_tree8522626
34 webrender.internal_types35111
35 azul_layout.solver3.getters1121524215
36 webrender.frame_builder1112522
37 azul_layout.solver3.display_list19511443414551
38 azul_layout.window105122851521231149103433
39 azul_layout.callbacks718127413214111451073
40 azul_dll.desktop.shell2.common.event622551161375571
Uses a module listed above itPart of a loopThe module itself
1 azul_core.geom2 azul_core.id.node_id3 azul_css.corety4 azul_css.props.basic.geometry5 azul_doc.autofix.patch_format6 swgl_shaders.traits7 swgl_shaders.types8 azul_core.refany9 azul_css.props.basic.pixel10 azul_doc.codegen.v2.ir11 swgl_shaders.common12 azul_core.task13 azul_css.props.property14 azul_doc.codegen.v2.config15 swgl_shaders.shaders.brush_blend16 azul_css.dynamic_selector17 azul_doc.codegen.v2.generator18 azul_layout.font_traits.stub19 azul_css.system20 azul_css.props.basic.color21 azul_css.codegen.format22 azul_css.css23 azul_core.styled_dom24 azul_core.resources25 azul_core.window26 webrender.resource_cache27 webrender.scene_building28 azul_core.events29 webrender.picture30 azul_core.dom31 webrender.prim_store32 azul_core.callbacks33 azul_layout.solver3.layout_tree34 webrender.internal_types35 azul_layout.solver3.getters36 webrender.frame_builder37 azul_layout.solver3.display_list38 azul_layout.window39 azul_layout.callbacks40 azul_dll.desktop.shell2.common.eventazul_core.geom1azul_core.id.node_id2azul_css.corety3azul_css.props.basic.geometry4azul_doc.autofix.patch_format5swgl_shaders.traits6swgl_shaders.types7azul_core.refany8azul_css.props.basic.pixel9azul_doc.codegen.v2.ir10swgl_shaders.common11azul_core.task12azul_css.props.property13azul_doc.codegen.v2.config14swgl_shaders.shaders.brush_blend15azul_css.dynamic_selector16azul_doc.codegen.v2.generator17azul_layout.font_traits.stub18azul_css.system19azul_css.props.basic.color20azul_css.codegen.format21azul_css.css22azul_core.styled_dom23azul_core.resources24azul_core.window25webrender.resource_cache26webrender.scene_building27azul_core.events28webrender.picture29azul_core.dom30webrender.prim_store31azul_core.callbacks32azul_layout.solver3.layout_tree33webrender.internal_types34azul_layout.solver3.getters35webrender.frame_builder36azul_layout.solver3.display_list37azul_layout.window38azul_layout.callbacks39azul_dll.desktop.shell2.common.event403221148121113623253218424122125451923218332313512511348107113118961491261122353199562627831891454743122113113121515197168522626351111121524215111252219511443414551105122851521231149103433718127413214111451073622551161375571+963 more modules (most-connected shown)

At a glance — Code Health · 37% · Weak · gated by D2, R1, R2 ·

At a glance — Architecture · 97% · Exemplary ·

At a glance — Maturity · 74% · Strong ·

At a glance — Readiness · 65% · Adequate ·

At a glance — Security · 57% · Adequate · gated by D29 ·

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

At a glance — Performance · 100% · Exemplary ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A03:2025 — Software Supply Chain Failures45High / Critical
A05:2025 — Injection32High / Critical
A02:2025 — Security Misconfiguration16High / Critical

Roadmap

Top priorities: Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up; Resolve the 33 finding(s) in Cyclomatic Complexity; Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.

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

Do thisHelpsEffortDimension
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.+7.3 ptsMediumType Safety
Resolve the 33 finding(s) in Cyclomatic Complexity.+7.3 ptsMediumCyclomatic Complexity
Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life — start with rust-toolchain.toml.+1.4 ptsLowPlatform End-of-Life
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.+1.6 ptsMediumLarge Files
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.+1.6 ptsMediumCode Duplication
Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED, REDACTED.+0.7 ptsLowStatic Analysis (SAST)
Resolve the 1 High vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED.+0.7 ptsLowDependency Vulnerabilities
Resolve the 3 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (3).+0.7 ptsLowDependency Vulnerabilities

File quality

Per-file score 0–10 — a quality signature. Of 624 files carrying findings, judged against the Production bar: 1% slop · 79% mixed · 20% near-clean.

FileScoreBandWorst signal
REDACTED0.0SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED0.3SlopIaC & Container Security: High IaC: REDACTED
REDACTED0.9SlopStatic Analysis (SAST): High: REDACTED
REDACTED1.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED1.7SlopIaC & Container Security: High IaC: REDACTED
core/src/prop_cache.rs4.8MixedCyclomatic Complexity: CssPropertyCache::get_computed_css_style_string (cyclomatic 85)
layout/src/callbacks.rs4.8MixedGod Classes: TooManyMethods: CallbackInfo
dll/src/desktop/shell2/linux/wayland/mod.rs5.5MixedCyclomatic Complexity: WaylandWindow::generate_frame_if_needed (cyclomatic 104)
dll/src/desktop/shell2/android/mod.rs5.5MixedCyclomatic Complexity: azul_dll::desktop::shell2::android::drain_input (cyclomatic 68)
dll/src/desktop/shell2/macos/mod.rs5.5MixedCyclomatic Complexity: MacOSWindow::render_and_present_in_draw_rect (cyclomatic 56)
layout/src/solver3/display_list.rs5.5MixedCyclomatic Complexity: DisplayListItem::is_visually_equal (cyclomatic 55)
css/src/dynamic_selector.rs5.5MixedCyclomatic Complexity: CssPropertyWithConditionsVec::parse_at_rule (cyclomatic 34)
core/src/callbacks.rs5.5MixedCyclomatic Complexity: SystemStyleDependencies::dom_depends_on_change (cyclomatic 17)
layout/src/widgets/text_area.rs5.5MixedCode Duplication: Near-duplicate member pair (45 shared lines)
dll/src/desktop/shell2/macos/system_style.rs5.6MixedCyclomatic Complexity: azul_dll::desktop::shell2::macos::system_style::discover (cyclomatic 50)
layout/src/http.rs5.7MixedCognitive Complexity: azul_layout::http::http_request_with_config (cognitive 17)
layout/src/widgets/avatar.rs5.7MixedCode Duplication: Edited copies of one member (4 members, 45+ corresponding lines)
layout/src/widgets/check_box.rs5.7MixedCode Duplication: Edited copy of a member (52 corresponding lines)
layout/src/widgets/text_input.rs5.9MixedCognitive Complexity: azul_layout::widgets::text_input::default_on_text_input_inner (cognitive 16)
layout/src/widgets/list_view.rs5.9MixedGod Classes: FileTooLong: widgets/list_view.rs

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

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

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

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

Could not be resolved — 8

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 48 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 — 48 dimensions across the health lenses
D1D2D3D4D5D6D13D14D15D17D19D24D28D29D30D31D34D35D36D43D44AX10AX3AX4AX5AX8AX9ES1ES2GD1M1M2M3M4P1P10P2P3P4P6PF3R1R10R2R3R7R9X5

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, 6026 of 6076 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 01a1db46-d457-7dcf-8556-12099e322224.

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 READ here — but this repository measures it: a coverage step in CI (`grcov -`) shows that coverage is collected and tracked in your own CI. The built-in collector has no runner for this ecosystem (.rs), so the analyzer could not read the number — a gap in the analyzer's language coverage, not an unmeasured repo. Not scored.
  • 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, 679 test files), but it was not re-run: no test result was produced. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
  • D12 Dependency Hygiene — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — 1 direct Go requirement(s) out of 2 in 1 go.mod were read for PINNING discipline and checksum coverage (0 defect(s) reported), but the outdated/deprecated signal needs the Go module proxy, which had no direct requirement to be asked about, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
  • D15 Churn × Complexity Hotspots — measured, with a gap in what it reached — 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. A hotspot's complexity is meant to be the worst body its churn actually touched. For css/src/props/style/background.rs that could not be established — the complexity reader for the file reports no body extents, or the history carries no per-line attribution — so the row quotes the file's worst body, which the counted changes may never have touched. The churn count is unaffected.
  • D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-maintainer repository — bus factor is not applicable (33 contributor(s) across 9833 commit(s) sampled, automation and bot accounts excluded). One of them holds 99% of the history; the other 32 hold 0% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
  • D17 Explicit Debt — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 0 deducted marker(s) and the 0.0/KLoC density on this row were taken over this repository's .NET projects ALONE: .rs (1,047,773 lines, 99% of production source) went unread, because every marker collector on this path is reached through a C# workspace. A read-only sweep of that source finds at least 400 task marker(s) (TODO/FIXME/HACK/XXX) across 105 file(s) that this score does not count — a floor, since only line comments are read there and D17's other eight marker kinds (suppressions, NoWarn, editorconfig severities, empty catches, commented-out code, Obsolete, dead code, preprocessor branches) need a compiler we do not have for that language. The debt in that source is UNMEASURED — its absence from the score above is a gap in this analyzer's language coverage, not a finding that the code carries none.
  • 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. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their 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.
  • 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.
  • D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D27 Navigability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • AXR1 Runtime accessibility (rendered) — 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. 6 % of assessed (surface, criterion) pairs differed between renders and were excluded from evidence.
  • 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • 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.
  • X10 Duplicated predicate — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 67 further occurrence(s) are not listed individually; the score already reflects all 107.
  • X24 Document value interpolated into markup unescaped — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X7 Silent fallback defaults — 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. 3 further occurrence(s) are not listed individually; the score already reflects all 43.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • 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.
  • 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.
  • D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
  • 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.
  • 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.8 / 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.8 / 10 · rule-coverage 100% · ceiling Prevented

681 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was PlatformWindow::apply_user_change at 315. A further 135 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 azul_core::ua_css::get_ua_property at 213 — they are counted neither in the figure above nor in this dimension's score. 31 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: core/src/ua_css.rs (azul_core::ua_css::get_ua_property at 213), css/src/css.rs (NodeTypeTag::from_str at 185), css/src/codegen/rust.rs (azul_css::codegen::rust::format_node_type at 184), core/src/window.rs (VirtualKeyCode::from_u32 at 164), dll/src/web/html_render.rs (azul_dll::web::html_render::node_type_to_html_tag at 144), and 26 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.

azul_doc::main (cyclomatic 266) · ×177doc/src/main.rs:76
azul_layout::solver3::fc::layout_bfc (cyclomatic 123) · ×102layout/src/solver3/fc.rs:1214
azul_dll::desktop::shell2::windows::window_proc (cyclomatic 205) · ×78dll/src/desktop/shell2/windows/mod.rs:4025
LayoutWindow::layout_dom_recursive_impl (cyclomatic 89) · ×21layout/src/window.rs:5543
azul_core::compact::apply_css_property_to_compact (cyclomatic 190) · ×20core/src/compact.rs:1305

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

What to do

  1. Bring the 2 bodies over 240 down to 240 or less in Cyclomatic Complexity — start with PlatformWindow::apply_user_change (cyclomatic 315), azul_doc::main (cyclomatic 266). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 2 together lifts Cyclomatic Complexity from 4.8 to about 5.1/10, projected with the scoring formula itself and assuming each lands exactly at 240; a cleaner split scores higher.

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

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

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

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

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

1256 method(s) exceeded the cognitive complexity threshold of 15; the worst was PlatformWindow::apply_user_change at 551.

azul_doc::main (cognitive 532) · ×353doc/src/main.rs:76
azul_layout::solver3::fc::layout_bfc (cognitive 295) · ×203layout/src/solver3/fc.rs:1214
azul_dll::desktop::shell2::windows::window_proc (cognitive 372) · ×152dll/src/desktop/shell2/windows/mod.rs:4025
LayoutWindow::layout_dom_recursive_impl (cognitive 215) · ×38layout/src/window.rs:5543
azul_core::compact::apply_css_property_to_compact (cognitive 186) · ×34core/src/compact.rs:1305

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

What to do

  1. Bring the 15 bodies over 240 down to 240 or less in Cognitive Complexity — start with PlatformWindow::apply_user_change (cognitive 551), azul_doc::main (cognitive 532), PlatformWindow::process_window_events_inner (cognitive 497). — 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 15 together lifts Cognitive Complexity from 2.7 to about 3.9/10, projected with the scoring formula itself and assuming each lands exactly at 240; a cleaner split scores higher.

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

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

708 god class(es) detected.

FunctionTooLong: azul_dll::desktop::compositor2::translate_displaylist_to_wr · ×210dll/src/desktop/compositor2.rs:174
FileTooLong: src/window.rs · ×194layout/src/window.rs
MethodTooLong: BatchBuilder.add_prim_to_batch · ×136webrender/core/src/batch.rs:815
TooManyMethods: CssProperty · ×98css/src/props/property.rs:662
ClassTooLong: WaylandWindow · ×51dll/src/desktop/shell2/linux/wayland/mod.rs:544

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

What to do

  1. Resolve the 210 FunctionTooLong finding(s) in God Classes — start with mod.rs (26), fc.rs (14), cache.rs (10). — One of this dimension's main actionable groups (210 warning-level).
  2. Resolve the 194 FileTooLong finding(s) in God Classes — start with mod.rs (18), events.rs (4), window.rs (2). — One of this dimension's main actionable groups (194 warning-level).
  3. Resolve the 136 MethodTooLong finding(s) in God Classes — start with mod.rs (34), picture.rs (11), property.rs (7). — One of this dimension's main actionable groups (136 warning-level).

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

D4 · Code Duplication6.9 / 10Adequate✓ 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 6.9 / 10 · rule-coverage 100% · ceiling Verified

2045 duplicated block group(s) detected. 7.7 % of the production lines (82,222 of 1,066,612) are in a reported copy. A further 828 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 6 of the 2873 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 (8 lines × 2) · ×118core/src/events.rs:1823
Duplicated block (9 lines × 2) · ×111core/src/diff.rs:741
Duplicated block (7 lines × 2) · ×101css/src/props/basic/time.rs:242
Duplicated block (11 lines × 2) · ×95core/src/compact.rs:1349
Duplicated block (6 lines × 2) · ×95core/src/prop_cache.rs:683

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

What to do

  1. Resolve the 118 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with mod.rs (17), wrappers.rs (14), types.rs (13). — One of this dimension's main actionable groups (118 warning-level).
  2. Resolve the 111 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with mod.rs (13), wrappers.rs (8), types.rs (7). — One of this dimension's main actionable groups (111 warning-level).
  3. Resolve the 101 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with wrappers.rs (15), mod.rs (11), types.rs (11). — One of this dimension's main actionable groups (101 warning-level).

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

D5 · Coupling6.9 / 10Adequate✓ Tool-verified

What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.

Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.

Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.

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

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

Off the main sequence: webrender_build · ×3
Unstable project webrender

What to do

  1. Resolve the 3 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (3 warning-level).
  2. Resolve the 1 Unstable project webrender 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.7 / 10Stronggated by 25 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.7 / 10 · rule-coverage 100% · ceiling Verified

25 of 1106 classes have LCOM4 above 3.

Low cohesion: CssPropertyCache (LCOM4 25) · ×25core/src/prop_cache.rs:1017

What to do

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

Detailed fixes: d6_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 1025 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. A further 2 crate(s) in the closure resolve from git, a path or a private registry and publish no licence this pass can read; they are outside this verdict.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots7.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 7.9 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: dll/src/desktop/shell2/common/event.rs (200×315=63000); layout/src/window.rs (296×89=26344); dll/src/desktop/shell2/windows/mod.rs (90×205=18450) Repeated repair below the complexity floor: layout/src/widgets/text_input.rs (20 of 35 changes were fixes); layout/src/widgets/button.rs (13 of 23 changes were fixes); doc/src/codegen/v2/lang_ocaml/wrappers.rs (12 of 22 changes were fixes)

Hotspot: dll/src/desktop/shell2/common/event.rs · ×167dll/src/desktop/shell2/common/event.rs:4824
Repeated repair: layout/src/widgets/text_input.rs · ×80layout/src/widgets/text_input.rs:1092

What to do

  1. Resolve the 167 Hotspot finding(s) in Churn × Complexity Hotspots — start with mod.rs (17), wrappers.rs (13), types.rs (7). — One of this dimension's main actionable groups (167 warning-level).
  2. Resolve the 80 Repeated repair finding(s) in Churn × Complexity Hotspots — start with functions.rs (19), wrappers.rs (4), mod.rs (3). — One of this dimension's main actionable groups (80 warning-level).

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

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

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

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

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

0 deducted debt markers + 0 dead symbols across 37 LoC in the .NET projects (0.0/KLoC) → score 10.0. Measured on the .NET source only: .rs (99% of production source) was not read, and carries at least 400 uncounted task marker(s) in 105 file(s).

✓ On the Gold path — maintain.

Detailed fixes: d17_recommendation.md.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D24 · Comment Value9.2 8.7 / 10Strong✓ Tool-verified

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

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

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

2 of 258 judged comments only repeat the code they sit on (0.8 %). 29 comment(s) in another language or script were not judged.

redundant comment · ×2dll/src/desktop/shell2/common/debugger/debugger.js:1981

What to do

  1. Resolve the 2 redundant comment finding(s) in Comment Value — start with debugger.js (2). — One of this dimension's main actionable groups (2 recommendation-level).

Detailed fixes: d24_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.2 / 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.2 / 10 · rule-coverage 100% · ceiling Documented

32 finding(s): 0 critical, 24 high, 8 medium, 0 low. 5 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 29 file(s) — `core/src/dom.rs` (line 3867), `core/src/host_invoker.rs` (line 232, line 1029), `core/src/host_invoker_test.rs` (line 254), `core/src/refany.rs` (line 837, line 1296), `core/src/refany_test.rs` (line 388, line 406, line 449, …), … (+24 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 5 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

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

What to do

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

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

D30 · Dependency Vulnerabilities0.4 / 10Critical✓ 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 0.4 / 10 · rule-coverage 100% · ceiling Documented

37 finding(s): 3 critical, 1 high, 28 medium, 0 low.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

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

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

D31 · IaC & Container Security7.3 / 10Adequategated by 5 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.3 / 10 · rule-coverage 100% · ceiling Documented

16 finding(s): 0 critical, 5 high, 10 medium, 1 low.

REDACTED
REDACTED
REDACTED

What to do

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

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md.

D35 · Change Coupling10.0 / 10Stronggated by 2 serious findings✓ Tool-verified

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

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

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

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

Strongest change-coupling: prop_cache.rs↔macros.rs 58%; tabs.rs↔text_input.rs 50%

Change coupling: prop_cache.rs ↔ macros.rs · ×2core/src/prop_cache.rs:1

What to do

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

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

D36 · Supply-chain Provenance & Signing5.0 / 10Adequate✓ 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 5.0 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

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

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

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-Life6.0 / 10Adequate✓ Tool-verified

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

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

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

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

End-of-life runtime: Rust 1.91rust-toolchain.toml:1

What to do

  1. Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life — start with rust-toolchain.toml. — One of this dimension's main actionable groups (1 warning-level).

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

Frontend & cross-cutting dimensions

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

AX10 · Code composition10.0 / 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.

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.

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

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

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

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

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

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

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

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

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

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

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

What to do

  • Keep query handlers read-only — move the writes/event-publishes into a command handler so reads stay safe to retry, cache, and route to a read replica.
ES1 · Fold determinism10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

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

Other · Code Health — Unreviewed-generation residue: shipped members still throwing NotImplementedException, and placeholder string literals left in non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.

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

M1 · Documentation (README)6.7 / 10Adequate✓ Tool-verified

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

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

What to do

  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
M2 · Architecture 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 accuracy10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

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

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

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

  • 1 public type in `swgl_shaders.shaders.brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d` is marked as implementation by its own namespace, folder or name: `ProgramImpl` (webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:489, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers. — webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:489

What to do

  • Hide `swgl_shaders.shaders.brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d` (`ProgramImpl`) (Rust: `pub(crate)`, or keep the module private): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
P2 · Observability8.7 / 10Strong✓ Tool-verified

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

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

  • Only 4/7 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `doc/aztest`, `layout`, `webrender/swgl`.

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
P3 · Security & performance tooling5.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.

  • `examples/node/package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — examples/node/package.json:14

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 & Rollback5.0 / 10Adequate✓ 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.

What to do

  • Make sure a person approves each release. The release job names an environment, but its approval rules live in the code host's settings, where we can't see them. Check that a reviewer must approve each release, or publish releases as drafts first, so a bad build can be stopped before anyone downloads it.
P6 · Release Hygiene5.0 / 10Adequate✓ Tool-verified

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

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

  • No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)

What to do

  • Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
PF3 · Async & latency hygiene10.0 / 10Exemplary✓ Tool-verified

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

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

R1 · Type Safety0.0 / 10Critical✓ Tool-verified

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

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

  • 0 typed · 10 plain JS — the untyped files are dll/src/desktop/shell2/common/debugger/debugger.js, scripts/docs_pdf_book.mjs, scripts/docs_pdf_cdp.mjs, scripts/e2e-web/lib/asserts.mjs, scripts/e2e-web/lib/cdp.mjs, scripts/e2e-web/lib/driver.mjs (+4 more).

What to do

  • Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
R10 · Code Duplication6.1 / 10Adequate✓ Tool-verified

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

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

  • dll/src/desktop/shell2/common/debugger/debugger.js:3534 · dll/src/desktop/shell2/common/debugger/debugger.js:3550 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — dll/src/desktop/shell2/common/debugger/debugger.js:3534
  • dll/src/desktop/shell2/common/debugger/debugger.js:939 · dll/src/desktop/shell2/common/debugger/debugger.js:1037 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — dll/src/desktop/shell2/common/debugger/debugger.js:939
  • dll/src/desktop/shell2/common/debugger/debugger.js:4252 · dll/src/desktop/shell2/common/debugger/debugger.js:4312 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — dll/src/desktop/shell2/common/debugger/debugger.js:4252
  • dll/src/desktop/shell2/common/debugger/debugger.js:3153 · dll/src/desktop/shell2/common/debugger/debugger.js:3181 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — dll/src/desktop/shell2/common/debugger/debugger.js:3153
  • dll/src/desktop/shell2/common/debugger/debugger.js:2842 · dll/src/desktop/shell2/common/debugger/debugger.js:2870 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — dll/src/desktop/shell2/common/debugger/debugger.js:2842
  • dll/src/desktop/shell2/common/debugger/debugger.js:2255 · dll/src/desktop/shell2/common/debugger/debugger.js:2580 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — dll/src/desktop/shell2/common/debugger/debugger.js:2255
  • dll/src/desktop/shell2/common/debugger/debugger.js:2572 · dll/src/desktop/shell2/common/debugger/debugger.js:2929 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — dll/src/desktop/shell2/common/debugger/debugger.js:2572
  • dll/src/desktop/shell2/common/debugger/debugger.js:1408 · dll/src/desktop/shell2/common/debugger/debugger.js:2236 · dll/src/desktop/shell2/common/debugger/debugger.js:2993 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — dll/src/desktop/shell2/common/debugger/debugger.js:1408
  • dll/src/desktop/shell2/common/debugger/debugger.js:1579 · dll/src/desktop/shell2/common/debugger/debugger.js:2025 · dll/src/desktop/shell2/common/debugger/debugger.js:2236 · dll/src/desktop/shell2/common/debugger/debugger.js:2581 · +1 more site(s) not listed — all 5 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — dll/src/desktop/shell2/common/debugger/debugger.js:1579
  • dll/src/desktop/shell2/common/debugger/debugger.js:1923 · dll/src/desktop/shell2/common/debugger/debugger.js:1935 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — dll/src/desktop/shell2/common/debugger/debugger.js:1923
  • dll/src/desktop/shell2/common/debugger/debugger.js:2352 · dll/src/desktop/shell2/common/debugger/debugger.js:2441 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — dll/src/desktop/shell2/common/debugger/debugger.js:2352
  • dll/src/desktop/shell2/common/debugger/debugger.js:3137 · dll/src/desktop/shell2/common/debugger/debugger.js:3167 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — dll/src/desktop/shell2/common/debugger/debugger.js:3137
  • dll/src/desktop/shell2/common/debugger/debugger.js:3582 · dll/src/desktop/shell2/common/debugger/debugger.js:3629 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — dll/src/desktop/shell2/common/debugger/debugger.js:3582
  • dll/src/desktop/shell2/common/debugger/debugger.js:3828 · dll/src/desktop/shell2/common/debugger/debugger.js:3950 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — dll/src/desktop/shell2/common/debugger/debugger.js:3828
  • dll/src/desktop/shell2/common/debugger/debugger.js:3939 · dll/src/desktop/shell2/common/debugger/debugger.js:4479 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — dll/src/desktop/shell2/common/debugger/debugger.js:3939
  • dll/src/desktop/shell2/common/debugger/debugger.js:4130 · dll/src/desktop/shell2/common/debugger/debugger.js:4230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — dll/src/desktop/shell2/common/debugger/debugger.js:4130
  • dll/src/desktop/shell2/common/debugger/debugger.js:1442 · dll/src/desktop/shell2/common/debugger/debugger.js:1463 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — dll/src/desktop/shell2/common/debugger/debugger.js:1442
  • dll/src/desktop/shell2/common/debugger/debugger.js:2915 · dll/src/desktop/shell2/common/debugger/debugger.js:2964 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — dll/src/desktop/shell2/common/debugger/debugger.js:2915
  • dll/src/desktop/shell2/common/debugger/debugger.js:3352 · dll/src/desktop/shell2/common/debugger/debugger.js:3389 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — dll/src/desktop/shell2/common/debugger/debugger.js:3352
  • dll/src/desktop/shell2/common/debugger/debugger.js:1697 · dll/src/desktop/shell2/common/debugger/debugger.js:1705 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — dll/src/desktop/shell2/common/debugger/debugger.js:1697
  • dll/src/desktop/shell2/common/debugger/debugger.js:1649 · dll/src/desktop/shell2/common/debugger/debugger.js:4731 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — dll/src/desktop/shell2/common/debugger/debugger.js:1649
  • dll/src/desktop/shell2/common/debugger/debugger.js:3707 · dll/src/desktop/shell2/common/debugger/debugger.js:4128 · dll/src/desktop/shell2/common/debugger/debugger.js:4201 · dll/src/desktop/shell2/common/debugger/debugger.js:4228 — all 4 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — dll/src/desktop/shell2/common/debugger/debugger.js:3707
  • dll/src/desktop/shell2/common/debugger/debugger.js:2327 · dll/src/desktop/shell2/common/debugger/debugger.js:2378 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — dll/src/desktop/shell2/common/debugger/debugger.js:2327

What to do

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

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

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

  • runStep has cyclomatic complexity 69 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/e2e-web/lib/driver.mjs:187
  • runAssert has cyclomatic complexity 53 and cognitive complexity 68; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/e2e-web/lib/asserts.mjs:53
  • runTest has cyclomatic complexity 42 and cognitive complexity 79; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/e2e-web/run.mjs:191
  • decodePng has cyclomatic complexity 39 and cognitive complexity 49; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/e2e-web/lib/png.mjs:22
  • main has cyclomatic complexity 37 and cognitive complexity 61; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/e2e-web/run.mjs:403
  • _renderTreeNode has cyclomatic complexity 29 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — dll/src/desktop/shell2/common/debugger/debugger.js:656
  • _loop has cyclomatic complexity 27 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — dll/src/desktop/shell2/common/debugger/debugger.js:4572
  • showComponentDetail has cyclomatic complexity 26 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — dll/src/desktop/shell2/common/debugger/debugger.js:2265
  • render has cyclomatic complexity 26 and cognitive complexity 9; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — dll/src/desktop/shell2/common/debugger/debugger.js:3449
  • _parseSlashCommand has cyclomatic complexity 23 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — dll/src/desktop/shell2/common/debugger/debugger.js:4753
  • _loadComponentPreview has cyclomatic complexity 22 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — dll/src/desktop/shell2/common/debugger/debugger.js:2590
  • parseArgs has cyclomatic complexity 22 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/e2e-web/run.mjs:88
  • init has cyclomatic complexity 21 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — dll/src/desktop/shell2/common/debugger/debugger.js:196
  • renderNodeDetail has cyclomatic complexity 21 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — dll/src/desktop/shell2/common/debugger/debugger.js:795
  • assertScreenshot has cyclomatic complexity 21 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/e2e-web/lib/asserts.mjs:191
  • exportCode has cyclomatic complexity 19 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — dll/src/desktop/shell2/common/debugger/debugger.js:1588
  • _loadNodeClipInfo has cyclomatic complexity 19 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — dll/src/desktop/shell2/common/debugger/debugger.js:1313
  • _addCollapsible has cyclomatic complexity 18 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — dll/src/desktop/shell2/common/debugger/debugger.js:3335
  • runTestsInTab has cyclomatic complexity 18 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/e2e-web/run.mjs:333
  • _onMessage has cyclomatic complexity 18 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/e2e-web/lib/cdp.mjs:86
  • _loadNodeBoxModel has cyclomatic complexity 18 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — dll/src/desktop/shell2/common/debugger/debugger.js:1204
  • update has cyclomatic complexity 17 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — dll/src/desktop/shell2/common/debugger/debugger.js:4004
  • ctxCreateComponentFromSubtree has cyclomatic complexity 16 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — dll/src/desktop/shell2/common/debugger/debugger.js:1943
  • _extractBase64Image has cyclomatic complexity 16 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — dll/src/desktop/shell2/common/debugger/debugger.js:4737
  • buildNode has cyclomatic complexity 15 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — dll/src/desktop/shell2/common/debugger/debugger.js:4121
  • pixelDiff has cyclomatic complexity 14 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/e2e-web/lib/png.mjs:176
  • (anonymous) has cyclomatic complexity 14 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — dll/src/desktop/shell2/common/debugger/debugger.js:2686
  • _parseFieldType has cyclomatic complexity 13 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — dll/src/desktop/shell2/common/debugger/debugger.js:4048
  • loadLibraries has cyclomatic complexity 12 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — dll/src/desktop/shell2/common/debugger/debugger.js:2129
  • switchView has cyclomatic complexity 12 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — dll/src/desktop/shell2/common/debugger/debugger.js:581
  • terminalKeydown has cyclomatic complexity 11 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — dll/src/desktop/shell2/common/debugger/debugger.js:3011
  • (anonymous) has cyclomatic complexity 11 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — dll/src/desktop/shell2/common/debugger/debugger.js:967
  • resolvePtr has cyclomatic complexity 11 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — dll/src/desktop/shell2/common/debugger/debugger.js:1856
R3 · Large Files6.0 / 10Adequate✓ Tool-verified

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

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

  • dll/src/desktop/shell2/common/debugger/debugger.js has 4426 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — dll/src/desktop/shell2/common/debugger/debugger.js:1

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R7 · Dead Code10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

X5 · Nullable reference types10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether nullable reference types are enabled and not undermined by heavy `!` suppression.

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

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 Health37%Weak — gated by D2, R1, R2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture97%ExemplarySolid.
Maturity74%StrongSolid.
Readiness65%AdequateAcceptable, with room to improve.
Security57%Adequate — gated by D29Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Event Sourcing100%ExemplaryStrongest area.
Performance100%ExemplarySolid.
Unscored — 7 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.

  • AXH1 Runtime security headers — 9 observation(s) recorded · Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXI1 Runtime container hardening — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • P12 CI test-gate honesty — 1 observation(s) recorded · Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
  • SC1 Supply-chain hygiene — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X9 Subsumed condition operand — 7 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 — 79 check(s) not relevant to this codebase

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

  • AC1 Text alternatives — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
  • AC2 Forms & labels — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
  • AC3 Page structure — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
  • AC4 Keyboard semantics — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
  • AC5 ARIA correctness — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
  • AC6 Visual & motion safety — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
  • AX1 Captive dependencies — no DI registrations detected
  • AX2 Stateful singletons — no singleton implementations detected
  • AX6 Interface segregation — no public interfaces
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AXA1 Runtime unauthenticated reachability — This run crawled public routes only — it had no logged-in session, so there is no authenticated surface to compare anonymous access against and nothing was measured. This is a statement about this run, not about your application: nothing here says access control is missing, and nothing here says it is present.
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility (rendered) — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXS1 Runtime exposed surface — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • C1 Data Protection — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • C2 Access Controls — No access-control surface detected in the analyzed source — no web/app surface to authorize (no HTTP API or web-UI project) and no authorization code at all (no [Authorize]/policies, no imperative guard methods). Access control is therefore N/A here — this is a library/CLI, which is authorized by its CALLER, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
  • C3 Audit Trail — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • C4 Data Retention — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • C5 Data-Subject Rights — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • D10 Test Quality — ~184897 lines of test source are present (.rs) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D11 Test Reliability — Test reliability not included — the .rs suite was found but not re-run
  • D12 Dependency Hygiene — Not scored — 1 direct Go requirement(s) out of 2 in 1 go.mod were read for PINNING discipline and checksum coverage (0 defect(s) reported), but the outdated/deprecated signal needs the Go module proxy, which had no direct requirement to be asked about, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
  • D16 Bus Factor — single-maintainer repository — bus factor is not applicable
  • D18 Solution Shape — D18 scores the shape of a .NET solution, but this repository's production source is mostly .cpp, .java, .py, .rs — the .NET project files present are an immaterial minority — so the dimension does not apply.
  • D20 ADR Quality — N/A — ADRs are expected on deployable products with a user-facing host, not consumed libraries; no ADR log is required here.
  • D21 Naming Consistency — Naming consistency does not read PHP, html yet; not measured.
  • D22 Internal API Consistency — API consistency is measured on C# only; the exposed Rust surface was not measured.
  • D23 Boundary Type-Coupling — single shared-core project — no cross-context coupling to assess
  • D25 ADR Conformance — no ADRs to check
  • D26 Project Cohesion — This repository is one project, `Hello` (37 LoC, 2 public types across 1 namespaces), within the size bounds. Not scored: a single unit of this size gives project cohesion nothing to grade.
  • 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.
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D7 Architectural Integrity — no checkable ADRs and no dependency cycles — architectural integrity not assessed
  • D8 Code Coverage — Coverage not included — suite not readable by the collector
  • DM1 Domain Modelling — applicable but not scored (3 signals for this style, 2 needed — the count is met but a required primary signal is absent): 1 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit); 299 value object(s); 6 domain event(s); its domain events are published by services or handlers — no domain entity raises one; no aggregate is declared and no domain structure surrounds the state-guarding types: not claimed as DDD
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • 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
  • P7 Outbound HTTP resilience — not applicable — this isn't a service/API/worker
  • P8 Schema migrations — no EF Core usage detected
  • 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
  • PF1 Benchmark discipline — Performance is assessed only for perf-relevant repos — a packaged library, one that ships benchmarks, or one already using allocation-aware APIs. This repo isn't one, so the Performance lens is not applicable and is excluded from the score.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
  • R4 Test Coverage — 7 test file(s) reach none of 1 production file(s) via imports — exercised outside the JS import graph (integration/bundled), not import-reachable
  • R5 Dependency Freshness — no package-lock.json — dependency freshness not measured (would require an npm lockfile); JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
  • R6 Tooling — no package.json in the repository — test/lint/typecheck wiring is read from package.json scripts (corroborated against CI), so this project's own toolchain isn't measured here
  • R8 Dependency Hygiene — Not measured — no package.json declares any dependency, so there is nothing to check imports against (imports may resolve through a host runtime rather than node).
  • S1 Web-Security Posture — No web surface detected in the analyzed source — no HTTP API or web-UI project (no controllers/minimal-API endpoints, no Razor/Blazor views) and no web middleware (HTTPS redirection, HSTS, security headers, cookies). Transport security, security headers, secure cookies, CSRF/input-validation and middleware-order controls are therefore N/A here — this is a library/CLI/worker, not a web app. Crypto hygiene was still checked and found nothing to flag. If this codebase becomes web-facing, the dimension reactivates automatically.
  • X1 Async correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X12 Unreachable branch — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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
  • X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X15 Unvalidated length from an untrusted reader — not 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 async method does work a token could cancel
  • X20 Mistyped argument guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X21 Side-effecting pattern guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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 — X24 reached only 1% of this repository's production lines — rust (1,057,898 lines), python (6,179 lines), java (2,535 lines), cpp (996 lines), c (128 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • 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
  • X28 Index access outside its own emptiness guard — 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
  • X30 Support guard that admits what it rejects — 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 — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X4 Structured logging — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

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

Critical — 34 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · High IaC · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
AX9 · CQS / query purity · Query writes persistent state on the read path · ×1
  • Query writes persistent state on the read path: AsyncScreenshotGrabber.get_screenshot webrender/core/src/screen_capture.rs:110 — `AsyncScreenshotGrabber.get_screenshot` is a read-named query yet it performs a durable write on the read path (a persist to a store/repository). A query must stay side-effect-free so reads are safe to retry, cache, and route to a read replica; move the write into a command.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · High vulnerability · ×1
  • REDACTED
Serious — 5915 finding(s)
D2 · Cognitive Complexity · azul_doc · ×353
  • azul_doc::main (cognitive 532) doc/src/main.rs:76 — azul_doc::main has cognitive complexity 532 (threshold 15). Drivers by points: if/else 133 (304 pts), loops 44 (141 pts), match/switch 25 (71 pts), boolean chains 16 (nesting depth added 314). 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.
  • azul_doc::autofix::check_ffi_safety (cognitive 393) doc/src/autofix/mod.rs:1828 — azul_doc::autofix::check_ffi_safety has cognitive complexity 393 (threshold 15). Drivers by points: if/else 61 (262 pts), loops 27 (85 pts), match/switch 7 (25 pts), boolean chains 21 (nesting depth added 277). 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.
  • azul_doc::reftest::apply_midlevel::run (cognitive 246) doc/src/reftest/apply_midlevel.rs:186 — azul_doc::reftest::apply_midlevel::run has cognitive complexity 246 (threshold 15). Drivers by points: if/else 66 (184 pts), match/switch 12 (40 pts), loops 5 (17 pts), boolean chains 5 (nesting depth added 158). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_doc::api::collect_all_referenced_types_from_api_with_chains (cognitive 230) doc/src/api.rs:1837 — azul_doc::api::collect_all_referenced_types_from_api_with_chains has cognitive complexity 230 (threshold 15). Drivers by points: if/else 24 (161 pts), loops 14 (69 pts) (nesting depth added 192). 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.
  • azul_doc::patch::normalize_az_prefixes (cognitive 219) doc/src/patch/mod.rs:760 — azul_doc::patch::normalize_az_prefixes has cognitive complexity 219 (threshold 15). Drivers by points: if/else 26 (147 pts), loops 15 (72 pts) (nesting depth added 178). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_doc::api::find_unused_types_simulating_removal (cognitive 208) doc/src/api.rs:2278 — azul_doc::api::find_unused_types_simulating_removal has cognitive complexity 208 (threshold 15). Drivers by points: if/else 21 (105 pts), loops 21 (84 pts), boolean chains 14, match/switch 2 (5 pts) (nesting depth added 150). 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.
  • azul_doc::autofix::debug::analyze_function_dependencies (cognitive 207) doc/src/autofix/debug.rs:1010 — azul_doc::autofix::debug::analyze_function_dependencies has cognitive complexity 207 (threshold 15). Drivers by points: if/else 40 (152 pts), loops 23 (71 pts), boolean chains 2, match/switch 2 (nesting depth added 160). 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. This shape REPEATS in the file: one other method here (azul_doc::autofix::debug::analyze_function_dependencies::reaches_difficult) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • azul_doc::api::find_unused_types (cognitive 199) doc/src/api.rs:2009 — azul_doc::api::find_unused_types has cognitive complexity 199 (threshold 15). Drivers by points: if/else 19 (97 pts), loops 21 (84 pts), boolean chains 13, match/switch 2 (5 pts) (nesting depth added 144). 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.
  • azul_doc::patch::apply_class_patch (cognitive 154) doc/src/patch/mod.rs:1100 — azul_doc::patch::apply_class_patch has cognitive complexity 154 (threshold 15). Drivers by points: if/else 58 (96 pts), loops 14 (56 pts), boolean chains 2 (nesting depth added 80). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_doc::autofix::function_diff::generate_add_type_patches (cognitive 152) doc/src/autofix/function_diff.rs:1192 — azul_doc::autofix::function_diff::generate_add_type_patches has cognitive complexity 152 (threshold 15). Drivers by points: if/else 38 (111 pts), loops 8 (24 pts), match/switch 4 (10 pts), boolean chains 7 (nesting depth added 95). 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.
  • azul_doc::autofix::workspace::generate_patches (cognitive 149) doc/src/autofix/workspace.rs:432 — azul_doc::autofix::workspace::generate_patches has cognitive complexity 149 (threshold 15). Drivers by points: if/else 43 (107 pts), loops 13 (18 pts), match/switch 6 (15 pts), boolean chains 9 (nesting depth added 78). 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.
  • azul_doc::patch::update_type_references (cognitive 139) doc/src/patch/mod.rs:1906 — azul_doc::patch::update_type_references has cognitive complexity 139 (threshold 15). Drivers by points: if/else 17 (84 pts), loops 13 (55 pts) (nesting depth added 109). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_doc::dllgen::deploy::verify_examples (cognitive 125) doc/src/dllgen/deploy.rs:21 — azul_doc::dllgen::deploy::verify_examples has cognitive complexity 125 (threshold 15). Drivers by points: if/else 28 (106 pts), loops 6 (17 pts), boolean chains 2 (nesting depth added 89). 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.
  • azul_doc::codegen::v2::transmute_helpers::generate_transmuted_fn_body (cognitive 119) doc/src/codegen/v2/transmute_helpers.rs:109 — azul_doc::codegen::v2::transmute_helpers::generate_transmuted_fn_body has cognitive complexity 119 (threshold 15). Drivers by points: if/else 52 (100 pts), boolean chains 15, loops 3 (4 pts) (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_doc::autofix::debug::debug_type_in_index (cognitive 118) doc/src/autofix/debug.rs:18 — azul_doc::autofix::debug::debug_type_in_index has cognitive complexity 118 (threshold 15). Drivers by points: if/else 22 (81 pts), loops 6 (24 pts), match/switch 4 (13 pts) (nesting depth added 86). 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.
  • azul_doc::reftest::autodebug::discover_failing_tests (cognitive 117) doc/src/reftest/autodebug.rs:987 — azul_doc::reftest::autodebug::discover_failing_tests has cognitive complexity 117 (threshold 15). Drivers by points: if/else 39 (84 pts), loops 10 (21 pts), boolean chains 6, match/switch 4 (6 pts) (nesting depth added 58). 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.
  • azul_doc::autofix::diff::resolve_api_functions_with_workspace_index (cognitive 114) doc/src/autofix/diff.rs:781 — azul_doc::autofix::diff::resolve_api_functions_with_workspace_index has cognitive complexity 114 (threshold 15). Drivers by points: loops 14 (69 pts), if/else 10 (45 pts) (nesting depth added 90). 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.
  • azul_doc::autofix::diff::find_dead_type_clusters (cognitive 106) doc/src/autofix/diff.rs:1491 — azul_doc::autofix::diff::find_dead_type_clusters has cognitive complexity 106 (threshold 15). Drivers by points: if/else 23 (73 pts), loops 14 (31 pts), boolean chains 2 (nesting depth added 67). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_doc::autofix::type_index::extract_custom_impls_from_items (cognitive 100) doc/src/autofix/type_index.rs:2890 — azul_doc::autofix::type_index::extract_custom_impls_from_items has cognitive complexity 100 (threshold 15). Drivers by points: if/else 20 (74 pts), loops 6 (25 pts), boolean chains 1 (nesting depth added 73). 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.
  • azul_doc::autofix::check_doc_characters (cognitive 99) doc/src/autofix/mod.rs:3093 — azul_doc::autofix::check_doc_characters has cognitive complexity 99 (threshold 15). Drivers by points: if/else 14 (71 pts), loops 8 (28 pts) (nesting depth added 77). Of this number, 96 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.
  • azul_doc::codegen::v2::lang_csharp::wrappers::emit_wrapper_method (cognitive 94) doc/src/codegen/v2/lang_csharp/wrappers.rs:1419 — azul_doc::codegen::v2::lang_csharp::wrappers::emit_wrapper_method has cognitive complexity 94 (threshold 15). Drivers by points: if/else 47 (63 pts), match/switch 6 (14 pts), loops 6 (10 pts), boolean chains 7 (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.
  • azul_doc::patch::index::extract_types_from_file (cognitive 92) doc/src/patch/index.rs:1196 — azul_doc::patch::index::extract_types_from_file has cognitive complexity 92 (threshold 15). Drivers by points: if/else 22 (69 pts), loops 6 (13 pts), match/switch 3 (9 pts), boolean chains 1 (nesting depth added 60). 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.
  • azul_doc::patch::parser::organize_symbols (cognitive 92) doc/src/patch/parser.rs:932 — azul_doc::patch::parser::organize_symbols has cognitive complexity 92 (threshold 15). Drivers by points: if/else 20 (75 pts), loops 7 (12 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 62). 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.
  • azul_doc::autofix::debug::analyze_ffi_difficulty (cognitive 90) doc/src/autofix/debug.rs:706 — azul_doc::autofix::debug::analyze_ffi_difficulty has cognitive complexity 90 (threshold 15). Drivers by points: if/else 16 (54 pts), loops 12 (34 pts), match/switch 2 (nesting depth added 60). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_doc::autofix::autofix_api (cognitive 89) doc/src/autofix/mod.rs:133 — azul_doc::autofix::autofix_api has cognitive complexity 89 (threshold 15). Drivers by points: if/else 27 (50 pts), loops 15 (23 pts), match/switch 4 (15 pts), boolean chains 1 (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.
  • + 328 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×210
  • FunctionTooLong: azul_dll::desktop::compositor2::translate_displaylist_to_wr dll/src/desktop/compositor2.rs:174 — FunctionTooLong — azul_dll::desktop::compositor2::translate_displaylist_to_wr runs 1483 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 1383 over it, 14.83× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: azul_doc::main doc/src/main.rs:76 — FunctionTooLong — azul_doc::main runs 1375 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 1275 over it, 13.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.
  • FunctionTooLong: azul_dll::desktop::shell2::windows::window_proc dll/src/desktop/shell2/windows/mod.rs:4025 — FunctionTooLong — azul_dll::desktop::shell2::windows::window_proc runs 1359 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 1259 over it, 13.59× 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: azul_layout::solver3::fc::layout_bfc layout/src/solver3/fc.rs:1214 — FunctionTooLong — azul_layout::solver3::fc::layout_bfc runs 1127 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 1027 over it, 11.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: azul_layout::widgets::node_graph::render_node layout/src/widgets/node_graph.rs:1291 — FunctionTooLong — azul_layout::widgets::node_graph::render_node runs 1082 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 982 over it, 10.82× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: azul_layout::solver3::fc::collect_and_measure_inline_content_impl layout/src/solver3/fc.rs:8628 — FunctionTooLong — azul_layout::solver3::fc::collect_and_measure_inline_content_impl runs 671 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 571 over it, 6.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.
  • FunctionTooLong: azul_layout::cpurender::raster::render_single_item layout/src/cpurender/raster.rs:1830 — FunctionTooLong — azul_layout::cpurender::raster::render_single_item runs 660 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 560 over it, 6.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: azul_dll::desktop::shell2::common::layout::regenerate_layout dll/src/desktop/shell2/common/layout.rs:236 — FunctionTooLong — azul_dll::desktop::shell2::common::layout::regenerate_layout runs 639 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 539 over it, 6.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: azul_layout::event_determination::determine_all_events layout/src/event_determination.rs:599 — FunctionTooLong — azul_layout::event_determination::determine_all_events runs 630 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 530 over it, 6.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: webrender::prepare::prepare_interned_prim_for_render webrender/core/src/prepare.rs:316 — FunctionTooLong — webrender::prepare::prepare_interned_prim_for_render runs 594 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 494 over it, 5.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: azul_doc::autofix::type_index::extract_macro_generated_types doc/src/autofix/type_index.rs:1990 — FunctionTooLong — azul_doc::autofix::type_index::extract_macro_generated_types runs 586 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 486 over it, 5.86× 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: azul_doc::reftest::regression::generate_visual_html_report doc/src/reftest/regression.rs:2056 — FunctionTooLong — azul_doc::reftest::regression::generate_visual_html_report runs 583 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 483 over it, 5.83× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: azul_css::props::property::format_static_css_prop css/src/props/property.rs:7917 — FunctionTooLong — azul_css::props::property::format_static_css_prop runs 575 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 475 over it, 5.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.
  • FunctionTooLong: azul_layout::solver3::fc::translate_to_text3_constraints layout/src/solver3/fc.rs:4623 — FunctionTooLong — azul_layout::solver3::fc::translate_to_text3_constraints runs 563 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 463 over it, 5.63× 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: azul_doc::reftest::apply_midlevel::run doc/src/reftest/apply_midlevel.rs:186 — FunctionTooLong — azul_doc::reftest::apply_midlevel::run runs 562 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 462 over it, 5.62× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: azul_css::props::property::parse_combined_css_property css/src/props/property.rs:3689 — FunctionTooLong — azul_css::props::property::parse_combined_css_property runs 544 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 444 over it, 5.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: azul_doc::autofix::autofix_api doc/src/autofix/mod.rs:133 — FunctionTooLong — azul_doc::autofix::autofix_api runs 510 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 410 over it, 5.10× 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: azul_layout::scroll_timer::scroll_physics_timer_callback layout/src/scroll_timer.rs:334 — FunctionTooLong — azul_layout::scroll_timer::scroll_physics_timer_callback runs 469 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 369 over it, 4.69× 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: azul_doc::autofix::check_ffi_safety doc/src/autofix/mod.rs:1828 — FunctionTooLong — azul_doc::autofix::check_ffi_safety runs 448 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 348 over it, 4.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: azul_layout::text3::cache::shape_visual_items layout/src/text3/cache.rs:9473 — FunctionTooLong — azul_layout::text3::cache::shape_visual_items runs 415 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 315 over it, 4.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: webrender::quad::prepare_quad webrender/core/src/quad.rs:66 — FunctionTooLong — webrender::quad::prepare_quad runs 415 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 315 over it, 4.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: azul_layout::solver3::fc::layout_ifc layout/src/solver3/fc.rs:3570 — FunctionTooLong — azul_layout::solver3::fc::layout_ifc runs 413 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 313 over it, 4.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: azul_layout::solver3::cache::reconcile_recursive layout/src/solver3/cache.rs:1540 — FunctionTooLong — azul_layout::solver3::cache::reconcile_recursive runs 406 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 306 over it, 4.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: azul_core::compact::apply_css_property_to_compact core/src/compact.rs:1305 — FunctionTooLong — azul_core::compact::apply_css_property_to_compact runs 394 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 294 over it, 3.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: azul_doc::autofix::print_single_warning doc/src/autofix/mod.rs:2599 — FunctionTooLong — azul_doc::autofix::print_single_warning runs 394 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 294 over it, 3.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.
  • + 185 more in this group — see findings.md.
D2 · Cognitive Complexity · azul_layout · ×203
  • azul_layout::solver3::fc::layout_bfc (cognitive 295) layout/src/solver3/fc.rs:1214 — azul_layout::solver3::fc::layout_bfc has cognitive complexity 295 (threshold 15). Drivers by points: if/else 109 (248 pts), boolean chains 30, loops 6 (11 pts), match/switch 4 (6 pts) (nesting depth added 146). 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.
  • azul_layout::solver3::positioning::position_out_of_flow_elements (cognitive 225) layout/src/solver3/positioning.rs:160 — azul_layout::solver3::positioning::position_out_of_flow_elements has cognitive complexity 225 (threshold 15). Drivers by points: if/else 65 (170 pts), boolean chains 26, match/switch 6 (19 pts), loops 3 (10 pts) (nesting depth added 125). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • azul_layout::xml::parse_xml_to_fast_dom_with_css (cognitive 220) layout/src/xml/mod.rs:334 — azul_layout::xml::parse_xml_to_fast_dom_with_css has cognitive complexity 220 (threshold 15). Drivers by points: if/else 58 (182 pts), loops 8 (17 pts), match/switch 6 (15 pts), boolean chains 6 (nesting depth added 142). Of this number, 216 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • azul_layout::solver3::layout_document (cognitive 213) layout/src/solver3/mod.rs:544 — azul_layout::solver3::layout_document has cognitive complexity 213 (threshold 15). Drivers by points: if/else 69 (157 pts), loops 17 (36 pts), boolean chains 14, match/switch 3 (6 pts) (nesting depth added 110). Of this number, 208 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • azul_layout::scroll_timer::scroll_physics_timer_callback (cognitive 209) layout/src/scroll_timer.rs:334 — azul_layout::scroll_timer::scroll_physics_timer_callback has cognitive complexity 209 (threshold 15). Drivers by points: if/else 55 (148 pts), boolean chains 40, loops 10 (11 pts), match/switch 5 (10 pts) (nesting depth added 99). 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.
  • azul_layout::event_determination::determine_all_events (cognitive 191) layout/src/event_determination.rs:599 — azul_layout::event_determination::determine_all_events has cognitive complexity 191 (threshold 15). Drivers by points: if/else 71 (140 pts), boolean chains 26, loops 10 (13 pts), match/switch 4 (12 pts) (nesting depth added 80). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_layout::text3::cache::shape_visual_items (cognitive 164) layout/src/text3/cache.rs:9473 — azul_layout::text3::cache::shape_visual_items has cognitive complexity 164 (threshold 15). Drivers by points: if/else 35 (112 pts), loops 9 (34 pts), match/switch 5 (16 pts), boolean chains 2 (nesting depth added 113). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_layout::text3::cache::position_one_line (cognitive 161) layout/src/text3/cache.rs:11839 — azul_layout::text3::cache::position_one_line has cognitive complexity 161 (threshold 15). Drivers by points: if/else 55 (135 pts), boolean chains 12, match/switch 4 (9 pts), loops 3 (5 pts) (nesting depth added 87). 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.
  • azul_layout::solver3::cache::reconcile_recursive (cognitive 160) layout/src/solver3/cache.rs:1540 — azul_layout::solver3::cache::reconcile_recursive has cognitive complexity 160 (threshold 15). Drivers by points: if/else 51 (136 pts), loops 4 (14 pts), boolean chains 8, match/switch 2 (nesting depth added 95). 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.
  • azul_layout::text3::cache::perform_fragment_layout (cognitive 151) layout/src/text3/cache.rs:10761 — azul_layout::text3::cache::perform_fragment_layout has cognitive complexity 151 (threshold 15). Drivers by points: if/else 46 (118 pts), match/switch 4 (14 pts), loops 5 (11 pts), boolean chains 8 (nesting depth added 88). 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.
  • azul_layout::solver3::fc::position_table_cells (cognitive 131) layout/src/solver3/fc.rs:7936 — azul_layout::solver3::fc::position_table_cells has cognitive complexity 131 (threshold 15). Drivers by points: if/else 38 (100 pts), loops 8 (17 pts), match/switch 4 (13 pts), boolean chains 1 (nesting depth added 80). 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.
  • azul_layout::cpurender::raster::render_single_item (cognitive 124) layout/src/cpurender/raster.rs:1830 — azul_layout::cpurender::raster::render_single_item has cognitive complexity 124 (threshold 15). Drivers by points: if/else 34 (91 pts), loops 7 (24 pts), boolean chains 8, match/switch 1 (nesting depth added 74). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_layout::cpurender::compositor::compute_display_list_damage_impl (cognitive 121) layout/src/cpurender/compositor.rs:2982 — azul_layout::cpurender::compositor::compute_display_list_damage_impl has cognitive complexity 121 (threshold 15). Drivers by points: if/else 30 (102 pts), boolean chains 10, match/switch 2 (8 pts), loops 1 (nesting depth added 78). 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.
  • azul_layout::solver3::display_list::paginate_pages_impl (cognitive 121) layout/src/solver3/display_list.rs:9722 — azul_layout::solver3::display_list::paginate_pages_impl has cognitive complexity 121 (threshold 15). Drivers by points: if/else 30 (80 pts), loops 11 (30 pts), boolean chains 9, match/switch 1 (2 pts) (nesting depth added 70). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_layout::solver3::fc::collect_and_measure_inline_content_impl (cognitive 121) layout/src/solver3/fc.rs:8628 — azul_layout::solver3::fc::collect_and_measure_inline_content_impl has cognitive complexity 121 (threshold 15). Drivers by points: if/else 45 (99 pts), match/switch 4 (11 pts), loops 3 (7 pts), boolean chains 4 (nesting depth added 65). 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.
  • azul_layout::solver3::fc::translate_to_text3_constraints (cognitive 120) layout/src/solver3/fc.rs:4623 — azul_layout::solver3::fc::translate_to_text3_constraints has cognitive complexity 120 (threshold 15). Drivers by points: if/else 64 (75 pts), match/switch 28 (43 pts), boolean chains 2 (nesting depth added 26). 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.
  • azul_layout::solver3::fc::layout_ifc (cognitive 105) layout/src/solver3/fc.rs:3570 — azul_layout::solver3::fc::layout_ifc has cognitive complexity 105 (threshold 15). Drivers by points: if/else 36 (79 pts), match/switch 9 (13 pts), loops 5 (10 pts), boolean chains 3 (nesting depth added 52). 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.
  • azul_layout::text3::cache::break_one_line (cognitive 100) layout/src/text3/cache.rs:11352 — azul_layout::text3::cache::break_one_line has cognitive complexity 100 (threshold 15). Drivers by points: if/else 26 (78 pts), loops 5 (14 pts), match/switch 1 (5 pts), boolean chains 3 (nesting depth added 65). 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.
  • azul_layout::text3::cache::create_logical_items (cognitive 96) layout/src/text3/cache.rs:8352 — azul_layout::text3::cache::create_logical_items has cognitive complexity 96 (threshold 15). Drivers by points: if/else 24 (74 pts), match/switch 3 (9 pts), loops 4 (8 pts), boolean chains 5 (nesting depth added 60). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_layout::solver3::sizing::calculate_used_size_for_node (cognitive 85) layout/src/solver3/sizing.rs:1730 — azul_layout::solver3::sizing::calculate_used_size_for_node has cognitive complexity 85 (threshold 15). Drivers by points: if/else 41 (52 pts), match/switch 12 (21 pts), boolean chains 12 (nesting depth added 20). 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.
  • azul_layout::widgets::node_graph::nodegraph_drag_graph_or_nodes (cognitive 84) layout/src/widgets/node_graph.rs:3109 — azul_layout::widgets::node_graph::nodegraph_drag_graph_or_nodes has cognitive complexity 84 (threshold 15). Drivers by points: if/else 28 (63 pts), match/switch 6 (13 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_layout::solver3::cache::calculate_layout_for_subtree_fragment (cognitive 83) layout/src/solver3/cache.rs:3020 — azul_layout::solver3::cache::calculate_layout_for_subtree_fragment has cognitive complexity 83 (threshold 15). Drivers by points: if/else 29 (60 pts), match/switch 5 (10 pts), boolean chains 8, loops 2 (5 pts) (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_layout::solver3::display_list::split_text_for_glides (cognitive 81) layout/src/solver3/display_list.rs:702 — azul_layout::solver3::display_list::split_text_for_glides has cognitive complexity 81 (threshold 15). Drivers by points: if/else 17 (54 pts), loops 5 (15 pts), boolean chains 7, match/switch 1 (5 pts) (nesting depth added 51). Of this number, 80 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • azul_layout::solver3::getters::get_style_properties_for_state (cognitive 74) layout/src/solver3/getters.rs:3042 — azul_layout::solver3::getters::get_style_properties_for_state has cognitive complexity 74 (threshold 15). Drivers by points: if/else 41 (68 pts), match/switch 5, boolean chains 1 (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.
  • azul_layout::solver3::fc::calculate_row_heights (cognitive 71) layout/src/solver3/fc.rs:7730 — azul_layout::solver3::fc::calculate_row_heights has cognitive complexity 71 (threshold 15). Drivers by points: if/else 18 (53 pts), loops 8 (16 pts), boolean chains 2 (nesting depth added 43). 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.
  • + 178 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×194
  • FileTooLong: src/window.rs layout/src/window.rs — FileTooLong — 11355 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 43 free functions. The bar is 500 significant lines; this is 10855 over it, 22.71× 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: text3/cache.rs layout/src/text3/cache.rs — FileTooLong — 7600 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 80 free functions. The bar is 500 significant lines; this is 7100 over it, 15.20× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: props/property.rs css/src/props/property.rs — FileTooLong — 6726 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 6226 over it, 13.45× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: common/event.rs dll/src/desktop/shell2/common/event.rs — FileTooLong — 6645 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 37 free functions. The bar is 500 significant lines; this is 6145 over it, 13.29× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: solver3/display_list.rs layout/src/solver3/display_list.rs — FileTooLong — 6589 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 52 free functions. The bar is 500 significant lines; this is 6089 over it, 13.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: web/transpiler_remill.rs dll/src/web/transpiler_remill.rs — FileTooLong — 6346 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 98 free functions. The bar is 500 significant lines; this is 5846 over it, 12.69× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: solver3/fc.rs layout/src/solver3/fc.rs — FileTooLong — 6174 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 73 free functions. The bar is 500 significant lines; this is 5674 over it, 12.35× 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: wayland/mod.rs dll/src/desktop/shell2/linux/wayland/mod.rs — FileTooLong — 6037 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: WaylandWindow (7 blocks, 544-11092). The bar is 500 significant lines; this is 5537 over it, 12.07× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: src/xml.rs core/src/xml.rs — FileTooLong — 5574 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 85 free functions. The bar is 500 significant lines; this is 5074 over it, 11.15× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: macos/mod.rs dll/src/desktop/shell2/macos/mod.rs — FileTooLong — 4973 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 4473 over it, 9.95× 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: x11/mod.rs dll/src/desktop/shell2/linux/x11/mod.rs — FileTooLong — 4866 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 71% of them inside a single declaration: X11Window (11 blocks, 1743-8843), declaring 34 free functions. The bar is 500 significant lines; this is 4366 over it, 9.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/picture.rs webrender/core/src/picture.rs — FileTooLong — 4641 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 4141 over it, 9.28× 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: windows/mod.rs dll/src/desktop/shell2/windows/mod.rs — FileTooLong — 4127 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 3627 over it, 8.25× 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/dom.rs core/src/dom.rs — FileTooLong — 4042 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 3542 over it, 8.08× 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: solver3/getters.rs layout/src/solver3/getters.rs — FileTooLong — 4040 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 195 free functions. The bar is 500 significant lines; this is 3540 over it, 8.08× 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: renderer/mod.rs webrender/core/src/renderer/mod.rs — FileTooLong — 3739 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 84% of them inside a single declaration: Renderer (3 blocks, 761-5971). The bar is 500 significant lines; this is 3239 over it, 7.48× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: cpurender/raster.rs layout/src/cpurender/raster.rs — FileTooLong — 3522 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 60 free functions. The bar is 500 significant lines; this is 3022 over it, 7.04× 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: debugger/debugger.js dll/src/desktop/shell2/common/debugger/debugger.js — FileTooLong — 3378 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 2878 over it, 6.76× 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/prop_cache.rs core/src/prop_cache.rs — FileTooLong — 3300 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 77% of them inside a single declaration: CssPropertyCache (5 blocks, 1017-5395). The bar is 500 significant lines; this is 2800 over it, 6.60× 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/callbacks.rs layout/src/callbacks.rs — FileTooLong — 3105 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 77% of them inside a single declaration: CallbackInfo (3 blocks, 1162-7027). The bar is 500 significant lines; this is 2605 over it, 6.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/gl.rs core/src/gl.rs — FileTooLong — 3001 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 2501 over it, 6.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.
  • FileTooLong: src/scene_building.rs webrender/core/src/scene_building.rs — FileTooLong — 3001 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 84% of them inside a single declaration: SceneBuilder (2 blocks, 434-4302). The bar is 500 significant lines; this is 2501 over it, 6.00× 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: device/gl.rs webrender/core/src/device/gl.rs — FileTooLong — 2917 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 2417 over it, 5.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: wayland/events.rs dll/src/desktop/shell2/linux/wayland/events.rs — FileTooLong — 2811 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 169 free functions. The bar is 500 significant lines; this is 2311 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/batch.rs webrender/core/src/batch.rs — FileTooLong — 2766 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 75% of them inside a single declaration: BatchBuilder (2 blocks, 729-3635). The bar is 500 significant lines; this is 2266 over it, 5.53× 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.
  • + 169 more in this group — see findings.md.
D1 · Cyclomatic Complexity · azul_doc · ×177
  • azul_doc::main (cyclomatic 266) doc/src/main.rs:76 — azul_doc::main has cyclomatic complexity 266 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_doc::autofix::check_ffi_safety (cyclomatic 117) doc/src/autofix/mod.rs:1828 — azul_doc::autofix::check_ffi_safety has cyclomatic complexity 117 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_doc::reftest::apply_midlevel::run (cyclomatic 85) doc/src/reftest/apply_midlevel.rs:186 — azul_doc::reftest::apply_midlevel::run has cyclomatic complexity 85 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_doc::autofix::autofix_api (cyclomatic 81) doc/src/autofix/mod.rs:133 — azul_doc::autofix::autofix_api has cyclomatic complexity 81 (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.
  • azul_doc::autofix::workspace::generate_patches (cyclomatic 73) doc/src/autofix/workspace.rs:432 — azul_doc::autofix::workspace::generate_patches has cyclomatic complexity 73 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_doc::autofix::debug::analyze_function_dependencies (cyclomatic 63) doc/src/autofix/debug.rs:1010 — azul_doc::autofix::debug::analyze_function_dependencies has cyclomatic complexity 63 (threshold 15). Of this number, 53 points are the body's own statements and 10 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.
  • azul_doc::patch::apply_class_patch (cyclomatic 63) doc/src/patch/mod.rs:1100 — azul_doc::patch::apply_class_patch has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_doc::codegen::v2::lang_csharp::wrappers::emit_wrapper_method (cyclomatic 61) doc/src/codegen/v2/lang_csharp/wrappers.rs:1419 — azul_doc::codegen::v2::lang_csharp::wrappers::emit_wrapper_method has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_doc::api::find_unused_types_simulating_removal (cyclomatic 59) doc/src/api.rs:2278 — azul_doc::api::find_unused_types_simulating_removal 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.
  • azul_doc::api::find_unused_types (cyclomatic 56) doc/src/api.rs:2009 — azul_doc::api::find_unused_types 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.
  • azul_doc::codegen::v2::transmute_helpers::generate_transmuted_fn_body (cyclomatic 55) doc/src/codegen/v2/transmute_helpers.rs:109 — azul_doc::codegen::v2::transmute_helpers::generate_transmuted_fn_body has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_doc::reftest::autodebug::discover_failing_tests (cyclomatic 53) doc/src/reftest/autodebug.rs:987 — azul_doc::reftest::autodebug::discover_failing_tests has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_doc::autofix::function_diff::generate_add_type_patches (cyclomatic 52) doc/src/autofix/function_diff.rs:1192 — azul_doc::autofix::function_diff::generate_add_type_patches has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_doc::codegen::v2::lang_haskell::wrappers::emit_function (cyclomatic 49) doc/src/codegen/v2/lang_haskell/wrappers.rs:2049 — azul_doc::codegen::v2::lang_haskell::wrappers::emit_function has cyclomatic complexity 49 (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.
  • azul_doc::reftest::autodoc::build_autodoc_prompt (cyclomatic 47) doc/src/reftest/autodoc.rs:345 — azul_doc::reftest::autodoc::build_autodoc_prompt has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_doc::autofix::module_map::module_from_external_path (cyclomatic 42) doc/src/autofix/module_map.rs:802 — azul_doc::autofix::module_map::module_from_external_path has cyclomatic complexity 42 (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.
  • azul_doc::patch::normalize_az_prefixes (cyclomatic 41) doc/src/patch/mod.rs:760 — azul_doc::patch::normalize_az_prefixes has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_doc::autofix::diff::find_dead_type_clusters (cyclomatic 40) doc/src/autofix/diff.rs:1491 — azul_doc::autofix::diff::find_dead_type_clusters 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.
  • azul_doc::api::collect_all_referenced_types_from_api_with_chains (cyclomatic 39) doc/src/api.rs:1837 — azul_doc::api::collect_all_referenced_types_from_api_with_chains has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_doc::codegen::v2::lang_lua::cdef::strip_preprocessor (cyclomatic 39) doc/src/codegen/v2/lang_lua/cdef.rs:175 — azul_doc::codegen::v2::lang_lua::cdef::strip_preprocessor has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_doc::gene2e::parse_schema (cyclomatic 39) doc/src/gene2e.rs:641 — azul_doc::gene2e::parse_schema has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_doc::autofix::diff::generate_diff_v2 (cyclomatic 38) doc/src/autofix/diff.rs:1111 — azul_doc::autofix::diff::generate_diff_v2 has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_doc::lint_examples::check_line (cyclomatic 36) doc/src/lint_examples.rs:442 — azul_doc::lint_examples::check_line has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_doc::autofix::generate_combined_patch (cyclomatic 35) doc/src/autofix/mod.rs:839 — azul_doc::autofix::generate_combined_patch has cyclomatic complexity 35 (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.
  • azul_doc::autofix::debug::debug_type_in_index (cyclomatic 35) doc/src/autofix/debug.rs:18 — azul_doc::autofix::debug::debug_type_in_index has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • + 152 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×167
  • Hotspot: dll/src/desktop/shell2/common/event.rs dll/src/desktop/shell2/common/event.rs:4824 — dll/src/desktop/shell2/common/event.rs changed 200 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 315 in PlatformWindow::apply_user_change at line 4824. 84 of those changes were fix/bug commits, and the other 116 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- dll/src/desktop/shell2/common/event.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: layout/src/window.rs layout/src/window.rs:5543 — layout/src/window.rs changed 296 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 89 in LayoutWindow::layout_dom_recursive_impl at line 5543. 126 of those changes were fix/bug commits, and the other 170 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- layout/src/window.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: dll/src/desktop/shell2/windows/mod.rs dll/src/desktop/shell2/windows/mod.rs:4025 — dll/src/desktop/shell2/windows/mod.rs changed 90 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 205 in azul_dll::desktop::shell2::windows::window_proc at line 4025. 44 of those changes were fix/bug commits, and the other 46 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- dll/src/desktop/shell2/windows/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: dll/src/desktop/shell2/linux/wayland/mod.rs dll/src/desktop/shell2/linux/wayland/mod.rs:7011 — dll/src/desktop/shell2/linux/wayland/mod.rs changed 128 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 104 in WaylandWindow::generate_frame_if_needed at line 7011. 63 of those changes were fix/bug commits, and the other 65 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- dll/src/desktop/shell2/linux/wayland/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: dll/src/desktop/shell2/headless/mod.rs dll/src/desktop/shell2/headless/mod.rs:2258 — dll/src/desktop/shell2/headless/mod.rs changed 115 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 92 in HeadlessWindow::run at line 2258. 63 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-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- dll/src/desktop/shell2/headless/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: doc/src/main.rs doc/src/main.rs:76 — doc/src/main.rs changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 266 in azul_doc::main at line 76. 13 of those changes were fix/bug commits, and the other 19 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- doc/src/main.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: dll/src/desktop/shell2/linux/x11/mod.rs dll/src/desktop/shell2/linux/x11/mod.rs:4836 — dll/src/desktop/shell2/linux/x11/mod.rs changed 105 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 72 in X11Window::handle_event at line 4836. 49 of those changes were fix/bug commits, and the other 56 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- dll/src/desktop/shell2/linux/x11/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: layout/src/solver3/fc.rs layout/src/solver3/fc.rs:1214 — layout/src/solver3/fc.rs changed 50 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 123 in azul_layout::solver3::fc::layout_bfc at line 1214. 22 of those changes were fix/bug commits, and the other 28 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- layout/src/solver3/fc.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: layout/src/cpurender/raster.rs layout/src/cpurender/raster.rs:1830 — layout/src/cpurender/raster.rs changed 67 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 85 in azul_layout::cpurender::raster::render_single_item at line 1830. 29 of those changes were fix/bug commits, and the other 38 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- layout/src/cpurender/raster.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: layout/src/solver3/display_list.rs layout/src/solver3/display_list.rs:1883 — layout/src/solver3/display_list.rs changed 91 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in DisplayListItem::is_visually_equal at line 1883. 43 of those changes were fix/bug commits, and the other 48 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- layout/src/solver3/display_list.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: dll/src/desktop/shell2/macos/mod.rs dll/src/desktop/shell2/macos/mod.rs:7700 — dll/src/desktop/shell2/macos/mod.rs changed 86 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 56 in MacOSWindow::render_and_present_in_draw_rect at line 7700. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- dll/src/desktop/shell2/macos/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: dll/src/desktop/shell2/common/layout.rs dll/src/desktop/shell2/common/layout.rs:236 — dll/src/desktop/shell2/common/layout.rs changed 59 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 79 in azul_dll::desktop::shell2::common::layout::regenerate_layout at line 236. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- dll/src/desktop/shell2/common/layout.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: dll/src/desktop/shell2/android/mod.rs dll/src/desktop/shell2/android/mod.rs:1262 — dll/src/desktop/shell2/android/mod.rs changed 63 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 68 in azul_dll::desktop::shell2::android::drain_input at line 1262. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- dll/src/desktop/shell2/android/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: layout/src/solver3/mod.rs layout/src/solver3/mod.rs:544 — layout/src/solver3/mod.rs changed 44 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 96 in azul_layout::solver3::layout_document at line 544. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- layout/src/solver3/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: dll/src/web/transpiler_remill.rs dll/src/web/transpiler_remill.rs:2167 — dll/src/web/transpiler_remill.rs changed 48 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 86 in RemillTranspiler::lift_with_transitive_deps_sequential at line 2167. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- dll/src/web/transpiler_remill.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: layout/src/text3/cache.rs layout/src/text3/cache.rs:11839 — layout/src/text3/cache.rs changed 55 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 72 in azul_layout::text3::cache::position_one_line at line 11839. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- layout/src/text3/cache.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: core/src/compact.rs core/src/compact.rs:1305 — core/src/compact.rs changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 190 in azul_core::compact::apply_css_property_to_compact at line 1305. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- core/src/compact.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: layout/src/event_determination.rs layout/src/event_determination.rs:599 — layout/src/event_determination.rs changed 33 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 114 in azul_layout::event_determination::determine_all_events at line 599. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- layout/src/event_determination.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: layout/src/scroll_timer.rs layout/src/scroll_timer.rs:334 — layout/src/scroll_timer.rs changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 109 in azul_layout::scroll_timer::scroll_physics_timer_callback at line 334. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- layout/src/scroll_timer.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: layout/src/solver3/cache.rs layout/src/solver3/cache.rs:1540 — layout/src/solver3/cache.rs changed 47 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 60 in azul_layout::solver3::cache::reconcile_recursive at line 1540. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- layout/src/solver3/cache.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: core/src/prop_cache.rs core/src/prop_cache.rs:1570 — core/src/prop_cache.rs changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 77 in CssPropertyCache::restyle at line 1570. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- core/src/prop_cache.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: layout/src/solver3/getters.rs layout/src/solver3/getters.rs:3042 — layout/src/solver3/getters.rs changed 50 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in azul_layout::solver3::getters::get_style_properties_for_state at line 3042. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- layout/src/solver3/getters.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: dll/src/desktop/shell2/ios/mod.rs dll/src/desktop/shell2/ios/mod.rs:331 — dll/src/desktop/shell2/ios/mod.rs changed 46 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in azul_dll::desktop::shell2::ios::handle_touch at line 331. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- dll/src/desktop/shell2/ios/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: dll/src/desktop/shell2/run.rs dll/src/desktop/shell2/run.rs:1963 — dll/src/desktop/shell2/run.rs changed 38 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in azul_dll::desktop::shell2::run::run at line 1963. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- dll/src/desktop/shell2/run.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: layout/src/solver3/taffy_bridge.rs layout/src/solver3/taffy_bridge.rs:734 — layout/src/solver3/taffy_bridge.rs changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 74 in TaffyBridge::translate_style_to_taffy at line 734. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- layout/src/solver3/taffy_bridge.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.
  • + 142 more in this group — see findings.md.
D2 · Cognitive Complexity · azul_dll · ×152
  • azul_dll::desktop::shell2::windows::window_proc (cognitive 372) dll/src/desktop/shell2/windows/mod.rs:4025 — azul_dll::desktop::shell2::windows::window_proc has cognitive complexity 372 (threshold 15). Drivers by points: if/else 129 (315 pts), match/switch 15 (38 pts), boolean chains 15, loops 1 (4 pts) (nesting depth added 212). 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.
  • azul_dll::desktop::compositor2::translate_displaylist_to_wr (cognitive 187) dll/src/desktop/compositor2.rs:174 — azul_dll::desktop::compositor2::translate_displaylist_to_wr has cognitive complexity 187 (threshold 15). Drivers by points: if/else 57 (142 pts), match/switch 13 (37 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 112). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_dll::desktop::shell2::common::layout::regenerate_layout (cognitive 183) dll/src/desktop/shell2/common/layout.rs:236 — azul_dll::desktop::shell2::common::layout::regenerate_layout has cognitive complexity 183 (threshold 15). Drivers by points: if/else 48 (117 pts), loops 18 (43 pts), match/switch 6 (12 pts), boolean chains 11 (nesting depth added 100). 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.
  • azul_dll::desktop::shell2::run::run (cognitive 171) dll/src/desktop/shell2/run.rs:1963 — azul_dll::desktop::shell2::run::run has cognitive complexity 171 (threshold 15). Drivers by points: if/else 31 (109 pts), loops 10 (32 pts), match/switch 11 (29 pts), boolean chains 1 (nesting depth added 118). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_dll::desktop::shell2::linux::x11::init_xinput2 (cognitive 138) dll/src/desktop/shell2/linux/x11/mod.rs:866 — azul_dll::desktop::shell2::linux::x11::init_xinput2 has cognitive complexity 138 (threshold 15). Drivers by points: if/else 46 (113 pts), boolean chains 12, loops 5 (12 pts), match/switch 1 (nesting depth added 74). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • azul_dll::desktop::extra::video_codec::stream::decode_stream (cognitive 132) dll/src/desktop/extra/video_codec/stream.rs:96 — azul_dll::desktop::extra::video_codec::stream::decode_stream has cognitive complexity 132 (threshold 15). Drivers by points: if/else 28 (95 pts), match/switch 7 (20 pts), loops 5 (15 pts), boolean chains 2 (nesting depth added 90). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_dll::desktop::shell2::android::drain_input (cognitive 130) dll/src/desktop/shell2/android/mod.rs:1262 — azul_dll::desktop::shell2::android::drain_input has cognitive complexity 130 (threshold 15). Drivers by points: if/else 38 (97 pts), match/switch 11 (21 pts), loops 5 (7 pts), boolean chains 5 (nesting depth added 71). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_dll::web::symbol_table::classify_for_name (cognitive 127) dll/src/web/symbol_table.rs:2437 — azul_dll::web::symbol_table::classify_for_name has cognitive complexity 127 (threshold 15). Drivers by points: if/else 49 (80 pts), boolean chains 36, loops 6 (7 pts), match/switch 2 (4 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_dll::web::symbol_table::compute_hashbrown_empty_group_ranges (cognitive 112) dll/src/web/symbol_table.rs:3247 — azul_dll::web::symbol_table::compute_hashbrown_empty_group_ranges has cognitive complexity 112 (threshold 15). Drivers by points: if/else 19 (66 pts), loops 9 (28 pts), boolean chains 12, match/switch 3 (6 pts) (nesting depth added 69). 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.
  • azul_dll::web::transpiler_remill::collect_synth_data_pages (cognitive 110) dll/src/web/transpiler_remill.rs:4742 — azul_dll::web::transpiler_remill::collect_synth_data_pages has cognitive complexity 110 (threshold 15). Drivers by points: if/else 28 (75 pts), loops 11 (30 pts), boolean chains 5 (nesting depth added 66). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_dll::desktop::shell2::run::run (cognitive 94) dll/src/desktop/shell2/run.rs:1477 — azul_dll::desktop::shell2::run::run has cognitive complexity 94 (threshold 15). Drivers by points: if/else 22 (68 pts), loops 9 (20 pts), match/switch 2 (6 pts) (nesting depth added 61). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_dll::desktop::shell2::linux::x11::handle_xi_device_event (cognitive 93) dll/src/desktop/shell2/linux/x11/mod.rs:2048 — azul_dll::desktop::shell2::linux::x11::handle_xi_device_event has cognitive complexity 93 (threshold 15). Drivers by points: if/else 30 (64 pts), match/switch 8 (24 pts), boolean chains 5 (nesting depth added 50). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • azul_dll::desktop::shell2::ios::handle_touch (cognitive 90) dll/src/desktop/shell2/ios/mod.rs:331 — azul_dll::desktop::shell2::ios::handle_touch has cognitive complexity 90 (threshold 15). Drivers by points: if/else 32 (72 pts), loops 3 (8 pts), match/switch 5 (6 pts), boolean chains 4 (nesting depth added 46). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • azul_dll::web::transpiler_remill::reloc_canonicalize (cognitive 89) dll/src/web/transpiler_remill.rs:7689 — azul_dll::web::transpiler_remill::reloc_canonicalize has cognitive complexity 89 (threshold 15). Drivers by points: if/else 19 (58 pts), loops 6 (22 pts), boolean chains 9 (nesting depth added 55). 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.
  • azul_dll::web::transpiler_remill::inject_user_binary_data_segments (cognitive 83) dll/src/web/transpiler_remill.rs:4024 — azul_dll::web::transpiler_remill::inject_user_binary_data_segments has cognitive complexity 83 (threshold 15). Drivers by points: if/else 24 (62 pts), loops 8 (14 pts), boolean chains 5, match/switch 2 (nesting depth added 44). 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.
  • azul_dll::desktop::shell2::run::run (cognitive 79) dll/src/desktop/shell2/run.rs:620 — azul_dll::desktop::shell2::run::run has cognitive complexity 79 (threshold 15). Drivers by points: loops 11 (35 pts), if/else 16 (28 pts), match/switch 5 (16 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.
  • azul_dll::web::transpiler_remill::scan_arm64_adrp_accesses (cognitive 78) dll/src/web/transpiler_remill.rs:11061 — azul_dll::web::transpiler_remill::scan_arm64_adrp_accesses has cognitive complexity 78 (threshold 15). Drivers by points: if/else 29 (67 pts), match/switch 3 (8 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.
  • azul_dll::web::lift_audit::audit_wasm (cognitive 77) dll/src/web/lift_audit.rs:198 — azul_dll::web::lift_audit::audit_wasm has cognitive complexity 77 (threshold 15). Drivers by points: if/else 14 (50 pts), loops 5 (18 pts), match/switch 2 (6 pts), boolean chains 3 (nesting depth added 53). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_dll::web::symbol_table::read_pdb_function_symbols (cognitive 74) dll/src/web/symbol_table.rs:1538 — azul_dll::web::symbol_table::read_pdb_function_symbols has cognitive complexity 74 (threshold 15). Drivers by points: if/else 19 (63 pts), loops 3 (9 pts), boolean chains 2 (nesting depth added 50). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • azul_dll::desktop::extra::gamepad::apple::poll (cognitive 72) dll/src/desktop/extra/gamepad/apple.rs:112 — azul_dll::desktop::extra::gamepad::apple::poll has cognitive complexity 72 (threshold 15). Drivers by points: if/else 31 (67 pts), boolean chains 4, loops 1 (nesting depth added 36). 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.
  • azul_dll::desktop::tray::linux::menu_message (cognitive 69) dll/src/desktop/tray/linux.rs:778 — azul_dll::desktop::tray::linux::menu_message has cognitive complexity 69 (threshold 15). Drivers by points: if/else 21 (50 pts), loops 3 (9 pts), boolean chains 6, match/switch 2 (4 pts) (nesting depth added 37). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • azul_dll::desktop::shell2::common::layout::apply_runtime_states_before_layout (cognitive 67) dll/src/desktop/shell2/common/layout.rs:1760 — azul_dll::desktop::shell2::common::layout::apply_runtime_states_before_layout has cognitive complexity 67 (threshold 15). Drivers by points: if/else 19 (60 pts), loops 2 (7 pts) (nesting depth added 46). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • azul_dll::web::run_web (cognitive 64) dll/src/web/mod.rs:1007 — azul_dll::web::run_web has cognitive complexity 64 (threshold 15). Drivers by points: loops 17 (31 pts), if/else 21 (30 pts), match/switch 2, boolean chains 1 (nesting depth added 23). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • azul_dll::web::server::handle_connection (cognitive 64) dll/src/web/server.rs:155 — azul_dll::web::server::handle_connection has cognitive complexity 64 (threshold 15). Drivers by points: if/else 29 (51 pts), boolean chains 6, loops 2 (4 pts), match/switch 2 (3 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_dll::desktop::shell2::common::transient::sync_parent (cognitive 62) dll/src/desktop/shell2/common/transient.rs:451 — azul_dll::desktop::shell2::common::transient::sync_parent has cognitive complexity 62 (threshold 15). Drivers by points: if/else 22 (51 pts), match/switch 4 (5 pts), loops 4, boolean chains 2 (nesting depth added 30). 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.
  • + 127 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×136
  • MethodTooLong: BatchBuilder.add_prim_to_batch webrender/core/src/batch.rs:815 — MethodTooLong — add_prim_to_batch 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.
  • MethodTooLong: PicturePrimitive.take_context webrender/core/src/picture.rs:5302 — MethodTooLong — take_context runs 885 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 785 over it, 8.85× 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: MacOSWindow.new_with_options_internal dll/src/desktop/shell2/macos/mod.rs:4965 — MethodTooLong — new_with_options_internal runs 629 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 529 over it, 6.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: X11Window.new_with_resources dll/src/desktop/shell2/linux/x11/mod.rs:3227 — MethodTooLong — new_with_resources runs 610 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 510 over it, 6.10× 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: WaylandWindow.generate_frame_if_needed dll/src/desktop/shell2/linux/wayland/mod.rs:7011 — MethodTooLong — generate_frame_if_needed runs 598 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 498 over it, 5.98× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Profiler.new webrender/core/src/profiler.rs:401 — MethodTooLong — new runs 595 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 495 over it, 5.95× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: WaylandWindow.new dll/src/desktop/shell2/linux/wayland/mod.rs:1972 — MethodTooLong — new runs 585 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 485 over it, 5.85× 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: CpuBackend.render_frame dll/src/desktop/shell2/headless/mod.rs:549 — MethodTooLong — render_frame runs 497 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 397 over it, 4.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: TaffyBridge.translate_style_to_taffy layout/src/solver3/taffy_bridge.rs:734 — MethodTooLong — translate_style_to_taffy 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: HeadlessWindow.run dll/src/desktop/shell2/headless/mod.rs:2258 — MethodTooLong — run runs 468 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 368 over it, 4.68× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Win32Window.new dll/src/desktop/shell2/windows/mod.rs:300 — MethodTooLong — new runs 452 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 352 over it, 4.52× 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: SceneBuilder.wrap_prim_with_filters webrender/core/src/scene_building.rs:3599 — MethodTooLong — wrap_prim_with_filters runs 451 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 351 over it, 4.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Filter.from webrender/core/src/internal_types.rs:995 — MethodTooLong — from runs 440 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 340 over it, 4.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Shaders.new webrender/core/src/renderer/shade.rs:630 — MethodTooLong — new runs 437 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 337 over it, 4.37× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Win32Window.render_and_present dll/src/desktop/shell2/windows/mod.rs:1139 — MethodTooLong — render_and_present runs 406 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 306 over it, 4.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: TileCacheInstance.update_prim_dependencies webrender/core/src/picture.rs:3038 — MethodTooLong — update_prim_dependencies runs 405 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 305 over it, 4.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: MacOSWindow.render_and_present_in_draw_rect dll/src/desktop/shell2/macos/mod.rs:7700 — MethodTooLong — render_and_present_in_draw_rect runs 390 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 290 over it, 3.90× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: X11Window.render_and_present dll/src/desktop/shell2/linux/x11/mod.rs:6380 — MethodTooLong — render_and_present runs 382 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 282 over it, 3.82× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: CssPropertyCache.build_compact_cache_with_inheritance_debug core/src/compact.rs:503 — MethodTooLong — build_compact_cache_with_inheritance_debug runs 371 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 271 over it, 3.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: X11Window.handle_event dll/src/desktop/shell2/linux/x11/mod.rs:4836 — MethodTooLong — handle_event runs 364 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 264 over it, 3.64× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: FilterGraphOpKey.from webrender/core/src/prim_store/picture.rs:619 — MethodTooLong — from runs 344 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 244 over it, 3.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.
  • MethodTooLong: SceneBuilder.build_item webrender/core/src/scene_building.rs:1332 — MethodTooLong — build_item runs 320 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 220 over it, 3.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Device.new webrender/core/src/device/gl.rs:1440 — MethodTooLong — new runs 301 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 201 over it, 3.01× 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: CssPropertyCache.build_compact_cache core/src/compact.rs:57 — MethodTooLong — build_compact_cache runs 268 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 168 over it, 2.68× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: TileCacheInstance.pre_update webrender/core/src/picture.rs:2047 — MethodTooLong — pre_update runs 263 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 163 over it, 2.63× 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.
  • + 111 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×118
  • Duplicated block (8 lines × 2) core/src/events.rs:1823 — core/src/events.rs:1823-1830 | core/src/events.rs:2114-2121 — both copies are in the same file, so extract the block into 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) core/src/gl.rs:3504 — core/src/gl.rs:3504-3511 | core/src/gl.rs:3711-3718 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/gl.rs:3504` it does not close everything it opens, so those exact lines 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) css/src/props/style/transform.rs:957 — css/src/props/style/transform.rs:957-964 | css/src/props/style/transform.rs:994-1001 — both copies are in the same file, so extract the 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 (8 lines × 2) dll/src/desktop/compositor2.rs:1728 — dll/src/desktop/compositor2.rs:1728-1735 | dll/src/desktop/compositor2.rs:1917-1924 — both copies are in the same file, so extract the 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 (8 lines × 2) dll/src/desktop/extra/capability.rs:224 — dll/src/desktop/extra/capability.rs:224-231 | dll/src/desktop/extra/capability.rs:244-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 `dll/src/desktop/extra/capability.rs:224` it does not close everything it opens, so those exact lines 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) dll/src/desktop/extra/map/mvt.rs:449 — dll/src/desktop/extra/map/mvt.rs:449-456 | dll/src/desktop/extra/map/mvt.rs:490-497 — both copies are in the same file, so extract the block into 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) dll/src/desktop/extra/pdf/mod.rs:188 — dll/src/desktop/extra/pdf/mod.rs:188-195 | dll/src/desktop/extra/pdf/mod.rs:238-245 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/extra/pdf/mod.rs:188` it does not close everything it opens, so those exact lines 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) dll/src/desktop/extra/permission/ios.rs:40 — dll/src/desktop/extra/permission/ios.rs:40-50 | dll/src/desktop/extra/permission/macos.rs:97-104 — before extracting anything, compare `dll/src/desktop/extra/permission/ios.rs` and `dll/src/desktop/extra/permission/macos.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `dll/src/desktop/extra/permission/ios.rs:40` it does not close everything it opens, so those exact lines 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) dll/src/desktop/shell2/android/mod.rs:1188 — dll/src/desktop/shell2/android/mod.rs:1188-1195 | dll/src/desktop/shell2/android/mod.rs:1222-1229 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/android/mod.rs:1188` it begins part-way through the construct above it, so those 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, `dll/src/desktop/shell2/android/mod.rs:1197` calls `resize_reason` and `dll/src/desktop/shell2/android/mod.rs:1230` 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) dll/src/desktop/shell2/android/mod.rs:2717 — dll/src/desktop/shell2/android/mod.rs:2717-2724 | dll/src/desktop/shell2/android/mod.rs:3015-3022 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/android/mod.rs:2717` it begins part-way through the construct above it, so those exact lines 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) dll/src/desktop/shell2/common/event.rs:522 — dll/src/desktop/shell2/common/event.rs:522-529 | layout/src/window.rs:20057-20064 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) dll/src/desktop/shell2/common/event.rs:6321 — dll/src/desktop/shell2/common/event.rs:6321-6328 | dll/src/desktop/shell2/common/event.rs:6334-6341 — both copies are in the same file, so extract the 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 (8 lines × 2) dll/src/desktop/shell2/common/event.rs:6742 — dll/src/desktop/shell2/common/event.rs:6742-6749 | dll/src/desktop/shell2/common/event.rs:6929-6936 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/common/event.rs:6742` 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) dll/src/desktop/shell2/ios/text_input.rs:730 — dll/src/desktop/shell2/ios/text_input.rs:730-737 | dll/src/desktop/shell2/ios/text_input.rs:762-769 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:1673 — dll/src/desktop/shell2/linux/wayland/mod.rs:1673-1680 | dll/src/desktop/shell2/linux/wayland/mod.rs:10146-10153 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:1673` it begins part-way through the construct above it, so those exact lines 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) dll/src/desktop/shell2/linux/wayland/mod.rs:7378 — dll/src/desktop/shell2/linux/wayland/mod.rs:7378-7385 | dll/src/desktop/shell2/linux/x11/mod.rs:7037-7044 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:7378` it begins part-way through the construct above it, so those exact lines 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) dll/src/desktop/shell2/linux/wayland/mod.rs:7969 — dll/src/desktop/shell2/linux/wayland/mod.rs:7969-7976 | dll/src/desktop/shell2/linux/wayland/mod.rs:7986-7993 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:7969` it begins part-way through the construct above it, so those exact lines 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) dll/src/desktop/shell2/linux/wayland/mod.rs:10576 — dll/src/desktop/shell2/linux/wayland/mod.rs:10576-10583 | dll/src/desktop/shell2/linux/wayland/mod.rs:10608-10615 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:10576` it does not close everything it opens, so those exact lines 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) dll/src/desktop/shell2/linux/x11/mod.rs:4258 — dll/src/desktop/shell2/linux/x11/mod.rs:4258-4265 | dll/src/desktop/shell2/windows/mod.rs:7677-7684 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 450 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 `dll/src/desktop/shell2/linux/x11/mod.rs:4258` 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) dll/src/desktop/shell2/linux/x11/mod.rs:4271 — dll/src/desktop/shell2/linux/x11/mod.rs:4271-4278 | dll/src/desktop/shell2/windows/mod.rs:7689-7696 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 450 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 `dll/src/desktop/shell2/linux/x11/mod.rs:4271` 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) dll/src/desktop/shell2/linux/x11/mod.rs:8360 — dll/src/desktop/shell2/linux/x11/mod.rs:8360-8367 | dll/src/desktop/shell2/linux/x11/mod.rs:8389-8396 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/x11/mod.rs:8360` it does not close everything it opens, so those exact lines 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) dll/src/desktop/shell2/macos/mod.rs:560 — dll/src/desktop/shell2/macos/mod.rs:560-567 | dll/src/desktop/shell2/macos/mod.rs:597-604 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/macos/mod.rs:560` it does not close everything it opens, so those exact lines 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) dll/src/desktop/shell2/macos/mod.rs:2597 — dll/src/desktop/shell2/macos/mod.rs:2597-2604 | dll/src/desktop/shell2/macos/mod.rs:2620-2627 — both copies are in the same file, so extract the block into 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) dll/src/web/server.rs:872 — dll/src/web/server.rs:872-879 | dll/src/web/server.rs:888-895 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/web/server.rs:872` it begins part-way through the construct above it, so those exact lines 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) dll/src/web/symbol_table.rs:2694 — dll/src/web/symbol_table.rs:2694-2701 | dll/src/web/symbol_table.rs:2786-2802 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 93 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×111
  • Duplicated block (9 lines × 2) core/src/diff.rs:741 — core/src/diff.rs:741-750 | core/src/diff.rs:801-809 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/diff.rs:741` 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) core/src/dom.rs:2495 — core/src/dom.rs:2495-2503 | core/src/dom.rs:3820-3828 — both copies are in the same file, so extract the 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) core/src/events.rs:1806 — core/src/events.rs:1806-1814 | core/src/events.rs:2098-2106 — both copies are in the same file, so extract the block into 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) core/src/gl.rs:4168 — core/src/gl.rs:4168-4176 | core/src/gl.rs:4185-4193 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/gl.rs:4168` it does not close everything it opens, so those exact lines 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) core/src/resources.rs:2603 — core/src/resources.rs:2603-2611 | core/src/resources.rs:2722-2730 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/resources.rs:2603` it does not close everything it opens, so those exact lines 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) core/src/xml.rs:4291 — core/src/xml.rs:4291-4299 | core/src/xml.rs:4467-4475 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/xml.rs:4291` it begins part-way through the construct above it, so those exact lines 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) core/src/xml.rs:5439 — core/src/xml.rs:5439-5447 | core/src/xml.rs:5470-5478 — both copies are in the same file, so extract the block into 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) css/src/codegen/format.rs:215 — css/src/codegen/format.rs:215-223 | css/src/codegen/format.rs:225-233 — both copies are in the same file, so extract the 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) css/src/props/basic/animation.rs:348 — css/src/props/basic/animation.rs:348-356 | css/src/props/basic/animation.rs:371-379 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `css/src/props/basic/animation.rs:348` it does not close everything it opens, so those exact lines 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) css/src/shape_parser.rs:106 — css/src/shape_parser.rs:106-114 | css/src/shape_parser.rs:134-142 — both copies are in the same file, so extract the block into 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) dll/src/desktop/compositor2.rs:1737 — dll/src/desktop/compositor2.rs:1737-1745 | dll/src/desktop/compositor2.rs:1926-1934 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/compositor2.rs:1737` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (9 lines × 2) dll/src/desktop/extra/geolocation/ios.rs:128 — dll/src/desktop/extra/geolocation/ios.rs:128-136 | dll/src/desktop/extra/geolocation/macos.rs:122-130 — before extracting anything, compare `dll/src/desktop/extra/geolocation/ios.rs` and `dll/src/desktop/extra/geolocation/macos.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `dll/src/desktop/extra/geolocation/ios.rs:128` it begins part-way through the construct above it, so those exact lines 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) dll/src/desktop/extra/geolocation/linux.rs:49 — dll/src/desktop/extra/geolocation/linux.rs:49-57 | dll/src/desktop/extra/geolocation/windows.rs:68-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.
  • Duplicated block (9 lines × 2) dll/src/desktop/extra/pdf/mod.rs:635 — dll/src/desktop/extra/pdf/mod.rs:635-643 | layout/src/window.rs:1804-1812 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) dll/src/desktop/shell2/android/mod.rs:586 — dll/src/desktop/shell2/android/mod.rs:586-594 | dll/src/desktop/shell2/ios/mod.rs:2034-2042 — `dll/src/desktop/shell2/android/mod.rs` and `dll/src/desktop/shell2/ios/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 17 separate duplicated blocks between them, totalling at least 242 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/android/mod.rs:586` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) dll/src/desktop/shell2/common/event.rs:8050 — dll/src/desktop/shell2/common/event.rs:8050-8058 | dll/src/desktop/shell2/common/event.rs:8119-8127 — both copies are in the same file, so extract the block into 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) dll/src/desktop/shell2/ios/mod.rs:941 — dll/src/desktop/shell2/ios/mod.rs:941-949 | dll/src/desktop/shell2/ios/mod.rs:967-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. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/ios/mod.rs:941` it does not close everything it opens, so those exact lines 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) dll/src/desktop/shell2/linux/wayland/mod.rs:2066 — dll/src/desktop/shell2/linux/wayland/mod.rs:2066-2074 | dll/src/desktop/shell2/linux/x11/mod.rs:3909-3917 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:2066` it begins part-way through the construct above it, so those exact lines 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) dll/src/desktop/shell2/linux/wayland/mod.rs:5161 — dll/src/desktop/shell2/linux/wayland/mod.rs:5161-5169 | dll/src/desktop/shell2/linux/wayland/mod.rs:5237-5246 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:5161` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `super) fn handle_seat_pointer_axis_stop(&mut` in one and `&mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 2) dll/src/desktop/shell2/linux/x11/events.rs:765 — dll/src/desktop/shell2/linux/x11/events.rs:765-773 | dll/src/desktop/shell2/macos/events.rs:394-402 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/events.rs` and `dll/src/desktop/shell2/macos/events.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 104 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 `dll/src/desktop/shell2/linux/x11/events.rs:765` it does not close everything it opens, so those exact lines 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) dll/src/desktop/shell2/linux/x11/mod.rs:946 — dll/src/desktop/shell2/linux/x11/mod.rs:946-954 | dll/src/desktop/shell2/linux/x11/mod.rs:999-1007 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/x11/mod.rs:946` it begins part-way through the construct above it, so those exact lines 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) dll/src/web/mod.rs:537 — dll/src/web/mod.rs:537-545 | dll/src/web/symbol_table.rs:1241-1249 — 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 `dll/src/web/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.
  • Duplicated block (9 lines × 2) doc/src/autofix/diff.rs:946 — doc/src/autofix/diff.rs:946-954 | doc/src/autofix/diff.rs:958-966 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) doc/src/autofix/type_index.rs:1695 — doc/src/autofix/type_index.rs:1695-1703 | doc/src/patch/index.rs:1289-1297 — before extracting anything, compare `doc/src/autofix/type_index.rs` and `doc/src/patch/index.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `doc/src/autofix/type_index.rs:1695` it does not close everything it opens, so those exact lines 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) doc/src/autofix/type_index.rs:1999 — doc/src/autofix/type_index.rs:1999-2007 | doc/src/patch/index.rs:337-346 — before extracting anything, compare `doc/src/autofix/type_index.rs` and `doc/src/patch/index.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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.
  • + 86 more in this group — see findings.md.
D1 · Cyclomatic Complexity · azul_layout · ×102
  • azul_layout::solver3::fc::layout_bfc (cyclomatic 123) layout/src/solver3/fc.rs:1214 — azul_layout::solver3::fc::layout_bfc has cyclomatic complexity 123 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_layout::solver3::fc::translate_to_text3_constraints (cyclomatic 119) layout/src/solver3/fc.rs:4623 — azul_layout::solver3::fc::translate_to_text3_constraints has cyclomatic complexity 119 (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.
  • azul_layout::event_determination::determine_all_events (cyclomatic 114) layout/src/event_determination.rs:599 — azul_layout::event_determination::determine_all_events has cyclomatic complexity 114 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_layout::scroll_timer::scroll_physics_timer_callback (cyclomatic 109) layout/src/scroll_timer.rs:334 — azul_layout::scroll_timer::scroll_physics_timer_callback has cyclomatic complexity 109 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_layout::solver3::layout_document (cyclomatic 96) layout/src/solver3/mod.rs:544 — azul_layout::solver3::layout_document has cyclomatic complexity 96 (threshold 15). Of this number, 93 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_layout::xml::parse_xml_to_fast_dom_with_css (cyclomatic 91) layout/src/xml/mod.rs:334 — azul_layout::xml::parse_xml_to_fast_dom_with_css has cyclomatic complexity 91 (threshold 15). Of this number, 89 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.
  • azul_layout::solver3::positioning::position_out_of_flow_elements (cyclomatic 88) layout/src/solver3/positioning.rs:160 — azul_layout::solver3::positioning::position_out_of_flow_elements has cyclomatic complexity 88 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_layout::cpurender::raster::render_single_item (cyclomatic 85) layout/src/cpurender/raster.rs:1830 — azul_layout::cpurender::raster::render_single_item has cyclomatic complexity 85 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_layout::text3::cache::position_one_line (cyclomatic 72) layout/src/text3/cache.rs:11839 — azul_layout::text3::cache::position_one_line has cyclomatic complexity 72 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_layout::solver3::sizing::calculate_used_size_for_node (cyclomatic 66) layout/src/solver3/sizing.rs:1730 — azul_layout::solver3::sizing::calculate_used_size_for_node has cyclomatic complexity 66 (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.
  • azul_layout::text3::cache::perform_fragment_layout (cyclomatic 64) layout/src/text3/cache.rs:10761 — azul_layout::text3::cache::perform_fragment_layout has cyclomatic complexity 64 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_layout::icu::plural_for (cyclomatic 61) layout/src/icu.rs:242 — azul_layout::icu::plural_for has cyclomatic complexity 61 (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.
  • azul_layout::solver3::cache::reconcile_recursive (cyclomatic 60) layout/src/solver3/cache.rs:1540 — azul_layout::solver3::cache::reconcile_recursive 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.
  • azul_layout::solver3::fc::layout_ifc (cyclomatic 54) layout/src/solver3/fc.rs:3570 — azul_layout::solver3::fc::layout_ifc has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_layout::solver3::fc::collect_and_measure_inline_content_impl (cyclomatic 52) layout/src/solver3/fc.rs:8628 — azul_layout::solver3::fc::collect_and_measure_inline_content_impl has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_layout::solver3::display_list::paginate_pages_impl (cyclomatic 51) layout/src/solver3/display_list.rs:9722 — azul_layout::solver3::display_list::paginate_pages_impl has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_layout::text3::cache::shape_visual_items (cyclomatic 48) layout/src/text3/cache.rs:9473 — azul_layout::text3::cache::shape_visual_items has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_layout::default_actions::determine_keyboard_default_action_with_editing (cyclomatic 47) layout/src/default_actions.rs:95 — azul_layout::default_actions::determine_keyboard_default_action_with_editing has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_layout::solver3::cache::calculate_layout_for_subtree_fragment (cyclomatic 45) layout/src/solver3/cache.rs:3020 — azul_layout::solver3::cache::calculate_layout_for_subtree_fragment 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.
  • azul_layout::solver3::fc::position_table_cells (cyclomatic 44) layout/src/solver3/fc.rs:7936 — azul_layout::solver3::fc::position_table_cells 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.
  • azul_layout::cpurender::compositor::compute_display_list_damage_impl (cyclomatic 41) layout/src/cpurender/compositor.rs:2982 — azul_layout::cpurender::compositor::compute_display_list_damage_impl has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_layout::solver3::getters::get_style_properties_for_state (cyclomatic 41) layout/src/solver3/getters.rs:3042 — azul_layout::solver3::getters::get_style_properties_for_state has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_layout::solver3::display_list::compute_patch_move_summary (cyclomatic 40) layout/src/solver3/display_list.rs:3577 — azul_layout::solver3::display_list::compute_patch_move_summary has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: azul_layout::solver3::display_list::offset_display_item_y (cyclomatic 41) 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.
  • azul_layout::xml::svg::render_node_clipmask_cpu::agg_translate_node (cyclomatic 39) layout/src/xml/svg.rs:1794 — azul_layout::xml::svg::render_node_clipmask_cpu::agg_translate_node has cyclomatic complexity 39 (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.
  • azul_layout::widgets::node_graph::nodegraph_drag_graph_or_nodes (cyclomatic 37) layout/src/widgets/node_graph.rs:3109 — azul_layout::widgets::node_graph::nodegraph_drag_graph_or_nodes has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • + 77 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×101
  • Duplicated block (7 lines × 2) css/src/props/basic/time.rs:242 — css/src/props/basic/time.rs:242-248 | css/src/props/basic/time.rs:252-258 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `css/src/props/basic/time.rs:242` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) dll/src/desktop/compositor2.rs:137 — dll/src/desktop/compositor2.rs:137-143 | dll/src/desktop/compositor2.rs:924-930 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/compositor2.rs:137` it does not close everything it opens, so those exact lines 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) dll/src/desktop/extra/sqlite/mod.rs:1491 — dll/src/desktop/extra/sqlite/mod.rs:1491-1497 | layout/src/journal.rs:143-149 — 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 `dll/src/desktop/extra/sqlite/mod.rs:1491` it does not close everything it opens, so those exact lines 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) dll/src/desktop/shell2/ios/text_input.rs:528 — dll/src/desktop/shell2/ios/text_input.rs:528-534 | dll/src/desktop/shell2/ios/text_input.rs:616-622 — both copies are in the same file, so extract the block into 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) dll/src/desktop/shell2/linux/system_style.rs:851 — dll/src/desktop/shell2/linux/system_style.rs:851-857 | dll/src/desktop/shell2/macos/system_style.rs:566-572 — `dll/src/desktop/shell2/linux/system_style.rs` and `dll/src/desktop/shell2/macos/system_style.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 50 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/system_style.rs:851` it does not close everything it opens, so those exact lines 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) dll/src/desktop/shell2/linux/wayland/mod.rs:1669 — dll/src/desktop/shell2/linux/wayland/mod.rs:1669-1675 | dll/src/desktop/shell2/linux/wayland/mod.rs:3752-3758 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:1669` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:6042 — dll/src/desktop/shell2/linux/wayland/mod.rs:6042-6048 | dll/src/desktop/shell2/linux/wayland/mod.rs:6112-6118 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:6042` 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) dll/src/desktop/shell2/linux/x11/mod.rs:4511 — dll/src/desktop/shell2/linux/x11/mod.rs:4511-4517 | dll/src/desktop/shell2/linux/x11/mod.rs:4657-4663 — both copies are in the same file, so extract the block into 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) dll/src/desktop/shell2/windows/mod.rs:1536 — dll/src/desktop/shell2/windows/mod.rs:1536-1542 | dll/src/desktop/shell2/windows/mod.rs:1769-1775 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) dll/src/desktop/shell2/windows/radial_controller.rs:105 — dll/src/desktop/shell2/windows/radial_controller.rs:105-111 | dll/src/desktop/shell2/windows/radial_controller.rs:126-132 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `dll/src/desktop/shell2/windows/radial_controller.rs:101` calls `RotationDeltaInDegrees`, `unwrap_or` and `dll/src/desktop/shell2/windows/radial_controller.rs:125` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) dll/src/web/symbol_table.rs:1667 — dll/src/web/symbol_table.rs:1667-1673 | dll/src/web/symbol_table.rs:1976-1982 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/web/symbol_table.rs:1667` it does not close everything it opens, so those exact lines 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) dll/src/web/transpiler_remill.rs:8469 — dll/src/web/transpiler_remill.rs:8469-8475 | dll/src/web/transpiler_remill.rs:8480-8486 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/web/transpiler_remill.rs:8469` it begins part-way through the construct above it, so those exact lines 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) dll/src/web/transpiler_remill.rs:11795 — dll/src/web/transpiler_remill.rs:11795-11801 | dll/src/web/transpiler_remill.rs:11836-11842 — both copies are in the same file, so extract the 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, `dll/src/web/transpiler_remill.rs:11802` calls `remove_file` and `dll/src/web/transpiler_remill.rs:11843` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) doc/src/api.rs:2647 — doc/src/api.rs:2647-2653 | doc/src/api.rs:2744-2750 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/api.rs:2647` it does not close everything it opens, so those exact lines 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) doc/src/codegen/v2/lang_cobol/types.rs:120 — doc/src/codegen/v2/lang_cobol/types.rs:120-126 | doc/src/codegen/v2/lang_cobol/types.rs:267-273 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) doc/src/codegen/v2/lang_cpp/common.rs:1983 — doc/src/codegen/v2/lang_cpp/common.rs:1983-1989 | doc/src/codegen/v2/lang_cpp/common.rs:2029-2036 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_cpp/common.rs:1983` it begins part-way through the construct above it, so those exact lines 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) doc/src/codegen/v2/lang_crystal/model.rs:57 — doc/src/codegen/v2/lang_crystal/model.rs:57-63 | doc/src/codegen/v2/lang_d/model.rs:66-72 — `doc/src/codegen/v2/lang_crystal/model.rs` and `doc/src/codegen/v2/lang_d/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 88 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (7 lines × 2) doc/src/codegen/v2/lang_crystal/wrappers.rs:1163 — doc/src/codegen/v2/lang_crystal/wrappers.rs:1163-1169 | doc/src/codegen/v2/lang_swift/wrappers.rs:1890-1897 — `doc/src/codegen/v2/lang_crystal/wrappers.rs` and `doc/src/codegen/v2/lang_swift/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 74 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_crystal/wrappers.rs:1163` 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) doc/src/codegen/v2/lang_d/model.rs:278 — doc/src/codegen/v2/lang_d/model.rs:278-284 | doc/src/codegen/v2/lang_swift/model.rs:286-292 — `doc/src/codegen/v2/lang_d/model.rs` and `doc/src/codegen/v2/lang_swift/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 21 separate duplicated blocks between them, totalling at least 240 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_d/model.rs:278` 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) doc/src/codegen/v2/lang_d/model.rs:605 — doc/src/codegen/v2/lang_d/model.rs:605-611 | doc/src/codegen/v2/lang_swift/model.rs:621-627 — `doc/src/codegen/v2/lang_d/model.rs` and `doc/src/codegen/v2/lang_swift/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 21 separate duplicated blocks between them, totalling at least 240 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (7 lines × 2) doc/src/codegen/v2/lang_d/wrappers.rs:2028 — doc/src/codegen/v2/lang_d/wrappers.rs:2028-2034 | doc/src/codegen/v2/lang_swift/wrappers.rs:1972-1978 — `doc/src/codegen/v2/lang_d/wrappers.rs` and `doc/src/codegen/v2/lang_swift/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 27 separate duplicated blocks between them, totalling at least 281 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_d/wrappers.rs:2028` 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) doc/src/codegen/v2/lang_kotlin/managed.rs:61 — doc/src/codegen/v2/lang_kotlin/managed.rs:61-67 | doc/src/codegen/v2/lang_kotlin/managed.rs:343-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 `doc/src/codegen/v2/lang_kotlin/managed.rs:61` it does not close everything it opens, so those exact lines 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) doc/src/codegen/v2/lang_node/wrappers.rs:429 — doc/src/codegen/v2/lang_node/wrappers.rs:429-435 | doc/src/codegen/v2/lang_node/wrappers.rs:1707-1713 — both copies are in the same file, so extract the block into 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) doc/src/codegen/v2/lang_odin/mod.rs:163 — doc/src/codegen/v2/lang_odin/mod.rs:163-169 | doc/src/codegen/v2/lang_v/mod.rs:187-193 — `doc/src/codegen/v2/lang_odin/mod.rs` and `doc/src/codegen/v2/lang_v/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 108 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (7 lines × 2) doc/src/codegen/v2/lang_odin/types.rs:119 — doc/src/codegen/v2/lang_odin/types.rs:119-125 | doc/src/codegen/v2/lang_v/types.rs:124-130 — `doc/src/codegen/v2/lang_odin/types.rs` and `doc/src/codegen/v2/lang_v/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 16 separate duplicated blocks between them, totalling at least 175 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_odin/types.rs:119` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 76 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×98
  • TooManyMethods: CssProperty css/src/props/property.rs:662 — TooManyMethods — 426 methods. The bar is 30 methods; this is 396 over it, 14.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: CallbackInfo layout/src/callbacks.rs:1290 — TooManyMethods — 384 methods. The bar is 30 methods; this is 354 over it, 12.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: LayoutWindow layout/src/window.rs:1184 — TooManyMethods — 322 methods. The bar is 30 methods; this is 292 over it, 10.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Dom core/src/dom.rs:4237 — TooManyMethods — 247 methods. The bar is 30 methods; this is 217 over it, 8.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: GlContextPtr core/src/gl.rs:985 — TooManyMethods — 229 methods. The bar is 30 methods; this is 199 over it, 7.63× 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: ColorU css/src/props/basic/color.rs:35 — TooManyMethods — 140 methods. The bar is 30 methods; this is 110 over it, 4.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: Device webrender/core/src/device/gl.rs:1076 — TooManyMethods — 133 methods. The bar is 30 methods; this is 103 over it, 4.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: WaylandWindow dll/src/desktop/shell2/linux/wayland/mod.rs:544 — TooManyMethods — 132 methods. The bar is 30 methods; this is 102 over it, 4.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: NodeData core/src/dom.rs:1689 — TooManyMethods — 113 methods. The bar is 30 methods; this is 83 over it, 3.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: CompactLayoutCache css/src/compact_cache.rs:1645 — TooManyMethods — 108 methods. The bar is 30 methods; this is 78 over it, 3.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: MacOSWindow dll/src/desktop/shell2/macos/mod.rs:4009 — TooManyMethods — 99 methods, declared across 2 files: macos/mod.rs (73), macos/events.rs (26). The bar is 30 methods; this is 69 over it, 3.30× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: GestureAndDragManager layout/src/managers/gesture.rs:720 — 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: Renderer webrender/core/src/renderer/mod.rs:761 — TooManyMethods — 86 methods, declared across 3 files: renderer/mod.rs (77), src/screen_capture.rs (6), renderer/gpu_cache.rs (3). The bar is 30 methods; this is 56 over it, 2.87× 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: X11Window dll/src/desktop/shell2/linux/x11/mod.rs:2593 — TooManyMethods — 84 methods, declared across 2 files: x11/mod.rs (64), x11/events.rs (20). The bar is 30 methods; this is 54 over it, 2.80× 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: CssPropertyCache core/src/prop_cache.rs:1017 — TooManyMethods — 75 methods, declared across 2 files: src/prop_cache.rs (72), src/compact.rs (3). The bar is 30 methods; this is 45 over it, 2.50× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: DisplayListBuilder webrender/api/src/display_list.rs:1036 — TooManyMethods — 64 methods. The bar is 30 methods; this is 34 over it, 2.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Win32Window dll/src/desktop/shell2/windows/mod.rs:147 — TooManyMethods — 62 methods. The bar is 30 methods; this is 32 over it, 2.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ResourceCache webrender/core/src/resource_cache.rs:442 — TooManyMethods — 56 methods. The bar is 30 methods; this is 26 over it, 1.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: FilePath layout/src/file.rs:685 — TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: TimerCallbackInfo layout/src/timer.rs:353 — TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SceneBuilder webrender/core/src/scene_building.rs:434 — TooManyMethods — 50 methods, declared across 3 files: src/scene_building.rs (48), src/border.rs (1), src/box_shadow.rs (1). The bar is 30 methods; this is 20 over it, 1.67× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: RibbonStyle layout/src/widgets/ribbon.rs:1643 — TooManyMethods — 49 methods. The bar is 30 methods; this is 19 over it, 1.63× 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: TextEditManager layout/src/managers/text_edit.rs:436 — TooManyMethods — 46 methods. The bar is 30 methods; this is 16 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: VirtualKeyCodeVec core/src/window.rs:656 — TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ScanCodeVec core/src/window.rs:679 — TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • + 73 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×95
  • Duplicated block (11 lines × 2) core/src/compact.rs:1349 — core/src/compact.rs:1349-1359 | core/src/compact.rs:1369-1379 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/compact.rs:1349` it does not close everything it opens, so those exact lines 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) core/src/resources.rs:2793 — core/src/resources.rs:2793-2803 | core/src/resources.rs:2944-2954 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/resources.rs:2793` it begins part-way through the construct above it, so those exact lines 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) core/src/svg.rs:661 — core/src/svg.rs:661-671 | core/src/svg.rs:674-684 — both copies are in the same file, so extract the 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 (11 lines × 2) core/src/xml.rs:436 — core/src/xml.rs:436-446 | core/src/xml.rs:561-571 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/xml.rs:436` 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) css/src/codegen/format.rs:398 — css/src/codegen/format.rs:398-408 | css/src/codegen/format.rs:968-978 — both copies are in the same file, so extract the block into 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) css/src/system.rs:883 — css/src/system.rs:883-893 | css/src/system.rs:919-929 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `css/src/system.rs:883` it does not close everything it opens, so those exact lines 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) css/src/system.rs:2603 — css/src/system.rs:2603-2613 | css/src/system.rs:2702-2712 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `css/src/system.rs:2603` it begins part-way through the construct above it, so those exact lines 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) dll/src/desktop/compositor2.rs:1716 — dll/src/desktop/compositor2.rs:1716-1726 | dll/src/desktop/compositor2.rs:1905-1915 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/compositor2.rs:1716` 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) dll/src/desktop/extra/natural_scroll.rs:72 — dll/src/desktop/extra/natural_scroll.rs:72-82 | dll/src/desktop/shell2/windows/subpixel.rs:57-67 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (11 lines × 2) dll/src/desktop/shell2/common/event.rs:5661 — dll/src/desktop/shell2/common/event.rs:5661-5672 | dll/src/desktop/shell2/common/event.rs:5681-5691 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/common/event.rs:5661` 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) dll/src/desktop/shell2/headless/mod.rs:2224 — dll/src/desktop/shell2/headless/mod.rs:2224-2234 | dll/src/desktop/shell2/windows/mod.rs:1029-1039 — `dll/src/desktop/shell2/headless/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 48 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/headless/mod.rs:2224` 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) dll/src/desktop/shell2/linux/system_style.rs:861 — dll/src/desktop/shell2/linux/system_style.rs:861-871 | dll/src/desktop/shell2/windows/system_style.rs:399-409 — 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 `dll/src/desktop/shell2/linux/system_style.rs:861` 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) dll/src/desktop/shell2/linux/wayland/dlopen.rs:1124 — dll/src/desktop/shell2/linux/wayland/dlopen.rs:1124-1135 | dll/src/desktop/shell2/linux/wayland/dlopen.rs:1147-1157 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/dlopen.rs:1124` it does not close everything it opens, so those exact lines 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) dll/src/desktop/shell2/linux/wayland/events.rs:4136 — dll/src/desktop/shell2/linux/wayland/events.rs:4136-4146 | dll/src/desktop/shell2/linux/wayland/events.rs:4168-4178 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/events.rs:4136` it does not close everything it opens, so those exact lines 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) dll/src/desktop/shell2/linux/wayland/mod.rs:505 — dll/src/desktop/shell2/linux/wayland/mod.rs:505-515 | dll/src/desktop/shell2/linux/wayland/mod.rs:5598-5608 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:505` it does not close everything it opens, so those exact lines 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) dll/src/desktop/shell2/linux/wayland/mod.rs:3137 — dll/src/desktop/shell2/linux/wayland/mod.rs:3137-3147 | dll/src/desktop/shell2/linux/x11/mod.rs:4643-4653 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:3137` it does not close everything it opens, so those exact lines 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) dll/src/desktop/shell2/linux/wayland/mod.rs:3221 — dll/src/desktop/shell2/linux/wayland/mod.rs:3221-3231 | dll/src/desktop/shell2/linux/x11/mod.rs:4668-4678 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:3221` it begins part-way through the construct above it, so those exact lines 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) dll/src/desktop/shell2/linux/wayland/mod.rs:5241 — dll/src/desktop/shell2/linux/wayland/mod.rs:5241-5255 | dll/src/desktop/shell2/linux/x11/mod.rs:4819-4829 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:5241` it begins part-way through the construct above it, so those exact lines 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) dll/src/desktop/shell2/linux/wayland/mod.rs:6333 — dll/src/desktop/shell2/linux/wayland/mod.rs:6333-6343 | dll/src/desktop/shell2/linux/x11/events.rs:1464-1474 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/events.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 263 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 `dll/src/desktop/shell2/linux/wayland/mod.rs:6333` it begins part-way through the construct above it, so those exact lines 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) dll/src/desktop/shell2/linux/x11/accessibility.rs:47 — dll/src/desktop/shell2/linux/x11/accessibility.rs:47-57 | dll/src/desktop/shell2/windows/accessibility.rs:57-67 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/accessibility.rs` and `dll/src/desktop/shell2/windows/accessibility.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) dll/src/desktop/shell2/linux/x11/mod.rs:5642 — dll/src/desktop/shell2/linux/x11/mod.rs:5642-5652 | dll/src/desktop/shell2/linux/x11/mod.rs:7932-7942 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/x11/mod.rs:5642` it begins part-way through the construct above it, so those exact lines 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) dll/src/desktop/shell2/macos/mod.rs:5817 — dll/src/desktop/shell2/macos/mod.rs:5817-5828 | dll/src/desktop/shell2/windows/mod.rs:1028-1038 — `dll/src/desktop/shell2/macos/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 13 separate duplicated blocks between them, totalling at least 196 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/macos/mod.rs:5817` it begins part-way through the construct above it, so those 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, `dll/src/desktop/shell2/macos/mod.rs:5829` calls `seed_window_state_baseline` and `dll/src/desktop/shell2/windows/mod.rs:1039` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) dll/src/desktop/shell2/run.rs:843 — dll/src/desktop/shell2/run.rs:843-853 | dll/src/desktop/shell2/run.rs:2731-2741 — both copies are in the same file, so extract the block into 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) dll/src/desktop/shell2/windows/mod.rs:5142 — dll/src/desktop/shell2/windows/mod.rs:5142-5152 | dll/src/desktop/shell2/windows/mod.rs:5192-5202 — both copies are in the same file, so extract the 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, `dll/src/desktop/shell2/windows/mod.rs:5205` calls `try_show_context_menu` and `dll/src/desktop/shell2/windows/mod.rs:5155` 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) doc/src/api.rs:2084 — doc/src/api.rs:2084-2094 | doc/src/api.rs:2098-2108 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/api.rs:2084` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 70 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×95
  • Duplicated block (6 lines × 2) core/src/prop_cache.rs:683 — core/src/prop_cache.rs:683-688 | core/src/prop_cache.rs:741-746 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/prop_cache.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 (6 lines × 2) css/src/system.rs:2584 — css/src/system.rs:2584-2589 | css/src/system.rs:2684-2689 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `css/src/system.rs:2584` it does not close everything it opens, so those 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, `css/src/system.rs:2591` calls `Some`, `new_rgb` and `css/src/system.rs:2691` 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) css/src/system.rs:2744 — css/src/system.rs:2744-2749 | css/src/system.rs:2820-2825 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `css/src/system.rs:2744` it does not close everything it opens, so those exact lines 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) dll/src/desktop/extra/iroh/mod.rs:63 — dll/src/desktop/extra/iroh/mod.rs:63-68 | dll/src/desktop/extra/iroh/mod.rs:293-298 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/extra/iroh/mod.rs:293` 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) dll/src/desktop/extra/video_codec/mod.rs:714 — dll/src/desktop/extra/video_codec/mod.rs:714-719 | dll/src/desktop/extra/video_codec/mod.rs:738-743 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/extra/video_codec/mod.rs:714` it begins part-way through the construct above it, so those 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, `dll/src/desktop/extra/video_codec/mod.rs:713` calls `Some`, `as_mut` and `dll/src/desktop/extra/video_codec/mod.rs:737` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) dll/src/desktop/shell2/headless/mod.rs:2413 — dll/src/desktop/shell2/headless/mod.rs:2413-2420 | dll/src/desktop/shell2/headless/mod.rs:2433-2438 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/headless/mod.rs:2413` it does not close everything it opens, so those 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, `dll/src/desktop/shell2/headless/mod.rs:2421` calls `set_dropped_file`, `set_hovered_file` and `dll/src/desktop/shell2/headless/mod.rs:2439` 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) dll/src/desktop/shell2/ios/text_input.rs:204 — dll/src/desktop/shell2/ios/text_input.rs:204-209 | dll/src/desktop/shell2/ios/text_input.rs:225-230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `dll/src/desktop/shell2/ios/text_input.rs:232` calls `try_from`, `unwrap_or` and `dll/src/desktop/shell2/ios/text_input.rs:211` 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) dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:386 — dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:386-391 | dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:463-468 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:386` 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) dll/src/desktop/shell2/linux/system_icons.rs:195 — dll/src/desktop/shell2/linux/system_icons.rs:195-200 | dll/src/desktop/shell2/linux/system_icons.rs:220-225 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/system_icons.rs:195` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `dll/src/desktop/shell2/linux/system_icons.rs:193` calls `to_string` and `dll/src/desktop/shell2/linux/system_icons.rs:218` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:1609 — dll/src/desktop/shell2/linux/wayland/mod.rs:1609-1614 | dll/src/desktop/shell2/linux/x11/mod.rs:7870-7875 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (6 lines × 2) dll/src/desktop/tray/linux.rs:511 — dll/src/desktop/tray/linux.rs:511-516 | dll/src/desktop/tray/linux.rs:940-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. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/tray/linux.rs:511` it does not close everything it opens, so those exact lines 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) doc/src/codegen/v2/ir_builder.rs:1042 — doc/src/codegen/v2/ir_builder.rs:1042-1047 | doc/src/codegen/v2/ir_builder.rs:1152-1157 — both copies are in the same file, so extract the block into 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) doc/src/codegen/v2/lang_ada/types.rs:299 — doc/src/codegen/v2/lang_ada/types.rs:299-304 | doc/src/codegen/v2/lang_ada/types.rs:445-450 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_ada/types.rs:299` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) doc/src/codegen/v2/lang_c.rs:1032 — doc/src/codegen/v2/lang_c.rs:1032-1037 | doc/src/codegen/v2/lang_zig/c_decls.rs:468-473 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) doc/src/codegen/v2/lang_cpp/common.rs:1860 — doc/src/codegen/v2/lang_cpp/common.rs:1860-1868 | doc/src/codegen/v2/lang_cpp/common.rs:1945-1950 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_cpp/common.rs:1860` it does not close everything it opens, so those exact lines 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) doc/src/codegen/v2/lang_csharp/types.rs:162 — doc/src/codegen/v2/lang_csharp/types.rs:162-167 | doc/src/codegen/v2/lang_csharp/types.rs:345-350 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) doc/src/codegen/v2/lang_d/wrappers.rs:1994 — doc/src/codegen/v2/lang_d/wrappers.rs:1994-1999 | doc/src/codegen/v2/lang_d/wrappers.rs:2022-2027 — both copies are in the same file, so extract the 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, `doc/src/codegen/v2/lang_d/wrappers.rs:2028` calls `push`, `Some`, `release` and `doc/src/codegen/v2/lang_d/wrappers.rs:2000` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) doc/src/codegen/v2/lang_fortran/types.rs:84 — doc/src/codegen/v2/lang_fortran/types.rs:84-89 | doc/src/codegen/v2/lang_fortran/types.rs:118-123 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_fortran/types.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.
  • Duplicated block (6 lines × 2) doc/src/codegen/v2/lang_haskell/wrappers.rs:1377 — doc/src/codegen/v2/lang_haskell/wrappers.rs:1377-1382 | doc/src/codegen/v2/lang_node/managed.rs:130-141 — 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 `doc/src/codegen/v2/lang_haskell/wrappers.rs:1377` it does not close everything it opens, so those 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 × 2) doc/src/codegen/v2/lang_java/types.rs:525 — doc/src/codegen/v2/lang_java/types.rs:525-530 | doc/src/codegen/v2/lang_kotlin/mod.rs:422-427 — before extracting anything, compare `doc/src/codegen/v2/lang_java/types.rs` and `doc/src/codegen/v2/lang_kotlin/mod.rs` as WHOLE FILES: this scan already matched 8 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. 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 `doc/src/codegen/v2/lang_java/types.rs:525` it does not close everything it opens, so those exact lines 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) doc/src/codegen/v2/lang_pascal/types.rs:306 — doc/src/codegen/v2/lang_pascal/types.rs:306-311 | doc/src/codegen/v2/lang_pascal/types.rs:316-321 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_pascal/types.rs:306` it begins part-way through the construct above it, so those exact lines 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) doc/src/codegen/v2/lang_python.rs:1540 — doc/src/codegen/v2/lang_python.rs:1540-1545 | doc/src/codegen/v2/lang_python.rs:1589-1594 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) doc/src/codegen/v2/lang_rust.rs:1583 — doc/src/codegen/v2/lang_rust.rs:1583-1588 | doc/src/codegen/v2/lang_rust.rs:1901-1906 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_rust.rs:1583` it begins part-way through the construct above it, so those exact lines 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) doc/src/codegen/v2/lang_swift/wrappers.rs:1032 — doc/src/codegen/v2/lang_swift/wrappers.rs:1032-1037 | doc/src/codegen/v2/lang_swift/wrappers.rs:3153-3158 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_swift/wrappers.rs:1032` it does not close everything it opens, so those exact lines 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) doc/src/patch/index.rs:187 — doc/src/patch/index.rs:187-192 | doc/src/patch/index.rs:282-287 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/patch/index.rs:187` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `doc/src/patch/index.rs:194` calls `rsplit`, `next`, `unwrap_or` and `doc/src/patch/index.rs:288` 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.
  • + 70 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×81
  • Duplicated block (5 lines × 2) core/src/resources.rs:1095 — core/src/resources.rs:1095-1100 | core/src/resources.rs:1151-1155 — both copies are in the same file, so extract the block into 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) dll/src/desktop/display.rs:500 — dll/src/desktop/display.rs:500-504 | dll/src/desktop/display.rs:506-516 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/display.rs:500` it does not close everything it opens, so those 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) dll/src/desktop/extra/biometric/android.rs:38 — dll/src/desktop/extra/biometric/android.rs:38-44 | dll/src/desktop/extra/keyring/android.rs:32-36 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/extra/biometric/android.rs:38` it does not close everything it opens, so those 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) dll/src/desktop/extra/video_codec/demux.rs:137 — dll/src/desktop/extra/video_codec/demux.rs:137-141 | dll/src/desktop/extra/video_codec/videotoolbox.rs:524-530 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) dll/src/desktop/shell2/headless/mod.rs:2396 — dll/src/desktop/shell2/headless/mod.rs:2396-2400 | dll/src/desktop/shell2/headless/mod.rs:2413-2417 — both copies are in the same file, so extract the block into 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) dll/src/desktop/shell2/linux/system_style.rs:3007 — dll/src/desktop/shell2/linux/system_style.rs:3007-3011 | dll/src/desktop/shell2/linux/system_style.rs:3017-3021 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/system_style.rs:3007` 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) dll/src/desktop/shell2/linux/wayland/events.rs:1697 — dll/src/desktop/shell2/linux/wayland/events.rs:1697-1701 | dll/src/desktop/shell2/linux/wayland/events.rs:1715-1719 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/events.rs:1697` it does not close everything it opens, so those exact lines 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) dll/src/desktop/shell2/linux/wayland/mod.rs:2074 — dll/src/desktop/shell2/linux/wayland/mod.rs:2074-2078 | dll/src/desktop/shell2/linux/wayland/mod.rs:9501-9505 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:2074` it begins part-way through the construct above it, so those exact lines 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) doc/src/api.rs:1878 — doc/src/api.rs:1878-1885 | doc/src/api.rs:1984-1988 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/api.rs:1878` it does not close everything it opens, so those 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) doc/src/autofix/debug.rs:763 — doc/src/autofix/debug.rs:763-767 | doc/src/autofix/debug.rs:1068-1072 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/debug.rs:763` it does not close everything it opens, so those exact lines 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) doc/src/autofix/type_index.rs:2019 — doc/src/autofix/type_index.rs:2019-2023 | doc/src/autofix/type_index.rs:2188-2192 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/type_index.rs:2019` it does not close everything it opens, so those exact lines 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) doc/src/autofix/type_index.rs:3063 — doc/src/autofix/type_index.rs:3063-3069 | doc/src/patch/index.rs:448-452 — before extracting anything, compare `doc/src/autofix/type_index.rs` and `doc/src/patch/index.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `doc/src/autofix/type_index.rs:3063` it does not close everything it opens, so those 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, `doc/src/autofix/type_index.rs:3071` calls `is_empty` and `doc/src/patch/index.rs:454` 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) doc/src/codegen/v2/lang_crystal/wrappers.rs:1073 — doc/src/codegen/v2/lang_crystal/wrappers.rs:1073-1077 | doc/src/codegen/v2/lang_crystal/wrappers.rs:1627-1631 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_crystal/wrappers.rs:1073` 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) doc/src/codegen/v2/lang_d/wrappers.rs:1787 — doc/src/codegen/v2/lang_d/wrappers.rs:1787-1791 | doc/src/codegen/v2/lang_swift/wrappers.rs:1763-1767 — `doc/src/codegen/v2/lang_d/wrappers.rs` and `doc/src/codegen/v2/lang_swift/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 27 separate duplicated blocks between them, totalling at least 281 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_d/wrappers.rs:1787` it begins part-way through the construct above it, so those 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) doc/src/codegen/v2/lang_d/wrappers.rs:2537 — doc/src/codegen/v2/lang_d/wrappers.rs:2537-2541 | doc/src/codegen/v2/lang_swift/wrappers.rs:2585-2589 — `doc/src/codegen/v2/lang_d/wrappers.rs` and `doc/src/codegen/v2/lang_swift/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 27 separate duplicated blocks between them, totalling at least 281 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_d/wrappers.rs:2537` 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, `doc/src/codegen/v2/lang_swift/wrappers.rs:2590` calls `l` and `doc/src/codegen/v2/lang_d/wrappers.rs:2542` 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) doc/src/codegen/v2/lang_d/wrappers.rs:2696 — doc/src/codegen/v2/lang_d/wrappers.rs:2696-2700 | doc/src/codegen/v2/lang_d/wrappers.rs:2710-2715 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_d/wrappers.rs:2696` it begins part-way through the construct above it, so those exact lines 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) doc/src/codegen/v2/lang_freebasic/types.rs:328 — doc/src/codegen/v2/lang_freebasic/types.rs:328-332 | doc/src/codegen/v2/lang_vb6/types.rs:320-324 — `doc/src/codegen/v2/lang_freebasic/types.rs` and `doc/src/codegen/v2/lang_vb6/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 114 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (5 lines × 2) doc/src/lint_examples.rs:498 — doc/src/lint_examples.rs:498-502 | doc/src/lint_examples.rs:551-555 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) doc/src/reftest/autodebug.rs:1600 — doc/src/reftest/autodebug.rs:1600-1604 | doc/src/reftest/mod.rs:941-946 — 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 `doc/src/reftest/autodebug.rs:1600` it does not close everything it opens, so those exact lines 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) layout/src/cpurender/compositor.rs:568 — layout/src/cpurender/compositor.rs:568-572 | layout/src/cpurender/raster.rs:2671-2675 — before extracting anything, compare `layout/src/cpurender/compositor.rs` and `layout/src/cpurender/raster.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/cpurender/compositor.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 (5 lines × 2) layout/src/cpurender/compositor.rs:2372 — layout/src/cpurender/compositor.rs:2372-2378 | layout/src/cpurender/raster.rs:4002-4006 — before extracting anything, compare `layout/src/cpurender/compositor.rs` and `layout/src/cpurender/raster.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/cpurender/compositor.rs:2372` it begins part-way through the construct above it, so those exact lines 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) layout/src/cpurender/pixmap.rs:1623 — layout/src/cpurender/pixmap.rs:1623-1627 | layout/src/cpurender/raster.rs:2636-2640 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) layout/src/scroll_timer.rs:594 — layout/src/scroll_timer.rs:594-600 | layout/src/scroll_timer.rs:651-655 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/scroll_timer.rs:594` it begins part-way through the construct above it, so those exact lines 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) layout/src/solver3/fc.rs:7469 — layout/src/solver3/fc.rs:7469-7473 | layout/src/solver3/fc.rs:7479-7483 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/fc.rs:7469` it does not close everything it opens, so those exact lines 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) layout/src/text3/cache.rs:11868 — layout/src/text3/cache.rs:11868-11873 | layout/src/text3/knuth_plass.rs:693-697 — 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 `layout/src/text3/cache.rs:11868` 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.
  • + 56 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Repeated repair · ×80
  • Repeated repair: layout/src/widgets/text_input.rs layout/src/widgets/text_input.rs:1092 — layout/src/widgets/text_input.rs changed 35 times in last 90 days and 20 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 azul_layout::widgets::text_input::default_on_text_input_inner at line 1092), 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(engine): every callback kind hands its context to the callee”; “fix(engine): make widget callbacks reachable from managed hosts; null-tolerant RefAny::is_type”; “fix(text_input): an unset theme renders flat, like every other widget”; “fix(compile): get azul-layout to compile again”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- layout/src/widgets/text_input.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: layout/src/widgets/button.rs layout/src/widgets/button.rs:94 — layout/src/widgets/button.rs changed 23 times in last 90 days and 13 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is ButtonType::class_name at line 94), 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(engine): make widget callbacks reachable from managed hosts; null-tolerant RefAny::is_type”; “fix(button): only the neutral surface takes the theme's dark face”; “fix(button): Button::dom renders through the theme functions”; “fix(button): theme states only when the button wears its own container style”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- layout/src/widgets/button.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: doc/src/codegen/v2/lang_ocaml/wrappers.rs doc/src/codegen/v2/lang_ocaml/wrappers.rs:1013 — doc/src/codegen/v2/lang_ocaml/wrappers.rs changed 22 times in last 90 days and 12 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is SmartCtor::emit_implementation at line 1013), 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(bindings): catch at every callback boundary, log, return the fallback”; “fix(ocaml): aliases had the wrong ABI size, and VecRef lost its length”; “fix(codegen): detect callbacks by structure; shadow C API for every one”; “fix(codegen): recognise the method receiver by its IR name in every backend”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- doc/src/codegen/v2/lang_ocaml/wrappers.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: core/src/task.rs core/src/task.rs:480 — core/src/task.rs changed 17 times in last 90 days and 11 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 Instant::linear_interpolate at line 480), 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(engine): every callback kind hands its context to the callee”; “fix(animation): a declared transition animates on every toggle, on the CPU renderer too”; “fix(format): run rustfmt and apply all patches until convergence”; “fix(api-remodel): 59 extreme-lint findings, and an int/real compare that was not SQLite's”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- core/src/task.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: layout/src/widgets/switch.rs layout/src/widgets/switch.rs:55 — layout/src/widgets/switch.rs changed 17 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is azul_layout::widgets::switch::az_switch_on_toggle_callback_thunk at line 55), 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(engine): make widget callbacks reachable from managed hosts; null-tolerant RefAny::is_type”; “fix(clippy): the extern "C" callbacks keep the #[must_use] the gate wants”; “fix(clippy): aggressively apply clippy fixes”; “fix(refactor): try reverting the theme renaming errors”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- layout/src/widgets/switch.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: layout/src/widgets/screencap.rs layout/src/widgets/screencap.rs:393 — layout/src/widgets/screencap.rs changed 15 times in last 90 days and 9 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 azul_layout::widgets::screencap::merge_screencap_state at line 393), 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(engine): make widget callbacks reachable from managed hosts; null-tolerant RefAny::is_type”; “fix(format): run rustfmt and apply all patches until convergence”; “fix(ci): round 4 - FFI field order + variant-predicate collision, test harness fixes, transform order”; “fix(ci): round 2 - engine clock in the capture loop (wasm gate), clippy on layout”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- layout/src/widgets/screencap.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: layout/src/widgets/progressbar.rs layout/src/widgets/progressbar.rs:327 — layout/src/widgets/progressbar.rs changed 15 times in last 90 days and 9 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 ProgressBar::update_progress at line 327), 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(progressbar): tests call the render entry points where they now live”; “fix(clippy): aggressively apply clippy fixes”; “fix(refactor): try reverting the theme renaming errors”; “fix: rename theme -> ui theme, fix IR analyzer”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- layout/src/widgets/progressbar.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: layout/src/widgets/camera.rs layout/src/widgets/camera.rs:444 — layout/src/widgets/camera.rs changed 14 times in last 90 days and 9 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 azul_layout::widgets::camera::merge_camera_state at line 444), 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(engine): make widget callbacks reachable from managed hosts; null-tolerant RefAny::is_type”; “fix(format): run rustfmt and apply all patches until convergence”; “fix(ci): round 4 - FFI field order + variant-predicate collision, test harness fixes, transform order”; “fix(ci): round 2 - engine clock in the capture loop (wasm gate), clippy on layout”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- layout/src/widgets/camera.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: layout/src/widgets/tooltip.rs layout/src/widgets/tooltip.rs:279 — layout/src/widgets/tooltip.rs changed 14 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2 (its worst body is azul_layout::widgets::tooltip::on_tooltip_enter at line 279), 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(engine): make widget callbacks reachable from managed hosts; null-tolerant RefAny::is_type”; “fix(widgets): repair the CI breakage the no-compile chunks accumulated”; “fix(clippy): the extern "C" callbacks keep the #[must_use] the gate wants”; “fix(compile): get azul-layout to compile again”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- layout/src/widgets/tooltip.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: core/src/ua_css.rs core/src/ua_css.rs:1590 — core/src/ua_css.rs changed 14 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is azul_core::ua_css::evaluate_ua_scrollbar_css at line 1590), 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(css): editing hosts keep what the user types (UA white-space: pre-wrap)”; “fix(core,css,layout): first compile of the theme-chain items - tests, clippy, lint self-consistency”; “fix(core): one themed UA table for both cascades, with the text colour in it”; “fix(theme): the window's theme drives the cascade, the UA colours and a regeneration”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- core/src/ua_css.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: layout/src/widgets/avatar.rs layout/src/widgets/avatar.rs:89 — layout/src/widgets/avatar.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 3 (its worst body is AvatarSize::diameter at line 89), 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: “test(avatar,split_pane): the bugs these tests pinned no longer exist”; “fix(clippy): aggressively apply clippy fixes”; “fix(refactor): try reverting the theme renaming errors”; “fix: rename theme -> ui theme, fix IR analyzer”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- layout/src/widgets/avatar.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: layout/src/thread.rs layout/src/thread.rs:321 — layout/src/thread.rs changed 11 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is azul_layout::thread::az_write_back_callback_thunk at line 321), 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(engine): every callback kind hands its context to the callee”; “fix(engine): make widget callbacks reachable from managed hosts; null-tolerant RefAny::is_type”; “fix(format): run rustfmt and apply all patches until convergence”; “fix(layout): clear the 311 clippy errors, and the wasm clock gate, in azul-layout”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- layout/src/thread.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: layout/src/managers/changeset.rs layout/src/managers/changeset.rs:532 — layout/src/managers/changeset.rs changed 11 times in last 90 days and 6 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 TextChangeset::resulting_cursor_position at line 532), 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(format): run rustfmt and apply all patches until convergence”; “fix(layout): mint markers deterministically, and drop uuid from every target”; “fix(layout): two more feature-gated items used unconditionally”; “fix(layout): clear the 311 clippy errors, and the wasm clock gate, in azul-layout”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- layout/src/managers/changeset.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: doc/src/codegen/v2/ir.rs doc/src/codegen/v2/ir.rs:1009 — doc/src/codegen/v2/ir.rs changed 10 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is TypeCategory::description 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(codegen): derive from the IR what four emitters spelled out by name”; “fix(codegen): detect callbacks by structure; shadow C API for every one”; “fix(codegen): classify the IR by structure, never by name lists”; “fix(codegen): recognise the method receiver by its IR name in every backend”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- doc/src/codegen/v2/ir.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: core/src/log_filter.rs core/src/log_filter.rs:225 — core/src/log_filter.rs changed 9 times in last 90 days and 6 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 azul_core::log_filter::category_from_name at line 225), 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(format): run rustfmt and apply all patches until convergence”; “fix(log): stderr_echo() never read the environment, so a direct emit went nowhere”; “fix(refactor): get core to compile again, fix imports”; “fix(core): restore the qualified `alloc::vec::Vec` in log_filter::parse's signature”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- core/src/log_filter.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: layout/src/managers/gpu_state.rs layout/src/managers/gpu_state.rs:261 — layout/src/managers/gpu_state.rs changed 9 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is GpuStateManager::update_scrollbar_transforms at line 261), 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(format): run rustfmt and apply all patches until convergence”; “fix(render): an idle window asked WebRender for a frame 59 times a second”; “fix(scroll): a wheel gesture never ended — settle_scroll_gesture had no caller (2c-iv)”; “fix(input): 13a part 1 — azul-core and azul-layout compile”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- layout/src/managers/gpu_state.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: layout/src/managers/scroll_into_view.rs layout/src/managers/scroll_into_view.rs:469 — layout/src/managers/scroll_into_view.rs changed 9 times in last 90 days and 6 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 azul_layout::managers::scroll_into_view::calculate_axis_delta at line 469), 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(format): run rustfmt and apply all patches until convergence”; “fix(scroll-into-view): an oversized target that is ALREADY on screen no longer yanks the page”; “fix(scroll): the scrollport is the PADDING box, and one box everywhere”; “fix(clippy): restore the extreme-lint gate to green”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- layout/src/managers/scroll_into_view.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: core/src/db.rs core/src/db.rs:739 — core/src/db.rs changed 9 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 14 (its worst body is azul_core::db::az_db_merge_callback_thunk at line 739), 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(engine): every callback kind hands its context to the callee”; “fix(format): run rustfmt and apply all patches until convergence”; “fix(build): the branch's own compile errors from its last CI run (34146408249)”; “fix(api-remodel): 59 extreme-lint findings, and an int/real compare that was not SQLite's”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- core/src/db.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: core/src/transform.rs core/src/transform.rs:288 — core/src/transform.rs changed 9 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is ComputedTransform3D::from_style_transform_vec at line 288), 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(format): run rustfmt and apply all patches until convergence”; “fix(refactor): get core to compile again, fix imports”; “fix(transform): CSS composition order and transform-origin semantics”; “fix(ci): round 4 - FFI field order + variant-predicate collision, test harness fixes, transform order”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- core/src/transform.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: layout/src/widgets/frame.rs layout/src/widgets/frame.rs:340 — layout/src/widgets/frame.rs changed 9 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 1 (its worst body is Frame::create at line 340), 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(format): run rustfmt and apply all patches until convergence”; “fix(widgets): flex properties do nothing without `display: flex`”; “fix(widgets): a widget's own <p> no longer inherits the UA paragraph margin”; “fix(seam): audit batch — text editing, scrolling, and the native↔headless seam on all shells”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- layout/src/widgets/frame.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: doc/src/codegen/v2/lang_fortran/functions.rs doc/src/codegen/v2/lang_fortran/functions.rs:81 — doc/src/codegen/v2/lang_fortran/functions.rs changed 8 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 11 (its worst body is azul_doc::codegen::v2::lang_fortran::functions::should_emit_function at line 81), 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(fortran): the alias scheme hashed 31 symbols out of reach”; “fix(clippy): aggressively apply clippy fixes”; “fix(format): run rustfmt and apply all patches until convergence”; “fix(codegen): recursive types keep the traits they declare, in 23 bindings at once”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- doc/src/codegen/v2/lang_fortran/functions.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: dll/src/desktop/shell2/common/log_gate.rs dll/src/desktop/shell2/common/log_gate.rs:48 — dll/src/desktop/shell2/common/log_gate.rs changed 8 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 azul_dll::desktop::shell2::common::log_gate::category_of at line 48), 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(log): log_*! printed nothing in the shipped DLL”; “fix(format): run rustfmt and apply all patches until convergence”; “fix(diagnostics): a framework warning killed the app when stderr went away”; “fix(input): four bugs behind the scrolling, redraw, teardown and log noise”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- dll/src/desktop/shell2/common/log_gate.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: doc/src/codegen/v2/lang_csharp/functions.rs doc/src/codegen/v2/lang_csharp/functions.rs:121 — doc/src/codegen/v2/lang_csharp/functions.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 11 (its worst body is azul_doc::codegen::v2::lang_csharp::functions::should_emit_function at line 121), 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(bindings): catch at every callback boundary, log, return the fallback”; “fix(format): run rustfmt and apply all patches until convergence”; “fix(codegen): recursive types keep the traits they declare, in 23 bindings at once”; “fix(codegen): one shared predicate closes the `*VecDestructor` gap in twenty bindings”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- doc/src/codegen/v2/lang_csharp/functions.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: layout/src/widgets/microphone.rs layout/src/widgets/microphone.rs:206 — layout/src/widgets/microphone.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 14 (its worst body is azul_layout::widgets::microphone::mic_worker at line 206), 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(engine): make widget callbacks reachable from managed hosts; null-tolerant RefAny::is_type”; “fix(format): run rustfmt and apply all patches until convergence”; “fix(input): four bugs behind the scrolling, redraw, teardown and log noise”; “fix(diagnostics): audio — announce sink/mic engine failures instead of silent frame discard”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- layout/src/widgets/microphone.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: dll/src/desktop/extra/camera/avfoundation.rs dll/src/desktop/extra/camera/avfoundation.rs:123 — dll/src/desktop/extra/camera/avfoundation.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 9 (its worst body is azul_dll::desktop::extra::camera::avfoundation::preset_for at line 123), 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: “chore(dll): cargo fix --lib — 442 compiler-suggested fixes across 30 files”; “fix(format): run rustfmt and apply all patches until convergence”; “ci: the tier the Clippy gate was hiding — seven fixes for ten red jobs”; “fix(dll): macOS-only compile errors the Linux CI never saw”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 20:14:32 +02:00' --until='2026-10-23 20:14:32 +02:00' --full-history --no-merges -- dll/src/desktop/extra/camera/avfoundation.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.
  • + 55 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×79
  • Duplicated block (10 lines × 2) core/src/diff.rs:689 — core/src/diff.rs:689-698 | core/src/diff.rs:756-765 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/diff.rs:689` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) core/src/path_parser.rs:344 — core/src/path_parser.rs:344-353 | core/src/path_parser.rs:370-379 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/path_parser.rs:344` 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) core/src/resources.rs:2778 — core/src/resources.rs:2778-2787 | core/src/resources.rs:2929-2938 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/resources.rs:2778` it does not close everything it opens, so those exact lines 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) css/src/props/basic/color.rs:1819 — css/src/props/basic/color.rs:1819-1828 | css/src/props/basic/color.rs:1859-1868 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `css/src/props/basic/color.rs:1819` 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) css/src/props/property.rs:4462 — css/src/props/property.rs:4462-4471 | css/src/props/property.rs:4477-4486 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `css/src/props/property.rs:4462` it begins part-way through the construct above it, so those exact lines 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) dll/src/desktop/compositor2.rs:318 — dll/src/desktop/compositor2.rs:318-327 | dll/src/desktop/compositor2.rs:1297-1306 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) dll/src/desktop/extra/audio/alsa.rs:65 — dll/src/desktop/extra/audio/alsa.rs:65-74 | dll/src/desktop/extra/audio/alsa.rs:159-168 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/extra/audio/alsa.rs:65` it does not close everything it opens, so those exact lines 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) dll/src/desktop/extra/permission/ios.rs:69 — dll/src/desktop/extra/permission/ios.rs:69-78 | dll/src/desktop/extra/permission/macos.rs:168-177 — before extracting anything, compare `dll/src/desktop/extra/permission/ios.rs` and `dll/src/desktop/extra/permission/macos.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `dll/src/desktop/extra/permission/ios.rs:69` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) dll/src/desktop/extra/sqlite/mod.rs:535 — dll/src/desktop/extra/sqlite/mod.rs:535-544 | dll/src/desktop/extra/sqlite/mod.rs:572-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 `dll/src/desktop/extra/sqlite/mod.rs:535` it does not close everything it opens, so those exact lines 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) dll/src/desktop/eyedropper/windows.rs:44 — dll/src/desktop/eyedropper/windows.rs:44-53 | dll/src/desktop/shell2/windows/mod.rs:7932-7942 — 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 `dll/src/desktop/eyedropper/windows.rs:44` 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) dll/src/desktop/shell2/common/event.rs:6581 — dll/src/desktop/shell2/common/event.rs:6581-6590 | dll/src/desktop/shell2/common/event.rs:11164-11173 — both copies are in the same file, so extract the block into 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) dll/src/desktop/shell2/ios/mod.rs:814 — dll/src/desktop/shell2/ios/mod.rs:814-823 | dll/src/desktop/shell2/macos/mod.rs:5994-6003 — `dll/src/desktop/shell2/ios/mod.rs` and `dll/src/desktop/shell2/macos/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 54 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/ios/mod.rs:814` it does not close everything it opens, so those exact lines 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) dll/src/desktop/shell2/linux/wayland/mod.rs:1578 — dll/src/desktop/shell2/linux/wayland/mod.rs:1578-1587 | dll/src/desktop/shell2/linux/x11/mod.rs:7839-7848 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:1578` 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) dll/src/desktop/shell2/linux/wayland/mod.rs:4688 — dll/src/desktop/shell2/linux/wayland/mod.rs:4688-4697 | dll/src/desktop/shell2/linux/wayland/mod.rs:4737-4746 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:4688` 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) dll/src/desktop/shell2/linux/wayland/mod.rs:9146 — dll/src/desktop/shell2/linux/wayland/mod.rs:9146-9155 | dll/src/desktop/shell2/linux/x11/mod.rs:8564-8573 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:9146` it does not close everything it opens, so those exact lines 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) dll/src/desktop/shell2/linux/wayland/screencopy.rs:68 — dll/src/desktop/shell2/linux/wayland/screencopy.rs:68-77 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:317-326 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/screencopy.rs:68` it does not close everything it opens, so those exact lines 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) dll/src/desktop/shell2/linux/x11/mod.rs:6539 — dll/src/desktop/shell2/linux/x11/mod.rs:6539-6548 | dll/src/desktop/shell2/windows/mod.rs:1159-1168 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 450 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 `dll/src/desktop/shell2/linux/x11/mod.rs:6539` it does not close everything it opens, so those exact lines 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) dll/src/web/symbol_table.rs:1688 — dll/src/web/symbol_table.rs:1688-1697 | dll/src/web/symbol_table.rs:1999-2008 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/web/symbol_table.rs:1688` it begins part-way through the construct above it, so those exact lines 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) doc/src/api.rs:2089 — doc/src/api.rs:2089-2099 | doc/src/api.rs:2366-2375 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/api.rs:2089` it begins part-way through the construct above it, so those exact lines 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) doc/src/autofix/type_index.rs:2214 — doc/src/autofix/type_index.rs:2214-2223 | doc/src/autofix/type_index.rs:2232-2241 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/type_index.rs:2214` 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) doc/src/autofix/workspace.rs:1547 — doc/src/autofix/workspace.rs:1547-1556 | doc/src/autofix/workspace.rs:1592-1601 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/workspace.rs:1547` 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) doc/src/codegen/v2/lang_c.rs:674 — doc/src/codegen/v2/lang_c.rs:674-683 | doc/src/codegen/v2/lang_c.rs:719-728 — both copies are in the same file, so extract the block into 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) doc/src/codegen/v2/lang_c.rs:1433 — doc/src/codegen/v2/lang_c.rs:1433-1442 | doc/src/codegen/v2/lang_c.rs:1453-1462 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_c.rs:1433` it begins part-way through the construct above it, so those exact lines 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) doc/src/codegen/v2/lang_d/wrappers.rs:1747 — doc/src/codegen/v2/lang_d/wrappers.rs:1747-1756 | doc/src/codegen/v2/lang_swift/wrappers.rs:1723-1732 — `doc/src/codegen/v2/lang_d/wrappers.rs` and `doc/src/codegen/v2/lang_swift/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 27 separate duplicated blocks between them, totalling at least 281 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_d/wrappers.rs:1747` it begins part-way through the construct above it, so those exact lines 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) doc/src/codegen/v2/lang_java/types.rs:187 — doc/src/codegen/v2/lang_java/types.rs:187-196 | doc/src/codegen/v2/lang_java/types.rs:747-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 `doc/src/codegen/v2/lang_java/types.rs:187` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 54 more in this group — see findings.md.
D1 · Cyclomatic Complexity · azul_dll · ×78
  • azul_dll::desktop::shell2::windows::window_proc (cyclomatic 205) dll/src/desktop/shell2/windows/mod.rs:4025 — azul_dll::desktop::shell2::windows::window_proc has cyclomatic complexity 205 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_dll::desktop::compositor2::translate_displaylist_to_wr (cyclomatic 107) dll/src/desktop/compositor2.rs:174 — azul_dll::desktop::compositor2::translate_displaylist_to_wr has cyclomatic complexity 107 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_dll::web::symbol_table::classify_for_name (cyclomatic 94) dll/src/web/symbol_table.rs:2437 — azul_dll::web::symbol_table::classify_for_name has cyclomatic complexity 94 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_dll::desktop::shell2::common::layout::regenerate_layout (cyclomatic 79) dll/src/desktop/shell2/common/layout.rs:236 — azul_dll::desktop::shell2::common::layout::regenerate_layout has cyclomatic complexity 79 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_dll::desktop::shell2::android::drain_input (cyclomatic 68) dll/src/desktop/shell2/android/mod.rs:1262 — azul_dll::desktop::shell2::android::drain_input has cyclomatic complexity 68 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_dll::desktop::shell2::linux::x11::init_xinput2 (cyclomatic 60) dll/src/desktop/shell2/linux/x11/mod.rs:866 — azul_dll::desktop::shell2::linux::x11::init_xinput2 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.
  • azul_dll::desktop::shell2::run::run (cyclomatic 53) dll/src/desktop/shell2/run.rs:1963 — azul_dll::desktop::shell2::run::run has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_dll::desktop::shell2::macos::system_style::discover (cyclomatic 50) dll/src/desktop/shell2/macos/system_style.rs:259 — azul_dll::desktop::shell2::macos::system_style::discover has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_dll::desktop::shell2::linux::system_style::discover_kde_style (cyclomatic 49) dll/src/desktop/shell2/linux/system_style.rs:1642 — azul_dll::desktop::shell2::linux::system_style::discover_kde_style has cyclomatic complexity 49 (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.
  • azul_dll::desktop::extra::video_codec::stream::decode_stream (cyclomatic 44) dll/src/desktop/extra/video_codec/stream.rs:96 — azul_dll::desktop::extra::video_codec::stream::decode_stream 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.
  • azul_dll::desktop::shell2::ios::handle_touch (cyclomatic 44) dll/src/desktop/shell2/ios/mod.rs:331 — azul_dll::desktop::shell2::ios::handle_touch 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.
  • azul_dll::web::server::handle_connection (cyclomatic 44) dll/src/web/server.rs:155 — azul_dll::web::server::handle_connection 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.
  • azul_dll::web::symbol_table::compute_hashbrown_empty_group_ranges (cyclomatic 44) dll/src/web/symbol_table.rs:3247 — azul_dll::web::symbol_table::compute_hashbrown_empty_group_ranges 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.
  • azul_dll::web::transpiler_remill::collect_synth_data_pages (cyclomatic 44) dll/src/web/transpiler_remill.rs:4742 — azul_dll::web::transpiler_remill::collect_synth_data_pages 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.
  • azul_dll::desktop::shell2::linux::x11::handle_xi_device_event (cyclomatic 41) dll/src/desktop/shell2/linux/x11/mod.rs:2048 — azul_dll::desktop::shell2::linux::x11::handle_xi_device_event has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_dll::desktop::tray::linux::menu_message (cyclomatic 40) dll/src/desktop/tray/linux.rs:778 — azul_dll::desktop::tray::linux::menu_message 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.
  • azul_dll::web::transpiler_remill::scan_arm64_adrp_accesses (cyclomatic 40) dll/src/web/transpiler_remill.rs:11061 — azul_dll::web::transpiler_remill::scan_arm64_adrp_accesses 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.
  • azul_dll::web::transpiler_remill::inject_user_binary_data_segments (cyclomatic 39) dll/src/web/transpiler_remill.rs:4024 — azul_dll::web::transpiler_remill::inject_user_binary_data_segments has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_dll::desktop::native_screenshot::take_native_screenshot_xlib_bytes (cyclomatic 37) dll/src/desktop/native_screenshot.rs:770 — azul_dll::desktop::native_screenshot::take_native_screenshot_xlib_bytes has cyclomatic complexity 37 (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.
  • azul_dll::web::run_web (cyclomatic 37) dll/src/web/mod.rs:1007 — azul_dll::web::run_web has cyclomatic complexity 37 (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: azul_dll::web::eventloop_symbol_addr (cyclomatic 38) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • azul_dll::desktop::shell2::linux::system_style::discover_gnome_style (cyclomatic 35) dll/src/desktop/shell2/linux/system_style.rs:1475 — azul_dll::desktop::shell2::linux::system_style::discover_gnome_style has cyclomatic complexity 35 (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.
  • azul_dll::desktop::shell2::run::run (cyclomatic 35) dll/src/desktop/shell2/run.rs:1477 — azul_dll::desktop::shell2::run::run has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_dll::web::transpiler_remill::reloc_canonicalize (cyclomatic 35) dll/src/web/transpiler_remill.rs:7689 — azul_dll::web::transpiler_remill::reloc_canonicalize has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_dll::web::transpiler_remill::parse_reg_store (cyclomatic 34) dll/src/web/transpiler_remill.rs:9133 — azul_dll::web::transpiler_remill::parse_reg_store has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • azul_dll::desktop::shell2::android::android_main (cyclomatic 33) dll/src/desktop/shell2/android/mod.rs:670 — azul_dll::desktop::shell2::android::android_main has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • + 53 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×78
  • Duplicated block (12 lines × 2) core/src/callbacks.rs:551 — core/src/callbacks.rs:551-562 | core/src/callbacks.rs:1334-1345 — both copies are in the same file, so extract the 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) core/src/compact.rs:688 — core/src/compact.rs:688-699 | core/src/compact.rs:1544-1555 — both copies are in the same file, so extract the block into 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) core/src/gl.rs:3118 — core/src/gl.rs:3118-3129 | layout/src/xml/svg.rs:1622-1633 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (12 lines × 2) core/src/path_parser.rs:294 — core/src/path_parser.rs:294-305 | core/src/path_parser.rs:323-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 `core/src/path_parser.rs:294` 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, `core/src/path_parser.rs:293` calls `make_absolute` and `core/src/path_parser.rs:322` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) core/src/resources.rs:1724 — core/src/resources.rs:1724-1735 | core/src/resources.rs:3216-3227 — both copies are in the same file, so extract the 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) core/src/resources.rs:2940 — core/src/resources.rs:2940-2951 | core/src/resources.rs:2956-2967 — both copies are in the same file, so extract the block into 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) css/src/props/style/scrollbar.rs:610 — css/src/props/style/scrollbar.rs:610-621 | css/src/system.rs:2196-2207 — 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 `css/src/props/style/scrollbar.rs:610` 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) css/src/system.rs:802 — css/src/system.rs:802-813 | css/src/system.rs:856-867 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `css/src/system.rs:802` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) css/src/system.rs:2222 — css/src/system.rs:2222-2233 | css/src/system.rs:2274-2285 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `css/src/system.rs:2222` it begins part-way through the construct above it, so those exact lines 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) dll/src/desktop/compositor2.rs:636 — dll/src/desktop/compositor2.rs:636-647 | dll/src/desktop/compositor2.rs:651-662 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/compositor2.rs:636` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) dll/src/desktop/extra/gamepad/playstation.rs:319 — dll/src/desktop/extra/gamepad/playstation.rs:319-330 | dll/src/desktop/extra/gamepad/playstation.rs:358-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 `dll/src/desktop/extra/gamepad/playstation.rs:319` 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) dll/src/desktop/eyedropper/windows.rs:41 — dll/src/desktop/eyedropper/windows.rs:41-52 | dll/src/desktop/native_screenshot.rs:445-456 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) dll/src/desktop/shell2/common/capability_pump.rs:233 — dll/src/desktop/shell2/common/capability_pump.rs:233-244 | dll/src/desktop/shell2/common/capability_pump.rs:272-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 `dll/src/desktop/shell2/common/capability_pump.rs:233` it does not close everything it opens, so those exact lines 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) dll/src/desktop/shell2/common/event.rs:2052 — dll/src/desktop/shell2/common/event.rs:2052-2063 | dll/src/desktop/shell2/linux/x11/events.rs:1815-1826 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (12 lines × 2) dll/src/desktop/shell2/common/event.rs:11842 — dll/src/desktop/shell2/common/event.rs:11842-11853 | dll/src/desktop/shell2/common/event.rs:11935-11946 — both copies are in the same file, so extract the block into 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) dll/src/desktop/shell2/linux/system_style.rs:846 — dll/src/desktop/shell2/linux/system_style.rs:846-857 | dll/src/desktop/shell2/windows/system_style.rs:385-396 — 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 `dll/src/desktop/shell2/linux/system_style.rs:846` it begins part-way through the construct above it, so those 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, `dll/src/desktop/shell2/windows/system_style.rs:384` calls `stdin`, `null` and `dll/src/desktop/shell2/linux/system_style.rs:845` 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) dll/src/desktop/shell2/linux/x11/mod.rs:3678 — dll/src/desktop/shell2/linux/x11/mod.rs:3678-3689 | dll/src/desktop/shell2/linux/x11/mod.rs:3825-3837 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/x11/mod.rs:3678` it begins part-way through the construct above it, so those exact lines 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) dll/src/desktop/shell2/macos/mod.rs:8885 — dll/src/desktop/shell2/macos/mod.rs:8885-8896 | dll/src/desktop/shell2/macos/mod.rs:8906-8917 — both copies are in the same file, so extract the block into 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) dll/src/desktop/shell2/windows/mod.rs:2289 — dll/src/desktop/shell2/windows/mod.rs:2289-2300 | dll/src/desktop/shell2/windows/mod.rs:2973-2984 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/windows/mod.rs:2289` it begins part-way through the construct above it, so those exact lines 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) dll/src/web/transpiler_remill.rs:3003 — dll/src/web/transpiler_remill.rs:3003-3014 | dll/src/web/transpiler_remill.rs:3887-3898 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/web/transpiler_remill.rs:3003` it does not close everything it opens, so those exact lines 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) dll/src/web/transpiler_remill.rs:4875 — dll/src/web/transpiler_remill.rs:4875-4886 | dll/src/web/transpiler_remill.rs:4952-4963 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/web/transpiler_remill.rs:4875` it begins part-way through the construct above it, so those exact lines 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) dll/src/web/transpiler_remill.rs:5308 — dll/src/web/transpiler_remill.rs:5308-5319 | dll/src/web/transpiler_remill.rs:5445-5456 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/web/transpiler_remill.rs:5308` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) dll/src/web/transpiler_remill.rs:8637 — dll/src/web/transpiler_remill.rs:8637-8648 | dll/src/web/transpiler_remill.rs:9274-9285 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/web/transpiler_remill.rs:8637` it begins part-way through the construct above it, so those exact lines 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) doc/src/codegen/v2/lang_ada/managed.rs:50 — doc/src/codegen/v2/lang_ada/managed.rs:50-61 | doc/src/codegen/v2/lang_ada/managed.rs:229-240 — both copies are in the same file, so extract the 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, `doc/src/codegen/v2/lang_ada/managed.rs:228` calls `to_lowercase` and `doc/src/codegen/v2/lang_ada/managed.rs:48` 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) doc/src/codegen/v2/lang_c.rs:564 — doc/src/codegen/v2/lang_c.rs:564-575 | doc/src/codegen/v2/lang_c.rs:846-857 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_c.rs:564` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 53 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×59
  • Duplicated block (13 lines × 2) css/src/system.rs:2241 — css/src/system.rs:2241-2253 | css/src/system.rs:2293-2305 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `css/src/system.rs:2241` it begins part-way through the construct above it, so those exact lines 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) css/src/system.rs:2590 — css/src/system.rs:2590-2602 | css/src/system.rs:2640-2652 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `css/src/system.rs:2590` it begins part-way through the construct above it, so those exact lines 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) dll/src/desktop/extra/permission/ios.rs:82 — dll/src/desktop/extra/permission/ios.rs:82-94 | dll/src/desktop/extra/permission/macos.rs:182-194 — before extracting anything, compare `dll/src/desktop/extra/permission/ios.rs` and `dll/src/desktop/extra/permission/macos.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) dll/src/desktop/shell2/android/mod.rs:425 — dll/src/desktop/shell2/android/mod.rs:425-437 | dll/src/desktop/shell2/ios/mod.rs:1822-1834 — `dll/src/desktop/shell2/android/mod.rs` and `dll/src/desktop/shell2/ios/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 17 separate duplicated blocks between them, totalling at least 242 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/android/mod.rs:425` 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) dll/src/desktop/shell2/common/event.rs:5419 — dll/src/desktop/shell2/common/event.rs:5419-5431 | dll/src/desktop/shell2/common/event.rs:5448-5460 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/common/event.rs:5419` it does not close everything it opens, so those exact lines 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) dll/src/desktop/shell2/common/transient.rs:1032 — dll/src/desktop/shell2/common/transient.rs:1032-1044 | dll/src/desktop/shell2/common/transient.rs:1087-1099 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/common/transient.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 (13 lines × 2) dll/src/desktop/shell2/linux/wayland/events.rs:363 — dll/src/desktop/shell2/linux/wayland/events.rs:363-375 | dll/src/desktop/shell2/linux/wayland/events.rs:433-445 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/events.rs:363` it does not close everything it opens, so those exact lines 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) dll/src/desktop/shell2/linux/wayland/events.rs:2683 — dll/src/desktop/shell2/linux/wayland/events.rs:2683-2695 | dll/src/desktop/shell2/linux/wayland/events.rs:2741-2753 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/events.rs:2683` it does not close everything it opens, so those exact lines 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) dll/src/desktop/shell2/linux/wayland/events.rs:5253 — dll/src/desktop/shell2/linux/wayland/events.rs:5253-5265 | dll/src/desktop/shell2/linux/x11/mod.rs:9449-9461 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/events.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 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 `dll/src/desktop/shell2/linux/wayland/events.rs:5253` it does not close everything it opens, so those 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 (13 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:6259 — dll/src/desktop/shell2/linux/wayland/mod.rs:6259-6271 | dll/src/desktop/shell2/linux/x11/events.rs:1400-1412 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/events.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 263 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 `dll/src/desktop/shell2/linux/wayland/mod.rs:6259` 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) dll/src/desktop/shell2/linux/wayland/mod.rs:6380 — dll/src/desktop/shell2/linux/wayland/mod.rs:6380-6392 | dll/src/desktop/shell2/linux/x11/events.rs:1508-1520 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/events.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 263 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 `dll/src/desktop/shell2/linux/wayland/mod.rs:6380` it does not close everything it opens, so those exact lines 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) dll/src/web/classify.rs:134 — dll/src/web/classify.rs:134-146 | doc/src/utils/string.rs:3-15 — 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 (13 lines × 2) dll/src/web/transpiler_remill.rs:7785 — dll/src/web/transpiler_remill.rs:7785-7797 | dll/src/web/transpiler_remill.rs:7804-7816 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/web/transpiler_remill.rs:7785` it begins part-way through the construct above it, so those exact lines 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) doc/src/autofix/mod.rs:577 — doc/src/autofix/mod.rs:577-589 | doc/src/autofix/patch_format.rs:589-601 — 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 `doc/src/autofix/mod.rs:577` 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) doc/src/autofix/type_index.rs:2039 — doc/src/autofix/type_index.rs:2039-2051 | doc/src/autofix/type_index.rs:2234-2246 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/type_index.rs:2039` it begins part-way through the construct above it, so those exact lines 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) doc/src/autotest/extract.rs:187 — doc/src/autotest/extract.rs:187-199 | doc/src/autotest/extract.rs:213-225 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autotest/extract.rs:187` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) doc/src/codegen/v2/lang_crystal/mod.rs:272 — doc/src/codegen/v2/lang_crystal/mod.rs:272-284 | doc/src/codegen/v2/lang_crystal/types.rs:213-225 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) doc/src/codegen/v2/lang_csharp/wrappers.rs:1996 — doc/src/codegen/v2/lang_csharp/wrappers.rs:1996-2008 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:2037-2049 — `doc/src/codegen/v2/lang_csharp/wrappers.rs` and `doc/src/codegen/v2/lang_kotlin/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 13 separate duplicated blocks between them, totalling at least 143 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_csharp/wrappers.rs:1996` it begins part-way through the construct above it, so those exact lines 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) doc/src/codegen/v2/lang_d/model.rs:392 — doc/src/codegen/v2/lang_d/model.rs:392-404 | doc/src/codegen/v2/lang_swift/model.rs:397-409 — `doc/src/codegen/v2/lang_d/model.rs` and `doc/src/codegen/v2/lang_swift/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 21 separate duplicated blocks between them, totalling at least 240 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_d/model.rs:392` 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, `doc/src/codegen/v2/lang_d/model.rs:406` calls `raw_identifier` and `doc/src/codegen/v2/lang_swift/model.rs:411` 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) doc/src/codegen/v2/lang_node/wrappers.rs:492 — doc/src/codegen/v2/lang_node/wrappers.rs:492-504 | doc/src/codegen/v2/lang_node/wrappers.rs:1210-1222 — both copies are in the same file, so extract the block into 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) doc/src/codegen/v2/lang_ruby/wrappers.rs:1269 — doc/src/codegen/v2/lang_ruby/wrappers.rs:1269-1281 | doc/src/codegen/v2/lang_ruby/wrappers.rs:1349-1361 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_ruby/wrappers.rs:1269` it begins part-way through the construct above it, so those exact lines 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) doc/src/codegen/v2/lang_rust.rs:1681 — doc/src/codegen/v2/lang_rust.rs:1681-1693 | doc/src/codegen/v2/lang_rust.rs:2043-2055 — both copies are in the same file, so extract the block into 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) doc/src/codegen/v2/lang_rust.rs:3811 — doc/src/codegen/v2/lang_rust.rs:3811-3823 | doc/src/codegen/v2/lang_rust.rs:3898-3910 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_rust.rs:3811` it begins part-way through the construct above it, so those exact lines 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) doc/src/reftest/autodebug.rs:2288 — doc/src/reftest/autodebug.rs:2288-2300 | doc/src/reftest/autoreview.rs:2130-2142 — before extracting anything, compare `doc/src/reftest/autodebug.rs` and `doc/src/reftest/autoreview.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) layout/src/callbacks.rs:3493 — layout/src/callbacks.rs:3493-3505 | layout/src/callbacks.rs:3568-3580 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/callbacks.rs:3493` 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.
  • + 34 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×51
  • ClassTooLong: WaylandWindow dll/src/desktop/shell2/linux/wayland/mod.rs:544 — ClassTooLong — 4755 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 132 methods, 7 blocks, lines 544-11092. The bar is 400 significant lines; this is 4355 over it, 11.89× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: X11Window dll/src/desktop/shell2/linux/x11/mod.rs:2593 — ClassTooLong — 3445 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, 11 blocks, lines 1743-8843. The bar is 400 significant lines; this is 3045 over it, 8.61× 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: Renderer webrender/core/src/renderer/mod.rs:761 — ClassTooLong — 3144 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 86 methods, 3 blocks, lines 761-5971. The bar is 400 significant lines; this is 2744 over it, 7.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: CssProperty css/src/props/property.rs:662 — ClassTooLong — 2666 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 426 methods, 2 blocks, lines 662-7908. The bar is 400 significant lines; this is 2266 over it, 6.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: MacOSWindow dll/src/desktop/shell2/macos/mod.rs:4009 — ClassTooLong — 2625 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, 7 blocks, lines 4009-9323. The bar is 400 significant lines; this is 2225 over it, 6.56× 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: CssPropertyCache core/src/prop_cache.rs:1017 — ClassTooLong — 2526 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 75 methods, 5 blocks, lines 1017-5395. The bar is 400 significant lines; this is 2126 over it, 6.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.
  • ClassTooLong: SceneBuilder webrender/core/src/scene_building.rs:434 — ClassTooLong — 2511 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, 2 blocks, lines 434-4302. The bar is 400 significant lines; this is 2111 over it, 6.28× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: CallbackInfo layout/src/callbacks.rs:1290 — ClassTooLong — 2382 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 384 methods, 3 blocks, lines 1162-7027. The bar is 400 significant lines; this is 1982 over it, 5.96× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Win32Window dll/src/desktop/shell2/windows/mod.rs:147 — ClassTooLong — 2366 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 62 methods, 8 blocks, lines 147-7844. The bar is 400 significant lines; this is 1966 over it, 5.92× 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: BatchBuilder webrender/core/src/batch.rs:729 — ClassTooLong — 2061 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 9 methods, 2 blocks, lines 729-3635. The bar is 400 significant lines; this is 1661 over it, 5.15× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Device webrender/core/src/device/gl.rs:1076 — ClassTooLong — 1725 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 133 methods, 2 blocks, lines 1076-4154. The bar is 400 significant lines; this is 1325 over it, 4.31× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Dom core/src/dom.rs:4237 — ClassTooLong — 1461 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 247 methods, 8 blocks, lines 4237-7478. The bar is 400 significant lines; this is 1061 over it, 3.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: PicturePrimitive webrender/core/src/picture.rs:5154 — ClassTooLong — 1309 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 5154-7373. The bar is 400 significant lines; this is 909 over it, 3.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: TileCacheInstance webrender/core/src/picture.rs:1689 — ClassTooLong — 1298 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 18 methods, 2 blocks, lines 1689-4048. The bar is 400 significant lines; this is 898 over it, 3.25× 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: Profiler webrender/core/src/profiler.rs:364 — ClassTooLong — 1256 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 21 methods, 2 blocks, lines 364-2052. The bar is 400 significant lines; this is 856 over it, 3.14× 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: GlContextPtr core/src/gl.rs:985 — ClassTooLong — 1255 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 229 methods, 10 blocks, lines 985-2935. The bar is 400 significant lines; this is 855 over it, 3.14× 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: ResourceCache webrender/core/src/resource_cache.rs:442 — ClassTooLong — 1113 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 56 methods, 4 blocks, lines 442-2293. The bar is 400 significant lines; this is 713 over it, 2.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: TaffyBridge layout/src/solver3/taffy_bridge.rs:673 — ClassTooLong — 1077 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, 8 blocks, lines 673-2545. The bar is 400 significant lines; this is 677 over it, 2.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: GestureAndDragManager layout/src/managers/gesture.rs:720 — ClassTooLong — 1019 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, 5 blocks, lines 720-4554. The bar is 400 significant lines; this is 619 over it, 2.55× 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: StyledDom core/src/styled_dom.rs:994 — ClassTooLong — 994 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 41 methods, 3 blocks, lines 994-2826. The bar is 400 significant lines; this is 594 over it, 2.49× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: NodeData core/src/dom.rs:1689 — ClassTooLong — 850 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 113 methods, 13 blocks, lines 1689-4150. The bar is 400 significant lines; this is 450 over it, 2.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: HeadlessWindow dll/src/desktop/shell2/headless/mod.rs:1493 — ClassTooLong — 850 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 26 methods, 3 blocks, lines 1493-3196. The bar is 400 significant lines; this is 450 over it, 2.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: LayoutTreeBuilder layout/src/solver3/layout_tree.rs:2028 — ClassTooLong — 850 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 22 methods, 2 blocks, lines 2028-3482. The bar is 400 significant lines; this is 450 over it, 2.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ColorU css/src/props/basic/color.rs:35 — ClassTooLong — 829 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 140 methods, 5 blocks, lines 35-1375. The bar is 400 significant lines; this is 429 over it, 2.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: CssPropertyType css/src/props/property.rs:930 — ClassTooLong — 824 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 9 methods, 5 blocks, lines 930-1905. The bar is 400 significant lines; this is 424 over it, 2.06× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • + 26 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×48
  • Duplicated block (14 lines × 2) core/src/diff.rs:216 — core/src/diff.rs:216-229 | core/src/styled_dom.rs:3341-3354 — 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 `core/src/diff.rs:216` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) core/src/style.rs:142 — core/src/style.rs:142-155 | core/src/style.rs:186-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 `core/src/style.rs:142` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) dll/src/desktop/extra/webtransport/mod.rs:101 — dll/src/desktop/extra/webtransport/mod.rs:101-114 | dll/src/unified/webtransport.rs:155-168 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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) dll/src/desktop/shell2/common/event.rs:8877 — dll/src/desktop/shell2/common/event.rs:8877-8890 | dll/src/desktop/shell2/common/event.rs:8962-8975 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/common/event.rs:8877` it begins part-way through the construct above it, so those exact lines 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) dll/src/desktop/shell2/linux/wayland/mod.rs:4638 — dll/src/desktop/shell2/linux/wayland/mod.rs:4638-4651 | dll/src/desktop/shell2/linux/wayland/mod.rs:5845-5858 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:4638` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `&mut` in one and `super) fn wayland_set_primary_selection(&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 (14 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:6354 — dll/src/desktop/shell2/linux/wayland/mod.rs:6354-6367 | dll/src/desktop/shell2/linux/x11/events.rs:1486-1499 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/events.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 263 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 first that the copies are not typed on the same thing: the declarations holding them bind `node` to `event::HitTestNode` in one and `HitTestNode` 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 (14 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:10905 — dll/src/desktop/shell2/linux/wayland/mod.rs:10905-10918 | dll/src/desktop/shell2/linux/wayland/mod.rs:11036-11049 — both copies are in the same file, so extract the 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `dll/src/desktop/shell2/linux/wayland/mod.rs:10921` calls `unwrap` and `dll/src/desktop/shell2/linux/wayland/mod.rs:11052` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 2) dll/src/desktop/shell2/linux/x11/mod.rs:8662 — dll/src/desktop/shell2/linux/x11/mod.rs:8662-8675 | dll/src/desktop/shell2/linux/x11/mod.rs:8787-8800 — both copies are in the same file, so extract the 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `dll/src/desktop/shell2/linux/x11/mod.rs:8678` calls `unwrap` and `dll/src/desktop/shell2/linux/x11/mod.rs:8803` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 2) dll/src/desktop/shell2/windows/mod.rs:1553 — dll/src/desktop/shell2/windows/mod.rs:1553-1566 | dll/src/desktop/shell2/windows/mod.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.
  • Duplicated block (14 lines × 2) dll/src/web/transpiler_remill.rs:2708 — dll/src/web/transpiler_remill.rs:2708-2721 | dll/src/web/transpiler_remill.rs:2870-2883 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/web/transpiler_remill.rs:2708` it begins part-way through the construct above it, so those exact lines 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) doc/src/autofix/diff.rs:1007 — doc/src/autofix/diff.rs:1007-1020 | doc/src/autofix/diff.rs:1023-1036 — both copies are in the same file, so extract the block into 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) doc/src/autofix/mod.rs:2239 — doc/src/autofix/mod.rs:2239-2252 | doc/src/autofix/mod.rs:2273-2286 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/mod.rs:2239` it does not close everything it opens, so those exact lines 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) doc/src/autofix/workspace.rs:1530 — doc/src/autofix/workspace.rs:1530-1543 | doc/src/autofix/workspace.rs:1575-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 (14 lines × 2) doc/src/codegen/v2/lang_d/model.rs:618 — doc/src/codegen/v2/lang_d/model.rs:618-631 | doc/src/codegen/v2/lang_swift/model.rs:635-648 — `doc/src/codegen/v2/lang_d/model.rs` and `doc/src/codegen/v2/lang_swift/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 21 separate duplicated blocks between them, totalling at least 240 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_d/model.rs:618` 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) doc/src/codegen/v2/lang_d/model.rs:672 — doc/src/codegen/v2/lang_d/model.rs:672-685 | doc/src/codegen/v2/lang_swift/model.rs:689-702 — `doc/src/codegen/v2/lang_d/model.rs` and `doc/src/codegen/v2/lang_swift/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 21 separate duplicated blocks between them, totalling at least 240 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_d/model.rs:672` 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) doc/src/codegen/v2/lang_d/model.rs:791 — doc/src/codegen/v2/lang_d/model.rs:791-804 | doc/src/codegen/v2/lang_swift/model.rs:797-810 — `doc/src/codegen/v2/lang_d/model.rs` and `doc/src/codegen/v2/lang_swift/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 21 separate duplicated blocks between them, totalling at least 240 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_d/model.rs:791` 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) doc/src/codegen/v2/lang_kotlin/wrappers.rs:213 — doc/src/codegen/v2/lang_kotlin/wrappers.rs:213-226 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:271-284 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_kotlin/wrappers.rs:213` it begins part-way through the construct above it, so those exact lines 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) doc/src/codegen/v2/lang_node/wrappers.rs:705 — doc/src/codegen/v2/lang_node/wrappers.rs:705-718 | doc/src/codegen/v2/lang_node/wrappers.rs:1176-1189 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_node/wrappers.rs:705` it begins part-way through the construct above it, so those exact lines 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) doc/src/codegen/v2/lang_rust.rs:2853 — doc/src/codegen/v2/lang_rust.rs:2853-2866 | doc/src/codegen/v2/lang_rust.rs:3126-3139 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_rust.rs:2853` it begins part-way through the construct above it, so those exact lines 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) doc/src/patch/mod.rs:388 — doc/src/patch/mod.rs:388-401 | doc/src/patch/mod.rs:665-678 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/patch/mod.rs:388` 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) doc/src/reftest/regression.rs:150 — doc/src/reftest/regression.rs:150-163 | doc/src/reftest/regression.rs:176-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.
  • Duplicated block (14 lines × 2) doc/src/reftest/regression.rs:1175 — doc/src/reftest/regression.rs:1175-1188 | doc/src/reftest/regression.rs:1974-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. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/reftest/regression.rs:1175` it does not close everything it opens, so those exact lines 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) layout/src/cpurender/raster.rs:92 — layout/src/cpurender/raster.rs:92-105 | layout/src/cpurender/raster.rs:129-142 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/cpurender/raster.rs:92` 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) layout/src/solver3/cache.rs:2663 — layout/src/solver3/cache.rs:2663-2676 | layout/src/solver3/cache.rs:2715-2728 — both copies are in the same file, so extract the 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, `layout/src/solver3/cache.rs:2678` calls `unpack` and `layout/src/solver3/cache.rs:2730` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 2) layout/src/solver3/display_list.rs:6236 — layout/src/solver3/display_list.rs:6236-6249 | layout/src/solver3/display_list.rs:6617-6630 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/display_list.rs:6236` it begins part-way through the construct above it, so those 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.
D2 · Cognitive Complexity · LayoutWindow · ×38
  • LayoutWindow::layout_dom_recursive_impl (cognitive 215) layout/src/window.rs:5543 — LayoutWindow::layout_dom_recursive_impl has cognitive complexity 215 (threshold 15). Drivers by points: if/else 74 (165 pts), loops 10 (24 pts), match/switch 5 (19 pts), boolean chains 7 (nesting depth added 119). 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.
  • LayoutWindow::reshape_text_node (cognitive 148) layout/src/window.rs:17383 — LayoutWindow::reshape_text_node has cognitive complexity 148 (threshold 15). Drivers by points: if/else 49 (129 pts), loops 5 (12 pts), boolean chains 6, match/switch 1 (nesting depth added 87). 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.
  • LayoutWindow::apply_text_tweens (cognitive 134) layout/src/window.rs:8915 — LayoutWindow::apply_text_tweens has cognitive complexity 134 (threshold 15). Drivers by points: if/else 43 (92 pts), match/switch 11 (24 pts), boolean chains 12, loops 3 (6 pts) (nesting depth added 65). 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.
  • LayoutWindow::process_mouse_click_for_selection (cognitive 114) layout/src/window.rs:19366 — LayoutWindow::process_mouse_click_for_selection has cognitive complexity 114 (threshold 15). Drivers by points: if/else 31 (84 pts), loops 6 (14 pts), match/switch 3 (13 pts), boolean chains 3 (nesting depth added 71). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LayoutWindow::begin_reconciliation (cognitive 91) layout/src/window.rs:10861 — LayoutWindow::begin_reconciliation has cognitive complexity 91 (threshold 15). Drivers by points: if/else 24 (70 pts), loops 8 (15 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 55). 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.
  • LayoutWindow::tick_animations (cognitive 87) layout/src/window.rs:11609 — LayoutWindow::tick_animations has cognitive complexity 87 (threshold 15). Drivers by points: if/else 23 (63 pts), loops 8 (14 pts), match/switch 2 (7 pts), boolean chains 3 (nesting depth added 51). 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.
  • LayoutWindow::run_track_frames (cognitive 80) layout/src/window.rs:13918 — LayoutWindow::run_track_frames has cognitive complexity 80 (threshold 15). Drivers by points: if/else 18 (62 pts), loops 5 (11 pts), boolean chains 4, match/switch 2 (3 pts) (nesting depth added 51). 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.
  • LayoutWindow::process_accessibility_action (cognitive 76) layout/src/window.rs:15882 — LayoutWindow::process_accessibility_action has cognitive complexity 76 (threshold 15). Drivers by points: if/else 28 (64 pts), loops 3 (6 pts), match/switch 3 (5 pts), boolean chains 1 (nesting depth added 41). 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.
  • LayoutWindow::composite_zombies_cpu (cognitive 66) layout/src/window.rs:25345 — LayoutWindow::composite_zombies_cpu has cognitive complexity 66 (threshold 15). Drivers by points: if/else 20 (49 pts), loops 5 (10 pts), match/switch 2 (5 pts), boolean chains 2 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LayoutWindow::get_selected_content_for_clipboard (cognitive 60) layout/src/window.rs:20281 — LayoutWindow::get_selected_content_for_clipboard has cognitive complexity 60 (threshold 15). Drivers by points: if/else 18 (51 pts), loops 2 (7 pts), boolean chains 1, match/switch 1 (nesting depth added 38). 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.
  • LayoutWindow::layout_and_generate_display_list_impl (cognitive 48) layout/src/window.rs:2306 — LayoutWindow::layout_and_generate_display_list_impl has cognitive complexity 48 (threshold 15). Drivers by points: if/else 23 (35 pts), loops 6 (11 pts), boolean chains 2 (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.
  • LayoutWindow::select_next_occurrence (cognitive 47) layout/src/window.rs:13202 — LayoutWindow::select_next_occurrence has cognitive complexity 47 (threshold 15). Drivers by points: if/else 22 (41 pts), match/switch 4 (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.
  • LayoutWindow::update_a11y_tree_incremental (cognitive 40) layout/src/window.rs:12332 — LayoutWindow::update_a11y_tree_incremental has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (34 pts), loops 1 (3 pts), match/switch 1 (2 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.
  • LayoutWindow::apply_seat_selection_op (cognitive 34) layout/src/window.rs:10474 — LayoutWindow::apply_seat_selection_op has cognitive complexity 34 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 5 (12 pts), loops 3 (7 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.
  • LayoutWindow::synchronize_scrollbar_opacity (cognitive 34) layout/src/window.rs:11883 — LayoutWindow::synchronize_scrollbar_opacity has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (24 pts), match/switch 2 (6 pts), boolean chains 3, 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.
  • LayoutWindow::finish_reconciliation (cognitive 33) layout/src/window.rs:11286 — LayoutWindow::finish_reconciliation has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LayoutWindow::apply_one_text_changeset (cognitive 33) layout/src/window.rs:16478 — LayoutWindow::apply_one_text_changeset has cognitive complexity 33 (threshold 15). Drivers by points: if/else 26 (31 pts), boolean chains 1, match/switch 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • LayoutWindow::queue_resize_events_after_layout (cognitive 31) layout/src/window.rs:20557 — LayoutWindow::queue_resize_events_after_layout has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 3 (5 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.
  • LayoutWindow::regenerate_display_list_for_dom (cognitive 30) layout/src/window.rs:18150 — LayoutWindow::regenerate_display_list_for_dom has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (24 pts), boolean chains 3, loops 1 (2 pts), match/switch 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.
  • LayoutWindow::extract_clipboard_ranges (cognitive 30) layout/src/window.rs:20208 — LayoutWindow::extract_clipboard_ranges has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 2 (4 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.
  • LayoutWindow::try_incremental_text_relayout (cognitive 26) layout/src/window.rs:18688 — LayoutWindow::try_incremental_text_relayout has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 2 (4 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LayoutWindow::remap_node_ids (cognitive 26) layout/src/window.rs:20900 — LayoutWindow::remap_node_ids has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (19 pts), match/switch 3 (7 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.
  • LayoutWindow::caret_node_position_for_seat (cognitive 25) layout/src/window.rs:3532 — LayoutWindow::caret_node_position_for_seat has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 3 (5 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.
  • LayoutWindow::zombie_paint_rects (cognitive 25) layout/src/window.rs:25610 — LayoutWindow::zombie_paint_rects has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 3 (5 pts), boolean chains 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.
  • LayoutWindow::finalize_pending_focus_changes (cognitive 24) layout/src/window.rs:9890 — LayoutWindow::finalize_pending_focus_changes has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 4, loops 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • + 13 more in this group — see findings.md.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×37
  • Members sharing a duplicated core (4 members, 50+ identical tokens) core/src/xml.rs:8357 — core/src/xml.rs:8357-8461 | core/src/xml.rs:8472-8524 | core/src/xml.rs:8644-8753 | core/src/xml.rs:8763-8843 — 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) dll/src/desktop/display.rs:1058 — dll/src/desktop/display.rs:1058-1137 | dll/src/desktop/display.rs:1140-1209 | dll/src/desktop/display.rs:1212-1295 | dll/src/desktop/display.rs:1298-1421 — 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) dll/src/desktop/extra/camera/windows.rs:447 — dll/src/desktop/extra/camera/windows.rs:447-460 | dll/src/desktop/extra/capture_slot.rs:125-132 | dll/src/desktop/extra/screencap/windows.rs:286-373 | layout/src/cpurender/raster.rs:4611-4658 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:4950 — dll/src/desktop/shell2/linux/wayland/mod.rs:4950-5060 | dll/src/desktop/shell2/linux/x11/events.rs:875-999 | dll/src/desktop/shell2/macos/events.rs:459-703 | dll/src/desktop/shell2/windows/mod.rs:4030-6901 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:6257 — dll/src/desktop/shell2/linux/wayland/mod.rs:6257-6271 | dll/src/desktop/shell2/linux/x11/events.rs:1398-1412 | dll/src/desktop/shell2/macos/events.rs:1149-1171 | dll/src/desktop/shell2/windows/mod.rs:2155-2171 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:6275 — dll/src/desktop/shell2/linux/wayland/mod.rs:6275-6285 | dll/src/desktop/shell2/linux/x11/events.rs:1416-1426 | dll/src/desktop/shell2/macos/events.rs:1176-1195 | dll/src/desktop/shell2/windows/mod.rs:2175-2190 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:6294 — dll/src/desktop/shell2/linux/wayland/mod.rs:6294-6312 | dll/src/desktop/shell2/linux/x11/events.rs:1435-1453 | dll/src/desktop/shell2/macos/events.rs:1109-1140 | dll/src/desktop/shell2/windows/mod.rs:2198-2221 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:6540 — dll/src/desktop/shell2/linux/wayland/mod.rs:6540-6551 | dll/src/desktop/shell2/linux/x11/mod.rs:6280-6291 | dll/src/desktop/shell2/macos/mod.rs:6084-6095 | dll/src/desktop/shell2/windows/mod.rs:2233-2244 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:7011 — dll/src/desktop/shell2/linux/wayland/mod.rs:7011-8271 | dll/src/desktop/shell2/linux/x11/mod.rs:6380-7131 | dll/src/desktop/shell2/macos/mod.rs:7700-8438 | dll/src/desktop/shell2/windows/mod.rs:1139-1812 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:10423 — dll/src/desktop/shell2/linux/wayland/mod.rs:10423-10463 | dll/src/desktop/shell2/linux/wayland/mod.rs:10466-10496 | dll/src/desktop/shell2/linux/wayland/mod.rs:10575-10605 | dll/src/desktop/shell2/linux/wayland/mod.rs:10607-10629 — 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) dll/src/desktop/shell2/linux/x11/mod.rs:5919 — dll/src/desktop/shell2/linux/x11/mod.rs:5919-5953 | dll/src/desktop/shell2/linux/x11/mod.rs:5959-5998 | dll/src/desktop/shell2/linux/x11/mod.rs:7358-7441 | dll/src/desktop/shell2/linux/x11/mod.rs:8428-8482 — 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) doc/src/codegen/v2/lang_ada/types.rs:107 — doc/src/codegen/v2/lang_ada/types.rs:107-194 | doc/src/codegen/v2/lang_cobol/types.rs:152-205 | doc/src/codegen/v2/lang_fortran/types.rs:61-172 | doc/src/codegen/v2/lang_pascal/types.rs:48-146 — 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) doc/src/codegen/v2/lang_cpp/cpp03.rs:490 — doc/src/codegen/v2/lang_cpp/cpp03.rs:490-529 | doc/src/codegen/v2/lang_cpp/cpp11.rs:393-439 | doc/src/codegen/v2/lang_cpp/cpp17.rs:572-616 | doc/src/codegen/v2/lang_cpp/cpp20.rs:259-317 — 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) doc/src/codegen/v2/lang_cpp/cpp03.rs:554 — doc/src/codegen/v2/lang_cpp/cpp03.rs:554-587 | doc/src/codegen/v2/lang_cpp/cpp11.rs:474-508 | doc/src/codegen/v2/lang_cpp/cpp17.rs:663-700 | doc/src/codegen/v2/lang_cpp/cpp20.rs:362-399 — 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) doc/src/codegen/v2/lang_crystal/types.rs:134 — doc/src/codegen/v2/lang_crystal/types.rs:134-154 | doc/src/codegen/v2/lang_julia/types.rs:170-192 | doc/src/codegen/v2/lang_odin/types.rs:118-138 | doc/src/codegen/v2/lang_v/types.rs:123-143 — 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) doc/src/codegen/v2/lang_csharp/wrappers.rs:519 — doc/src/codegen/v2/lang_csharp/wrappers.rs:519-533 | doc/src/codegen/v2/lang_java/wrappers.rs:105-119 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:352-366 | doc/src/codegen/v2/lang_smalltalk/wrappers.rs:94-108 — 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) doc/src/codegen/v2/lang_csharp/wrappers.rs:1425 — doc/src/codegen/v2/lang_csharp/wrappers.rs:1425-1938 | doc/src/codegen/v2/lang_java/wrappers.rs:1342-1717 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:1538-1733 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:1742-1978 — 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) doc/src/codegen/v2/lang_freebasic/types.rs:149 — doc/src/codegen/v2/lang_freebasic/types.rs:149-174 | doc/src/codegen/v2/lang_freebasic/types.rs:180-289 | doc/src/codegen/v2/lang_vb6/types.rs:166-192 | doc/src/codegen/v2/lang_vb6/types.rs:216-281 — 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) doc/src/codegen/v2/lang_java/managed.rs:44 — doc/src/codegen/v2/lang_java/managed.rs:44-322 | doc/src/codegen/v2/lang_kotlin/managed.rs:27-313 | doc/src/codegen/v2/lang_kotlin/managed.rs:320-444 | doc/src/codegen/v2/lang_lisp/managed.rs:129-240 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) doc/src/codegen/v2/lang_rust.rs:2469 — doc/src/codegen/v2/lang_rust.rs:2469-2511 | doc/src/codegen/v2/rust/dynamic_binding.rs:414-429 | doc/src/codegen/v2/rust/shared.rs:84-125 | doc/src/codegen/v2/rust/static_binding.rs:503-518 — 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) layout/src/cpurender/pixmap.rs:65 — layout/src/cpurender/pixmap.rs:65-124 | layout/src/cpurender/pixmap.rs:169-308 | layout/src/cpurender/pixmap.rs:348-489 | layout/src/cpurender/raster.rs:4663-4687 — 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) layout/src/font.rs:2504 — layout/src/font.rs:2504-2514 | layout/src/font.rs:2516-2526 | layout/src/text3/default.rs:381-391 | layout/src/text3/default.rs:393-404 — 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) layout/src/solver3/layout_tree.rs:498 — layout/src/solver3/layout_tree.rs:498-537 | layout/src/text3/dense.rs:1197-1275 | layout/src/text3/dense.rs:1295-1426 | layout/src/text3/dense.rs:1454-1636 — 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) layout/src/text3/edit.rs:528 — layout/src/text3/edit.rs:528-593 | layout/src/text3/edit.rs:611-698 | layout/src/text3/edit.rs:770-898 | layout/src/text3/edit.rs:910-1017 — 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) layout/src/widgets/backstage.rs:244 — layout/src/widgets/backstage.rs:244-301 | layout/src/widgets/quick_access.rs:289-334 | layout/src/widgets/ribbon.rs:621-634 | layout/src/widgets/statusbar.rs:312-357 — 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.
  • + 12 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×36
  • Duplicated block (15 lines × 2) core/src/diff.rs:366 — core/src/diff.rs:366-380 | core/src/diff.rs:1431-1445 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/diff.rs:366` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) dll/src/desktop/extra/sqlite/mod.rs:633 — dll/src/desktop/extra/sqlite/mod.rs:633-647 | dll/src/desktop/extra/sqlite/mod.rs:683-697 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/extra/sqlite/mod.rs:633` 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) dll/src/desktop/shell2/android/mod.rs:2742 — dll/src/desktop/shell2/android/mod.rs:2742-2756 | dll/src/desktop/shell2/android/mod.rs:3032-3046 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/android/mod.rs:2742` it begins part-way through the construct above it, so those exact lines 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) dll/src/desktop/shell2/linux/wayland/mod.rs:2210 — dll/src/desktop/shell2/linux/wayland/mod.rs:2210-2224 | dll/src/desktop/shell2/linux/x11/mod.rs:4000-4014 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `dll/src/desktop/shell2/linux/x11/mod.rs:3998` calls `detect_frame_interval` and `dll/src/desktop/shell2/linux/wayland/mod.rs:2209` 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 (15 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:10867 — dll/src/desktop/shell2/linux/wayland/mod.rs:10867-10881 | dll/src/desktop/shell2/linux/x11/mod.rs:8625-8639 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:10867` it begins part-way through the construct above it, so those exact lines 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) dll/src/desktop/shell2/macos/mod.rs:3652 — dll/src/desktop/shell2/macos/mod.rs:3652-3666 | dll/src/desktop/shell2/macos/mod.rs:3837-3851 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/macos/mod.rs:3652` 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) dll/src/desktop/shell2/windows/mod.rs:5823 — dll/src/desktop/shell2/windows/mod.rs:5823-5837 | dll/src/desktop/shell2/windows/mod.rs:6030-6044 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/windows/mod.rs:5823` 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) dll/src/desktop/tray/linux.rs:464 — dll/src/desktop/tray/linux.rs:464-478 | dll/src/desktop/tray/linux.rs:822-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. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/tray/linux.rs:464` 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) doc/src/api.rs:2127 — doc/src/api.rs:2127-2141 | doc/src/api.rs:2398-2412 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/api.rs:2127` it does not close everything it opens, so those exact lines 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) doc/src/codegen/v2/lang_cpp/cpp03.rs:573 — doc/src/codegen/v2/lang_cpp/cpp03.rs:573-587 | doc/src/codegen/v2/lang_cpp/cpp11.rs:494-508 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/codegen/v2/lang_cpp/cpp03.rs:573` it begins part-way through the construct above it, so those 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, `doc/src/codegen/v2/lang_cpp/cpp11.rs:493` calls `push_str` and `doc/src/codegen/v2/lang_cpp/cpp03.rs:572` 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) doc/src/codegen/v2/lang_haskell/types.rs:424 — doc/src/codegen/v2/lang_haskell/types.rs:424-438 | doc/src/codegen/v2/lang_haskell/types.rs:796-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.
  • Duplicated block (15 lines × 2) doc/src/codegen/v2/lang_ocaml/types.rs:838 — doc/src/codegen/v2/lang_ocaml/types.rs:838-852 | doc/src/codegen/v2/lang_ocaml/types.rs:859-873 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_ocaml/types.rs:838` 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) doc/src/codegen/v2/lang_rust.rs:2771 — doc/src/codegen/v2/lang_rust.rs:2771-2785 | doc/src/codegen/v2/lang_rust.rs:3034-3048 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_rust.rs:2771` it begins part-way through the construct above it, so those exact lines 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) doc/src/codegen/v2/lang_rust.rs:2947 — doc/src/codegen/v2/lang_rust.rs:2947-2961 | doc/src/codegen/v2/lang_rust.rs:3338-3352 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_rust.rs:2947` it begins part-way through the construct above it, so those exact lines 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) doc/src/codegen/v2/rust/dynamic_binding.rs:415 — doc/src/codegen/v2/rust/dynamic_binding.rs:415-429 | doc/src/codegen/v2/rust/static_binding.rs:504-518 — before extracting anything, compare `doc/src/codegen/v2/rust/dynamic_binding.rs` and `doc/src/codegen/v2/rust/static_binding.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 (15 lines × 2) doc/src/patch/fallback.rs:235 — doc/src/patch/fallback.rs:235-249 | doc/src/patch/index.rs:932-946 — 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 `doc/src/patch/fallback.rs:235` 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) layout/src/callbacks.rs:3841 — layout/src/callbacks.rs:3841-3855 | layout/src/callbacks.rs:6704-6718 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/callbacks.rs:3841` it begins part-way through the construct above it, so those exact lines 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) layout/src/solver3/fc.rs:8816 — layout/src/solver3/fc.rs:8816-8830 | layout/src/solver3/fc.rs:9882-9898 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/fc.rs:8816` it begins part-way through the construct above it, so those 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 lines × 2) layout/src/solver3/fc.rs:8803 — layout/src/solver3/fc.rs:8803-8818 | layout/src/solver3/fc.rs:9313-9327 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/fc.rs:8803` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 2) layout/src/solver3/fc.rs:8834 — layout/src/solver3/fc.rs:8834-8848 | layout/src/solver3/fc.rs:9676-9691 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/fc.rs:9676` it begins part-way through the construct above it, so those 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 lines × 2) layout/src/solver3/paged_layout.rs:842 — layout/src/solver3/paged_layout.rs:842-856 | layout/src/solver3/paged_layout.rs:909-923 — both copies are in the same file, so extract the block into 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) layout/src/text3/edit.rs:815 — layout/src/text3/edit.rs:815-829 | layout/src/text3/edit.rs:948-962 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/text3/edit.rs:815` it begins part-way through the construct above it, so those exact lines 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) layout/src/widgets/date_picker.rs:792 — layout/src/widgets/date_picker.rs:792-806 | layout/src/widgets/time_picker.rs:593-610 — 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 `layout/src/widgets/date_picker.rs:792` 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, `layout/src/widgets/date_picker.rs:808` calls `from`, `month_name` and `layout/src/widgets/time_picker.rs:612` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15 lines × 2) layout/src/widgets/node_graph.rs:3501 — layout/src/widgets/node_graph.rs:3501-3515 | layout/src/widgets/node_graph.rs:3573-3587 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/widgets/node_graph.rs:3501` it does not close everything it opens, so those exact lines 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) webrender/core/src/frame_builder.rs:615 — webrender/core/src/frame_builder.rs:615-629 | webrender/core/src/frame_builder.rs:657-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 `webrender/core/src/frame_builder.rs:615` 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.
  • + 11 more in this group — see findings.md.
D2 · Cognitive Complexity · azul_core · ×34
  • azul_core::compact::apply_css_property_to_compact (cognitive 186) core/src/compact.rs:1305 — azul_core::compact::apply_css_property_to_compact has cognitive complexity 186 (threshold 15). Drivers by points: if/else 83 (175 pts), match/switch 3 (7 pts), boolean chains 4 (nesting depth added 96). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_core::xml::apply_xml_node_attributes (cognitive 97) core/src/xml.rs:5774 — azul_core::xml::apply_xml_node_attributes has cognitive complexity 97 (threshold 15). Drivers by points: if/else 40 (76 pts), boolean chains 7, loops 3 (7 pts), match/switch 3 (7 pts) (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_core::diff::reconcile_dom (cognitive 93) core/src/diff.rs:569 — azul_core::diff::reconcile_dom has cognitive complexity 93 (threshold 15). Drivers by points: if/else 29 (75 pts), loops 10, boolean chains 8 (nesting depth added 46). Of this number, 90 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.
  • azul_core::resources::build_add_font_resource_updates (cognitive 58) core/src/resources.rs:3669 — azul_core::resources::build_add_font_resource_updates has cognitive complexity 58 (threshold 15). Drivers by points: if/else 7 (28 pts), loops 5 (15 pts), match/switch 3 (11 pts), boolean chains 4 (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.
  • azul_core::diff::compute_node_changes (cognitive 49) core/src/diff.rs:175 — azul_core::diff::compute_node_changes has cognitive complexity 49 (threshold 15). Drivers by points: if/else 20 (37 pts), loops 4 (9 pts), boolean chains 2, match/switch 1 (nesting depth added 22). Of this number, 46 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.
  • azul_core::xml::analyze_node_ctor (cognitive 48) core/src/xml.rs:7947 — azul_core::xml::analyze_node_ctor has cognitive complexity 48 (threshold 15). Drivers by points: if/else 29 (45 pts), boolean chains 2, 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.
  • azul_core::compact::update_dom_declared_flags (cognitive 47) core/src/compact.rs:1937 — azul_core::compact::update_dom_declared_flags has cognitive complexity 47 (threshold 15). Drivers by points: if/else 23 (46 pts), match/switch 1 (nesting depth added 23). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • azul_core::path_parser::parse_svg_path_d (cognitive 47) core/src/path_parser.rs:423 — azul_core::path_parser::parse_svg_path_d has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (32 pts), match/switch 3 (9 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_core::styled_dom::is_layout_equivalent (cognitive 41) core/src/styled_dom.rs:3281 — azul_core::styled_dom::is_layout_equivalent has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (33 pts), match/switch 2 (5 pts), loops 2 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_core::events::handle_key_down (cognitive 35) core/src/events.rs:5081 — azul_core::events::handle_key_down has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19 (30 pts), match/switch 2 (5 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.
  • azul_core::style::matches_html_element (cognitive 33) core/src/style.rs:63 — azul_core::style::matches_html_element has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 3 (8 pts), loops 3 (7 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.
  • azul_core::diff::calculate_reconciliation_key (cognitive 32) core/src/diff.rs:361 — azul_core::diff::calculate_reconciliation_key has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (22 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.
  • azul_core::xml::split_dynamic_string (cognitive 32) core/src/xml.rs:6740 — azul_core::xml::split_dynamic_string has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 3 (5 pts), match/switch 1 (2 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.
  • azul_core::db::az_db_merge_callback_thunk (cognitive 31) core/src/db.rs:739 — azul_core::db::az_db_merge_callback_thunk has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (27 pts), match/switch 3 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_core::diff::calculate_contenteditable_key (cognitive 30) core/src/diff.rs:1426 — azul_core::diff::calculate_contenteditable_key has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 5 (7 pts), match/switch 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_core::xml::group_matches (cognitive 30) core/src/xml.rs:7140 — azul_core::xml::group_matches has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (27 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_core::diff::transfer_states (cognitive 26) core/src/diff.rs:1223 — azul_core::diff::transfer_states has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (20 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_core::xml::decode_entities (cognitive 26) core/src/xml.rs:6913 — azul_core::xml::decode_entities has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (20 pts), match/switch 1 (5 pts), loops 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • azul_core::diff::fingerprint_dom (cognitive 25) core/src/diff.rs:2325 — azul_core::diff::fingerprint_dom has cognitive complexity 25 (threshold 15). Drivers by points: loops 10 (15 pts), if/else 4 (5 pts), match/switch 3 (5 pts) (nesting depth added 8). Most of this is not in the body itself: 2 of the 25 points are its own statements and the rest belongs to 3 function items inside it that branch (node_style_hash, node_structure_hash, walk). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • azul_core::style::construct_html_cascade_tree (cognitive 24) core/src/style.rs:351 — azul_core::style::construct_html_cascade_tree has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 4 (9 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.
  • azul_core::ua_css::evaluate_ua_scrollbar_css (cognitive 23) core/src/ua_css.rs:1590 — azul_core::ua_css::evaluate_ua_scrollbar_css has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_core::xml::user_defined_render_fn (cognitive 23) core/src/xml.rs:2993 — azul_core::xml::user_defined_render_fn has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 3 (10 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_core::xml::compile_body_node_to_rust_code (cognitive 22) core/src/xml.rs:7227 — azul_core::xml::compile_body_node_to_rust_code has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (7 pts), match/switch 2 (7 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.
  • azul_core::xml::compile_node_to_rust_code_inner (cognitive 22) core/src/xml.rs:7462 — azul_core::xml::compile_node_to_rust_code_inner has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (5 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.
  • azul_core::prop_cache::clone_inheritable_property (cognitive 21) core/src/prop_cache.rs:1493 — azul_core::prop_cache::clone_inheritable_property has cognitive complexity 21 (threshold 15). Drivers by points: if/else 21. 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.
  • + 9 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×31
  • Edited copy of a member (12 corresponding lines) layout/src/widgets/statusbar.rs:489 — layout/src/widgets/statusbar.rs:489-500 | layout/src/widgets/statusbar.rs:528-540 — 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) doc/src/codegen/v2/lang_d/wrappers.rs:283 — doc/src/codegen/v2/lang_d/wrappers.rs:283-294 | doc/src/codegen/v2/lang_swift/wrappers.rs:246-257 — 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) layout/src/icu_windows.rs:388 — layout/src/icu_windows.rs:388-399 | layout/src/icu_windows.rs:401-412 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_texture_2d.rs:259 — webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_texture_2d.rs:259-272 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_texture_2d.rs:318-329 — 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) layout/src/solver3/display_list.rs:292 — layout/src/solver3/display_list.rs:292-311 | layout/src/solver3/display_list.rs:321-332 — 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) css/src/props/basic/angle.rs:281 — css/src/props/basic/angle.rs:281-292 | css/src/props/basic/pixel.rs:861-872 — 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) core/src/prop_cache.rs:4347 — core/src/prop_cache.rs:4347-4358 | core/src/prop_cache.rs:4402-4413 — 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) layout/src/widgets/list_view.rs:1148 — layout/src/widgets/list_view.rs:1148-1159 | layout/src/widgets/list_view.rs:1162-1173 — 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) webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs:329 — webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs:329-342 | webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs:315-326 — 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) core/src/xml.rs:5382 — core/src/xml.rs:5382-5393 | core/src/xml.rs:5398-5410 — 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) doc/src/mobile/toolchain.rs:331 — doc/src/mobile/toolchain.rs:331-342 | doc/src/mobile/toolchain.rs:345-356 — 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) webrender/core/src/picture_textures.rs:48 — webrender/core/src/picture_textures.rs:48-59 | webrender/core/src/texture_cache.rs:142-153 — 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) webrender/swgl/src/shaders/cs_clip_box_shadow_texture_2d.rs:283 — webrender/swgl/src/shaders/cs_clip_box_shadow_texture_2d.rs:283-294 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_glyph_transform_texture_2d.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) dll/src/web/html_render.rs:1062 — dll/src/web/html_render.rs:1062-1073 | dll/src/web/html_render.rs:1075-1087 — 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) doc/src/codegen/v2/lang_haskell/mod.rs:1188 — doc/src/codegen/v2/lang_haskell/mod.rs:1188-1199 | doc/src/codegen/v2/lang_haskell/mod.rs:1230-1241 — 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) dll/src/desktop/shell2/linux/x11/mod.rs:4192 — dll/src/desktop/shell2/linux/x11/mod.rs:4192-4208 | dll/src/desktop/shell2/windows/mod.rs:7616-7627 — 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) doc/src/codegen/v2/lang_haskell/mod.rs:1201 — doc/src/codegen/v2/lang_haskell/mod.rs:1201-1215 | doc/src/codegen/v2/lang_haskell/mod.rs:1217-1228 — 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) core/src/resources.rs:1473 — core/src/resources.rs:1473-1484 | core/src/resources.rs:1486-1498 — 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) css/src/props/layout/flex.rs:130 — css/src/props/layout/flex.rs:130-141 | css/src/props/layout/flex.rs:241-252 — 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) dll/src/web/native_remill.rs:385 — dll/src/web/native_remill.rs:385-396 | dll/src/web/native_remill.rs:398-409 — 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) webrender/core/src/prim_store/gradient/conic.rs:367 — webrender/core/src/prim_store/gradient/conic.rs:367-378 | webrender/core/src/prim_store/gradient/radial.rs:333-344 — 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) dll/src/desktop/shell2/ios/clipboard.rs:43 — dll/src/desktop/shell2/ios/clipboard.rs:43-56 | dll/src/desktop/shell2/ios/mod.rs:2510-2521 — 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) doc/src/codegen/v2/lang_csharp/mod.rs:111 — doc/src/codegen/v2/lang_csharp/mod.rs:111-128 | doc/src/codegen/v2/lang_kotlin/mod.rs:120-131 — 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) dll/src/desktop/shell2/macos/clipboard.rs:204 — dll/src/desktop/shell2/macos/clipboard.rs:204-215 | dll/src/desktop/shell2/windows/clipboard.rs:183-194 — 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) dll/src/desktop/shell2/macos/mod.rs:8466 — dll/src/desktop/shell2/macos/mod.rs:8466-8477 | dll/src/desktop/shell2/windows/registry.rs:119-130 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • + 6 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×31
  • Duplicated block (16 lines × 2) core/src/resources.rs:2809 — core/src/resources.rs:2809-2824 | core/src/resources.rs:2960-2975 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/resources.rs:2809` 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) dll/src/desktop/shell2/common/debug_server/platform.rs:394 — dll/src/desktop/shell2/common/debug_server/platform.rs:394-409 | dll/src/desktop/shell2/common/debug_server/platform.rs:427-442 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/common/debug_server/platform.rs:394` 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) dll/src/desktop/shell2/common/event.rs:686 — dll/src/desktop/shell2/common/event.rs:686-701 | dll/src/desktop/shell2/common/event.rs:996-1011 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/common/event.rs:686` 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) dll/src/desktop/shell2/common/event.rs:3916 — dll/src/desktop/shell2/common/event.rs:3916-3931 | dll/src/desktop/shell2/common/event.rs:4858-4873 — both copies are in the same file, so extract the block into 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) dll/src/desktop/shell2/linux/wayland/mod.rs:10985 — dll/src/desktop/shell2/linux/wayland/mod.rs:10985-11000 | dll/src/desktop/shell2/linux/x11/mod.rs:8739-8754 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:10985` it begins part-way through the construct above it, so those exact lines 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) dll/src/desktop/shell2/linux/wayland/screencopy.rs:97 — dll/src/desktop/shell2/linux/wayland/screencopy.rs:97-112 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:135-155 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/screencopy.rs:97` it does not close everything it opens, so those exact lines 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) dll/src/desktop/shell2/linux/x11/mod.rs:3702 — dll/src/desktop/shell2/linux/x11/mod.rs:3702-3717 | dll/src/desktop/shell2/linux/x11/mod.rs:3755-3770 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/x11/mod.rs:3702` 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) dll/src/desktop/shell2/macos/mod.rs:5690 — dll/src/desktop/shell2/macos/mod.rs:5690-5705 | dll/src/desktop/shell2/windows/mod.rs:774-789 — `dll/src/desktop/shell2/macos/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 13 separate duplicated blocks between them, totalling at least 196 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (16 lines × 2) dll/src/desktop/wr_translate2.rs:2287 — dll/src/desktop/wr_translate2.rs:2287-2302 | dll/src/desktop/wr_translate2.rs:2303-2318 — both copies are in the same file, so extract the block into 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) doc/src/autofix/mod.rs:2168 — doc/src/autofix/mod.rs:2168-2183 | doc/src/autofix/mod.rs:2310-2325 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/mod.rs:2168` it begins part-way through the construct above it, so those exact lines 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) doc/src/autofix/type_index.rs:387 — doc/src/autofix/type_index.rs:387-402 | doc/src/autofix/type_index.rs:458-473 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/type_index.rs:387` 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) doc/src/codegen/v2/lang_cobol/types.rs:174 — doc/src/codegen/v2/lang_cobol/types.rs:174-189 | doc/src/codegen/v2/lang_pascal/types.rs:108-123 — `doc/src/codegen/v2/lang_cobol/types.rs` and `doc/src/codegen/v2/lang_pascal/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 49 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_cobol/types.rs:174` it begins part-way through the construct above it, so those 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 (16 lines × 2) doc/src/codegen/v2/lang_haskell/types.rs:735 — doc/src/codegen/v2/lang_haskell/types.rs:735-750 | doc/src/codegen/v2/lang_haskell/types.rs:1014-1029 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_haskell/types.rs:735` it begins part-way through the construct above it, so those exact lines 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) doc/src/codegen/v2/lang_odin/types.rs:233 — doc/src/codegen/v2/lang_odin/types.rs:233-248 | doc/src/codegen/v2/lang_v/types.rs:241-256 — `doc/src/codegen/v2/lang_odin/types.rs` and `doc/src/codegen/v2/lang_v/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 16 separate duplicated blocks between them, totalling at least 175 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (16 lines × 2) doc/src/codegen/v2/lang_pascal/mod.rs:322 — doc/src/codegen/v2/lang_pascal/mod.rs:322-337 | doc/src/codegen/v2/lang_pascal/types.rs:563-578 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (16 lines × 2) doc/src/codegen/v2/lang_rust.rs:3787 — doc/src/codegen/v2/lang_rust.rs:3787-3802 | doc/src/codegen/v2/lang_rust.rs:3875-3890 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_rust.rs:3787` it begins part-way through the construct above it, so those exact lines 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) doc/src/docgen/guide.rs:716 — doc/src/docgen/guide.rs:716-731 | doc/src/lint_links.rs:256-271 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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 (16 lines × 2) layout/src/cpurender/compositor.rs:1669 — layout/src/cpurender/compositor.rs:1669-1684 | layout/src/cpurender/compositor.rs:1750-1765 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/cpurender/compositor.rs:1669` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) layout/src/solver3/paged_layout.rs:497 — layout/src/solver3/paged_layout.rs:497-512 | layout/src/solver3/paged_layout.rs:565-580 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) webrender/core/src/batch.rs:1429 — webrender/core/src/batch.rs:1429-1444 | webrender/core/src/batch.rs:2326-2341 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) webrender/core/src/quad.rs:152 — webrender/core/src/quad.rs:152-167 | webrender/core/src/quad.rs:207-222 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) webrender/swgl/src/shaders/brush_linear_gradient.rs:293 — webrender/swgl/src/shaders/brush_linear_gradient.rs:293-308 | webrender/swgl/src/shaders/brush_linear_gradient_alpha_pass.rs:309-324 — before extracting anything, compare `webrender/swgl/src/shaders/brush_linear_gradient.rs` and `webrender/swgl/src/shaders/brush_linear_gradient_alpha_pass.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 218 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (16 lines × 2) dll/src/desktop/extra/file_picker/ios.rs:378 — dll/src/desktop/extra/file_picker/ios.rs:378-393 | dll/src/desktop/extra/file_picker/ios.rs:475-490 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/extra/file_picker/ios.rs:378` 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) webrender/swgl/src/shaders/ps_quad_mask.rs:231 — webrender/swgl/src/shaders/ps_quad_mask.rs:231-246 | webrender/swgl/src/shaders/ps_quad_textured.rs:214-229 — before extracting anything, compare `webrender/swgl/src/shaders/ps_quad_mask.rs` and `webrender/swgl/src/shaders/ps_quad_textured.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 107 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (16 lines × 2) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:199 — webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:199-214 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:199-214 — before extracting anything, compare `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs` and `webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 288 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:199` 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.
  • + 6 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×29
  • Edited copy of a member (15 corresponding lines) layout/src/widgets/themes/flora.rs:789 — layout/src/widgets/themes/flora.rs:789-957 | layout/src/widgets/themes/flora.rs:1037-1185 — 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) layout/src/widgets/themes/flora.rs:789 — layout/src/widgets/themes/flora.rs:789-957 | layout/src/widgets/themes/flora.rs:1876-2007 — 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) webrender/swgl/src/shaders/cs_clip_rectangle.rs:393 — webrender/swgl/src/shaders/cs_clip_rectangle.rs:393-407 | webrender/swgl/src/shaders/ps_quad_mask.rs:428-446 — 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) layout/src/text3/dense.rs:870 — layout/src/text3/dense.rs:870-884 | layout/src/window.rs:10187-10201 — 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) dll/src/desktop/extra/audio/alsa.rs:32 — dll/src/desktop/extra/audio/alsa.rs:32-48 | dll/src/desktop/extra/camera/v4l2.rs:40-54 — 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) dll/src/desktop/extra/sqlite/mod.rs:1282 — dll/src/desktop/extra/sqlite/mod.rs:1282-1296 | dll/src/desktop/extra/sqlite/mod.rs:1304-1326 — 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) dll/src/desktop/extra/media_keys/apple.rs:124 — dll/src/desktop/extra/media_keys/apple.rs:124-146 | dll/src/desktop/extra/media_keys/apple.rs:572-586 — 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) dll/src/desktop/extra/sqlite/mod.rs:1489 — dll/src/desktop/extra/sqlite/mod.rs:1489-1503 | layout/src/journal.rs:141-158 — 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) layout/src/solver3/cache.rs:291 — layout/src/solver3/cache.rs:291-317 | layout/src/solver3/cache.rs:327-341 — 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) dll/src/desktop/native_screenshot.rs:11 — dll/src/desktop/native_screenshot.rs:11-25 | layout/src/cpurender/pixmap.rs:882-896 — 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) webrender/core/src/scene_builder_thread.rs:418 — webrender/core/src/scene_builder_thread.rs:418-433 | webrender/core/src/scene_builder_thread.rs:496-510 — 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) layout/src/font.rs:2488 — layout/src/font.rs:2488-2502 | layout/src/text3/default.rs:362-379 — 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) doc/src/codegen/v2/lang_racket/wrappers.rs:88 — doc/src/codegen/v2/lang_racket/wrappers.rs:88-102 | doc/src/codegen/v2/lang_racket/wrappers.rs:104-119 — 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) core/src/resources.rs:1447 — core/src/resources.rs:1447-1462 | core/src/resources.rs:3175-3189 — 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) css/src/props/style/filter.rs:854 — css/src/props/style/filter.rs:854-868 | css/src/props/style/transform.rs:1060-1074 — 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) webrender/core/src/device/gl.rs:4494 — webrender/core/src/device/gl.rs:4494-4508 | webrender/core/src/device/gl.rs:4527-4543 — 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) core/src/path_parser.rs:248 — core/src/path_parser.rs:248-262 | core/src/path_parser.rs:268-282 — 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) dll/src/desktop/menu.rs:299 — dll/src/desktop/menu.rs:299-316 | dll/src/desktop/menu.rs:324-338 — 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) dll/src/web/transpiler_remill.rs:5522 — dll/src/web/transpiler_remill.rs:5522-5536 | dll/src/web/transpiler_remill.rs:5540-5558 — 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) dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:277 — dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:277-291 | dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:475-491 — 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) layout/src/request.rs:129 — layout/src/request.rs:129-148 | layout/src/request.rs:153-167 — 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) layout/src/font.rs:1622 — layout/src/font.rs:1622-1636 | layout/src/font.rs:1641-1655 — 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) dll/src/desktop/extra/biometric/android.rs:77 — dll/src/desktop/extra/biometric/android.rs:77-96 | dll/src/desktop/extra/sensors/android.rs:30-44 — 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) dll/src/desktop/shell2/linux/system_style.rs:1173 — dll/src/desktop/shell2/linux/system_style.rs:1173-1187 | dll/src/desktop/shell2/linux/system_style.rs:1197-1211 — 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) dll/src/desktop/shell2/linux/gnome_menu/manager.rs:225 — dll/src/desktop/shell2/linux/gnome_menu/manager.rs:225-240 | dll/src/desktop/shell2/linux/gnome_menu/manager.rs:245-259 — 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.
  • + 4 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×29
  • Duplicated block (6 lines × 3) core/src/diff.rs:375 — core/src/diff.rs:375-381 | core/src/diff.rs:713-718 | core/src/diff.rs:1440-1446 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/diff.rs:375` it does not close everything it opens, so those exact lines 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) css/src/system.rs:808 — css/src/system.rs:808-813 | css/src/system.rs:862-867 | css/src/system.rs:925-930 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `css/src/system.rs:808` 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) dll/src/desktop/shell2/linux/x11/mod.rs:8360 — dll/src/desktop/shell2/linux/x11/mod.rs:8360-8365 | dll/src/desktop/shell2/linux/x11/mod.rs:8389-8394 | dll/src/desktop/shell2/linux/x11/mod.rs:8520-8525 — all 3 copies are in the same file, so extract the block into one function there and call 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) doc/src/codegen/v2/lang_csharp/wrappers.rs:87 — doc/src/codegen/v2/lang_csharp/wrappers.rs:87-92 | doc/src/codegen/v2/lang_java/wrappers.rs:1245-1250 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:84-89 — `doc/src/codegen/v2/lang_csharp/wrappers.rs` and `doc/src/codegen/v2/lang_java/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 167 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_csharp/wrappers.rs:87` 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) doc/src/codegen/v2/lang_fortran/types.rs:485 — doc/src/codegen/v2/lang_fortran/types.rs:485-490 | doc/src/codegen/v2/lang_fortran/types.rs:530-535 | doc/src/codegen/v2/lang_fortran/types.rs:817-822 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_fortran/types.rs:485` it begins part-way through the construct above it, so those exact lines 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) doc/src/codegen/v2/lang_java/types.rs:526 — doc/src/codegen/v2/lang_java/types.rs:526-531 | doc/src/codegen/v2/lang_lisp/types.rs:253-260 | doc/src/codegen/v2/lang_smalltalk/types.rs:197-202 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_java/types.rs:526` it does not close everything it opens, so those 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, `doc/src/codegen/v2/lang_java/types.rs:533` calls `push`, `to_string` and `doc/src/codegen/v2/lang_lisp/types.rs:262` 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 × 3) layout/src/managers/a11y.rs:624 — layout/src/managers/a11y.rs:624-630 | layout/src/managers/a11y_snapshot.rs:478-483 | layout/src/window.rs:12379-12385 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/managers/a11y.rs:624` it does not close everything it opens, so those 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, `layout/src/managers/a11y.rs:630` calls `push_str`, `as_str` and `layout/src/window.rs:12385` 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 × 3) layout/src/window.rs:3327 — layout/src/window.rs:3327-3340 | layout/src/window.rs:3353-3361 | layout/src/window.rs:3377-3382 — all 3 copies are in the same file, so extract the block into one function there and call 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) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:437 — webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:437-442 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:409-414 | webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:393-398 — before extracting anything, compare `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs` and `webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 326 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:437` it begins part-way through the construct above it, so those exact lines 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) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:120 — webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:120-132 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:120-125 | webrender/swgl/src/shaders/brush_image_texture_2d.rs:103-108 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs` and `webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 328 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:120` it does not close everything it opens, so those 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) css/src/system.rs:2538 — css/src/system.rs:2538-2543 | css/src/system.rs:2589-2594 | css/src/system.rs:2639-2644 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `css/src/system.rs:2538` it begins part-way through the construct above it, so those exact lines 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) dll/src/desktop/shell2/linux/x11/events.rs:1541 — dll/src/desktop/shell2/linux/x11/events.rs:1541-1546 | dll/src/desktop/shell2/linux/x11/mod.rs:8028-8033 | dll/src/desktop/shell2/windows/mod.rs:7582-7587 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/events.rs` and `dll/src/desktop/shell2/windows/mod.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 100 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 first that the copies are not typed on the same thing: the declarations holding them bind `position` to `LogicalPosition` in one and `azul_core::geom::LogicalPosition` 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) layout/src/widgets/backstage.rs:355 — layout/src/widgets/backstage.rs:355-360 | layout/src/widgets/ribbon.rs:997-1002 | layout/src/widgets/ribbon.rs:1179-1184 — before extracting anything, compare `layout/src/widgets/backstage.rs` and `layout/src/widgets/ribbon.rs` as WHOLE FILES: this scan already matched 7 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. If that is what happened, the fix is to keep one copy and have the 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, `layout/src/widgets/ribbon.rs:1004` calls `simple`, `const_height`, `const_px` and `layout/src/widgets/ribbon.rs:1186` 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 × 3) webrender/swgl/src/shaders/ps_quad_mask.rs:189 — webrender/swgl/src/shaders/ps_quad_mask.rs:189-194 | webrender/swgl/src/shaders/ps_quad_mask_fast_path.rs:277-282 | webrender/swgl/src/shaders/ps_quad_textured.rs:168-173 — before extracting anything, compare `webrender/swgl/src/shaders/ps_quad_mask.rs` and `webrender/swgl/src/shaders/ps_quad_mask_fast_path.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (6 lines × 3) dll/src/desktop/extra/keyring/apple.rs:35 — dll/src/desktop/extra/keyring/apple.rs:35-40 | dll/src/desktop/extra/keyring/linux.rs:177-182 | dll/src/desktop/extra/keyring/windows.rs:35-40 — 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) dll/src/desktop/shell2/android/mod.rs:596 — dll/src/desktop/shell2/android/mod.rs:596-601 | dll/src/desktop/shell2/ios/mod.rs:2044-2049 | dll/src/desktop/shell2/linux/wayland/mod.rs:10097-10102 — `dll/src/desktop/shell2/android/mod.rs` and `dll/src/desktop/shell2/ios/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 17 separate duplicated blocks between them, totalling at least 242 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (6 lines × 3) doc/src/codegen/v2/lang_crystal/model.rs:392 — doc/src/codegen/v2/lang_crystal/model.rs:392-397 | doc/src/codegen/v2/lang_d/model.rs:564-569 | doc/src/codegen/v2/lang_swift/model.rs:579-584 — `doc/src/codegen/v2/lang_crystal/model.rs` and `doc/src/codegen/v2/lang_d/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 88 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (6 lines × 3) doc/src/codegen/v2/lang_kotlin/wrappers.rs:1139 — doc/src/codegen/v2/lang_kotlin/wrappers.rs:1139-1144 | doc/src/codegen/v2/lang_node/wrappers.rs:1865-1870 | doc/src/codegen/v2/lang_ruby/wrappers.rs:1443-1448 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (6 lines × 3) doc/src/codegen/v2/lang_lua/wrappers.rs:161 — doc/src/codegen/v2/lang_lua/wrappers.rs:161-166 | doc/src/codegen/v2/lang_node/types.rs:317-322 | doc/src/codegen/v2/lang_node/wrappers.rs:377-382 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (6 lines × 3) layout/src/managers/biometric.rs:185 — layout/src/managers/biometric.rs:185-190 | layout/src/managers/eyedropper.rs:189-194 | layout/src/managers/keyring.rs:150-155 — before extracting anything, compare `layout/src/managers/biometric.rs` and `layout/src/managers/keyring.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `result` to `BiometricResult` in one and `EyedropperResult` 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) layout/src/managers/biometric.rs:219 — layout/src/managers/biometric.rs:219-224 | layout/src/managers/eyedropper.rs:172-177 | layout/src/managers/keyring.rs:119-124 — before extracting anything, compare `layout/src/managers/biometric.rs` and `layout/src/managers/keyring.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `request` to `EyedropperRequest` in one and `KeyringRequest` 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) layout/src/managers/biometric.rs:229 — layout/src/managers/biometric.rs:229-234 | layout/src/managers/eyedropper.rs:180-185 | layout/src/managers/keyring.rs:128-133 — before extracting anything, compare `layout/src/managers/biometric.rs` and `layout/src/managers/keyring.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 3) webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:404 — webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:404-409 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs:299-304 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_texture_2d.rs:237-242 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs` and `webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 3) webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:415 — webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:415-420 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs:310-315 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_texture_2d.rs:248-253 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs` and `webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 3) webrender/swgl/src/shaders/ps_quad_mask.rs:223 — webrender/swgl/src/shaders/ps_quad_mask.rs:223-228 | webrender/swgl/src/shaders/ps_quad_mask_fast_path.rs:292-297 | webrender/swgl/src/shaders/ps_quad_textured.rs:206-211 — before extracting anything, compare `webrender/swgl/src/shaders/ps_quad_mask.rs` and `webrender/swgl/src/shaders/ps_quad_mask_fast_path.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `scale_offset` to `vec4` in one and `Vec4` 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.
  • + 4 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×28
  • Edited copy of a member (9 corresponding lines) webrender/swgl/src/shaders/cs_clip_rectangle.rs:241 — webrender/swgl/src/shaders/cs_clip_rectangle.rs:241-249 | webrender/swgl/src/shaders/cs_clip_rectangle_fast_path.rs:212-220 — 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) webrender/swgl/src/shaders/composite_texture_2d.rs:31 — webrender/swgl/src/shaders/composite_texture_2d.rs:31-39 | webrender/swgl/src/shaders/composite_texture_rect.rs:34-42 — 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) webrender/swgl/src/shaders/brush_mix_blend.rs:90 — webrender/swgl/src/shaders/brush_mix_blend.rs:90-102 | webrender/swgl/src/shaders/brush_mix_blend_alpha_pass.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) webrender/swgl/src/shaders/composite_fast_path_texture_2d.rs:39 — webrender/swgl/src/shaders/composite_fast_path_texture_2d.rs:39-47 | webrender/swgl/src/shaders/composite_texture_2d.rs:41-50 — 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) layout/src/text3/cache.rs:3217 — layout/src/text3/cache.rs:3217-3225 | layout/src/text3/cache.rs:3713-3727 — 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) core/src/xml.rs:8200 — core/src/xml.rs:8200-8208 | core/src/xml.rs:8209-8217 — 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) layout/src/json.rs:378 — layout/src/json.rs:378-386 | layout/src/json.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) core/src/xml.rs:8191 — core/src/xml.rs:8191-8199 | core/src/xml.rs:8218-8226 — 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) doc/src/patch/parser.rs:513 — doc/src/patch/parser.rs:513-521 | doc/src/patch/parser.rs:563-577 — 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) layout/src/widgets/text_area.rs:612 — layout/src/widgets/text_area.rs:612-620 | layout/src/widgets/text_input.rs:962-970 — 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) webrender/swgl/src/shaders/brush_mix_blend.rs:442 — webrender/swgl/src/shaders/brush_mix_blend.rs:442-450 | webrender/swgl/src/shaders/brush_mix_blend_alpha_pass.rs:352-361 — 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) webrender/core/src/util.rs:222 — webrender/core/src/util.rs:222-230 | webrender/core/src/util.rs:236-244 — 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) webrender/glyph/src/lib.rs:194 — webrender/glyph/src/lib.rs:194-202 | webrender/glyph/src/lib.rs:360-368 — 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) dll/src/desktop/extra/gamepad/apple.rs:687 — dll/src/desktop/extra/gamepad/apple.rs:687-700 | dll/src/desktop/extra/gamepad/apple.rs:706-714 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:1608 — dll/src/desktop/shell2/linux/wayland/mod.rs:1608-1616 | dll/src/desktop/shell2/linux/x11/mod.rs:7869-7877 — 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) layout/src/widgets/backstage.rs:416 — layout/src/widgets/backstage.rs:416-424 | layout/src/widgets/backstage.rs:426-434 — 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) dll/src/desktop/extra/map/mod.rs:260 — dll/src/desktop/extra/map/mod.rs:260-273 | dll/src/desktop/extra/video_codec/stream.rs:34-42 — 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) doc/src/patch/fallback.rs:90 — doc/src/patch/fallback.rs:90-98 | doc/src/patch/fallback.rs:101-109 — 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) dll/src/desktop/shell2/android/mod.rs:312 — dll/src/desktop/shell2/android/mod.rs:312-323 | dll/src/desktop/shell2/ios/mod.rs:1877-1885 — 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) doc/src/codegen/v2/lang_d/wrappers.rs:2332 — doc/src/codegen/v2/lang_d/wrappers.rs:2332-2340 | doc/src/codegen/v2/lang_swift/wrappers.rs:2309-2317 — 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) layout/src/managers/gesture.rs:2270 — layout/src/managers/gesture.rs:2270-2278 | layout/src/managers/gesture.rs:2292-2300 — 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) layout/src/window.rs:19115 — layout/src/window.rs:19115-19123 | dll/src/desktop/wr_translate2.rs:608-616 — 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) webrender/core/src/render_task.rs:141 — webrender/core/src/render_task.rs:141-149 | webrender/core/src/render_task.rs:2913-2921 — 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) doc/src/codegen/v2/lang_csharp/managed.rs:106 — doc/src/codegen/v2/lang_csharp/managed.rs:106-117 | doc/src/codegen/v2/lang_zig/boundary.rs:103-111 — 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) doc/src/codegen/v2/lang_kotlin/wrappers.rs:767 — doc/src/codegen/v2/lang_kotlin/wrappers.rs:767-775 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:778-786 — 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.
  • + 3 more in this group — see findings.md.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×26
  • Edited copy of a member (10 corresponding lines) layout/src/widgets/statusbar.rs:503 — layout/src/widgets/statusbar.rs:503-512 | layout/src/widgets/statusbar.rs:515-524 — 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) core/src/prop_cache.rs:3255 — core/src/prop_cache.rs:3255-3264 | core/src/prop_cache.rs:3272-3286 — 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) dll/src/desktop/shell2/linux/wayland/events.rs:1696 — dll/src/desktop/shell2/linux/wayland/events.rs:1696-1705 | dll/src/desktop/shell2/linux/wayland/events.rs:1714-1723 — 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) doc/src/codegen/v2/lang_crystal/wrappers.rs:255 — doc/src/codegen/v2/lang_crystal/wrappers.rs:255-267 | doc/src/codegen/v2/lang_d/wrappers.rs:297-306 — 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) doc/src/patch/index.rs:1065 — doc/src/patch/index.rs:1065-1076 | doc/src/patch/index.rs:1079-1088 — 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) webrender/swgl/src/shaders/cs_clip_rectangle.rs:425 — webrender/swgl/src/shaders/cs_clip_rectangle.rs:425-434 | webrender/swgl/src/shaders/cs_clip_rectangle_fast_path.rs:385-394 — 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) dll/src/web/transpiler_remill.rs:5903 — dll/src/web/transpiler_remill.rs:5903-5918 | dll/src/web/transpiler_remill.rs:5925-5934 — 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) dll/src/desktop/shell2/linux/wayland/events.rs:1356 — dll/src/desktop/shell2/linux/wayland/events.rs:1356-1367 | dll/src/desktop/shell2/linux/wayland/events.rs:1389-1398 — 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) doc/src/autofix/function_diff.rs:1023 — doc/src/autofix/function_diff.rs:1023-1032 | doc/src/autofix/function_diff.rs:1035-1044 — 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) layout/src/widgets/backstage.rs:1076 — layout/src/widgets/backstage.rs:1076-1085 | layout/src/widgets/statusbar.rs:1754-1763 — 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) webrender/swgl/src/shaders/ps_quad_mask.rs:291 — webrender/swgl/src/shaders/ps_quad_mask.rs:291-301 | webrender/swgl/src/shaders/ps_quad_mask_fast_path.rs:232-241 — 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) layout/src/fluent.rs:358 — layout/src/fluent.rs:358-367 | layout/src/icu.rs:1268-1290 — 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) dll/src/desktop/shell2/ios/mod.rs:2162 — dll/src/desktop/shell2/ios/mod.rs:2162-2173 | dll/src/desktop/shell2/ios/mod.rs:2712-2721 — 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) dll/src/desktop/shell2/macos/mod.rs:8925 — dll/src/desktop/shell2/macos/mod.rs:8925-8934 | dll/src/desktop/shell2/macos/mod.rs:8937-8946 — 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) doc/src/gene2e.rs:1096 — doc/src/gene2e.rs:1096-1105 | doc/src/gene2e.rs:2548-2581 — 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) core/src/animation.rs:391 — core/src/animation.rs:391-400 | core/src/animation.rs:417-426 — 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) doc/src/codegen/v2/lang_csharp/wrappers.rs:469 — doc/src/codegen/v2/lang_csharp/wrappers.rs:469-487 | doc/src/codegen/v2/lang_csharp/wrappers.rs:492-501 — 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) doc/src/codegen/v2/lang_d/wrappers.rs:128 — doc/src/codegen/v2/lang_d/wrappers.rs:128-137 | doc/src/codegen/v2/lang_swift/wrappers.rs:3832-3841 — 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) core/src/gl.rs:4444 — core/src/gl.rs:4444-4453 | core/src/gl.rs:4457-4466 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:521 — dll/src/desktop/shell2/linux/wayland/mod.rs:521-530 | dll/src/desktop/shell2/linux/wayland/mod.rs:5614-5623 — 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) layout/src/widgets/microphone.rs:321 — layout/src/widgets/microphone.rs:321-330 | layout/src/widgets/slider.rs:599-614 — 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) dll/src/desktop/extra/media_keys/apple.rs:555 — dll/src/desktop/extra/media_keys/apple.rs:555-569 | dll/src/desktop/extra/gamepad/apple.rs:455-464 — 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) dll/src/desktop/extra/iroh/mod.rs:40 — dll/src/desktop/extra/iroh/mod.rs:40-49 | layout/src/desktop/dialogs.rs:1084-1094 — 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) doc/src/codegen/v2/lang_perl/types.rs:463 — doc/src/codegen/v2/lang_perl/types.rs:463-472 | doc/src/codegen/v2/lang_ruby/types.rs:743-752 — 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) dll/src/desktop/shell2/macos/registry.rs:82 — dll/src/desktop/shell2/macos/registry.rs:82-91 | dll/src/desktop/shell2/windows/registry.rs:93-102 — 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.
  • + 1 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×26
  • Duplicated block (17 lines × 2) css/src/system.rs:1792 — css/src/system.rs:1792-1808 | dll/src/desktop/menu_renderer.rs:647-663 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (17 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:4398 — dll/src/desktop/shell2/linux/wayland/mod.rs:4398-4414 | dll/src/desktop/shell2/macos/events.rs:370-386 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/macos/events.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 142 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, `dll/src/desktop/shell2/macos/events.rs:389` calls `current_window_state`, `feed_tablet_pen` and `dll/src/desktop/shell2/linux/wayland/mod.rs:4418` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (17 lines × 2) dll/src/desktop/shell2/macos/mod.rs:5602 — dll/src/desktop/shell2/macos/mod.rs:5602-5618 | dll/src/desktop/shell2/windows/mod.rs:638-654 — `dll/src/desktop/shell2/macos/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 13 separate duplicated blocks between them, totalling at least 196 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/macos/mod.rs:5602` it begins part-way through the construct above it, so those exact lines 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) dll/src/desktop/tray/linux.rs:423 — dll/src/desktop/tray/linux.rs:423-439 | dll/src/desktop/tray/linux.rs:783-799 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/tray/linux.rs:423` it does not close everything it opens, so those exact lines 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) dll/src/web/transpiler_remill.rs:2893 — dll/src/web/transpiler_remill.rs:2893-2909 | dll/src/web/transpiler_remill.rs:3823-3839 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2) doc/src/autofix/mod.rs:1986 — doc/src/autofix/mod.rs:1986-2002 | doc/src/autofix/mod.rs:2109-2125 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/mod.rs:1986` it begins part-way through the construct above it, so those exact lines 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) doc/src/autofix/patch_format.rs:754 — doc/src/autofix/patch_format.rs:754-771 | doc/src/autofix/patch_format.rs:894-910 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/patch_format.rs:754` it begins part-way through the construct above it, so those exact lines 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) doc/src/autofix/patch_format.rs:775 — doc/src/autofix/patch_format.rs:775-791 | doc/src/autofix/patch_format.rs:914-930 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/patch_format.rs:775` it begins part-way through the construct above it, so those exact lines 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) doc/src/codegen/v2/lang_cpp/common.rs:1443 — doc/src/codegen/v2/lang_cpp/common.rs:1443-1459 | doc/src/codegen/v2/lang_cpp/common.rs:1485-1501 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_cpp/common.rs:1443` it does not close everything it opens, so those exact lines 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) doc/src/codegen/v2/lang_freebasic/mod.rs:191 — doc/src/codegen/v2/lang_freebasic/mod.rs:191-207 | doc/src/codegen/v2/lang_freebasic/types.rs:414-430 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) doc/src/codegen/v2/lang_java/derives.rs:452 — doc/src/codegen/v2/lang_java/derives.rs:452-468 | doc/src/codegen/v2/lang_java/derives.rs:596-612 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_java/derives.rs:452` 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) doc/src/codegen/v2/lang_lisp/wrappers.rs:78 — doc/src/codegen/v2/lang_lisp/wrappers.rs:78-94 | doc/src/codegen/v2/lang_smalltalk/wrappers.rs:76-92 — 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) doc/src/patch/mod.rs:147 — doc/src/patch/mod.rs:147-163 | doc/src/patch/mod.rs:182-198 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2) layout/src/cpurender/pixmap.rs:282 — layout/src/cpurender/pixmap.rs:282-298 | layout/src/cpurender/pixmap.rs:463-479 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/cpurender/pixmap.rs:282` it does not close everything it opens, so those exact lines 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) layout/src/solver3/sizing.rs:2570 — layout/src/solver3/sizing.rs:2570-2586 | layout/src/solver3/sizing.rs:2750-2766 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/sizing.rs:2570` it does not close everything it opens, so those exact lines 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) layout/src/widgets/themes/flat.rs:680 — layout/src/widgets/themes/flat.rs:680-696 | layout/src/widgets/themes/flora.rs:938-957 — before extracting anything, compare `layout/src/widgets/themes/flat.rs` and `layout/src/widgets/themes/flora.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 927 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `layout/src/widgets/themes/flat.rs:680` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) layout/src/window.rs:2819 — layout/src/window.rs:2819-2835 | layout/src/window.rs:4121-4137 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/window.rs:2819` it does not close everything it opens, so those exact lines 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) layout/src/xml/svg.rs:393 — layout/src/xml/svg.rs:393-409 | layout/src/xml/svg.rs:465-481 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/xml/svg.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.
  • Duplicated block (17 lines × 2) webrender/core/src/picture.rs:6192 — webrender/core/src/picture.rs:6192-6210 | webrender/core/src/picture.rs:6378-6394 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/core/src/picture.rs:6192` it begins part-way through the construct above it, so those exact lines 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) webrender/core/src/render_task.rs:1895 — webrender/core/src/render_task.rs:1895-1911 | webrender/core/src/render_task.rs:2025-2041 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/core/src/render_task.rs:2025` 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) doc/src/codegen/v2/lang_d/wrappers.rs:1758 — doc/src/codegen/v2/lang_d/wrappers.rs:1758-1774 | doc/src/codegen/v2/lang_swift/wrappers.rs:1734-1750 — `doc/src/codegen/v2/lang_d/wrappers.rs` and `doc/src/codegen/v2/lang_swift/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 27 separate duplicated blocks between them, totalling at least 281 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_d/wrappers.rs:1758` it begins part-way through the construct above it, so those exact lines 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) webrender/core/src/prim_store/gradient/conic.rs:148 — webrender/core/src/prim_store/gradient/conic.rs:148-164 | webrender/core/src/prim_store/gradient/radial.rs:151-167 — before extracting anything, compare `webrender/core/src/prim_store/gradient/conic.rs` and `webrender/core/src/prim_store/gradient/radial.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 97 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `item` to `ConicGradientKey` in one and `RadialGradientKey` 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 (17 lines × 2) dll/src/desktop/shell2/linux/wayland/events.rs:2595 — dll/src/desktop/shell2/linux/wayland/events.rs:2595-2611 | dll/src/desktop/shell2/linux/x11/mod.rs:1532-1548 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/events.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 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 `dll/src/desktop/shell2/linux/wayland/events.rs:2595` 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) dll/src/desktop/shell2/macos/mod.rs:2706 — dll/src/desktop/shell2/macos/mod.rs:2706-2722 | dll/src/desktop/shell2/macos/mod.rs:2808-2824 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2) doc/src/codegen/v2/lang_cpp/common.rs:554 — doc/src/codegen/v2/lang_cpp/common.rs:554-570 | doc/src/codegen/v2/lang_cpp/common.rs:972-988 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_cpp/common.rs:554` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 1 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×26
  • Duplicated block (7 lines × 3) core/src/events.rs:1815 — core/src/events.rs:1815-1821 | core/src/events.rs:1923-1929 | core/src/events.rs:2122-2128 — all 3 copies are in the same file, so extract the block into one function there and call 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) core/src/xml.rs:7294 — core/src/xml.rs:7294-7300 | core/src/xml.rs:8504-8510 | core/src/xml.rs:8801-8807 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/xml.rs:7294` it does not close everything it opens, so those exact lines 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) dll/src/desktop/shell2/linux/x11/mod.rs:4423 — dll/src/desktop/shell2/linux/x11/mod.rs:4423-4429 | dll/src/desktop/shell2/linux/x11/mod.rs:5640-5646 | dll/src/desktop/shell2/linux/x11/mod.rs:7930-7936 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/x11/mod.rs:4423` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 3) doc/src/codegen/v2/lang_ada/types.rs:142 — doc/src/codegen/v2/lang_ada/types.rs:142-148 | doc/src/codegen/v2/lang_cobol/types.rs:165-171 | doc/src/codegen/v2/lang_pascal/types.rs:99-105 — `doc/src/codegen/v2/lang_ada/types.rs` and `doc/src/codegen/v2/lang_cobol/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 48 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_ada/types.rs:142` it does not close everything it opens, so those exact lines 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) doc/src/codegen/v2/lang_c.rs:917 — doc/src/codegen/v2/lang_c.rs:917-923 | doc/src/codegen/v2/lang_c.rs:965-971 | doc/src/codegen/v2/lang_c.rs:1004-1010 — all 3 copies are in the same file, so extract the block into one function there and call 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) doc/src/codegen/v2/lang_csharp/wrappers.rs:1770 — doc/src/codegen/v2/lang_csharp/wrappers.rs:1770-1776 | doc/src/codegen/v2/lang_csharp/wrappers.rs:1838-1844 | doc/src/codegen/v2/lang_csharp/wrappers.rs:1886-1892 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_csharp/wrappers.rs:1770` it does not close everything it opens, so those exact lines 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) doc/src/codegen/v2/lang_java/managed.rs:967 — doc/src/codegen/v2/lang_java/managed.rs:967-973 | doc/src/codegen/v2/lang_lua/managed.rs:185-191 | doc/src/codegen/v2/lang_node/managed.rs:141-147 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_java/managed.rs:967` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (7 lines × 3) doc/src/codegen/v2/lang_java/wrappers.rs:1574 — doc/src/codegen/v2/lang_java/wrappers.rs:1574-1580 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:1609-1615 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:1850-1856 — `doc/src/codegen/v2/lang_java/wrappers.rs` and `doc/src/codegen/v2/lang_kotlin/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 173 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_java/wrappers.rs:1574` it does not close everything it opens, so those 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, `doc/src/codegen/v2/lang_kotlin/wrappers.rs:1848` calls `classify_return` and `doc/src/codegen/v2/lang_kotlin/wrappers.rs:1605` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 3) doc/src/codegen/v2/lang_ruby/types.rs:270 — doc/src/codegen/v2/lang_ruby/types.rs:270-276 | doc/src/codegen/v2/lang_ruby/types.rs:508-514 | doc/src/codegen/v2/lang_ruby/types.rs:619-625 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_ruby/types.rs:270` it begins part-way through the construct above it, so those 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, `doc/src/codegen/v2/lang_ruby/types.rs:518` calls `emit_vec_to_a_ruby` and `doc/src/codegen/v2/lang_ruby/types.rs:277` 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 × 3) doc/src/main.rs:649 — doc/src/main.rs:649-655 | doc/src/main.rs:686-692 | doc/src/main.rs:1153-1159 — all 3 copies are in the same file, so extract the block into one function there and call 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) doc/src/main.rs:744 — doc/src/main.rs:744-750 | doc/src/main.rs:964-970 | doc/src/main.rs:1212-1218 — all 3 copies are in the same file, so extract the block into one function there and call 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, `doc/src/main.rs:971` calls `build` and `doc/src/main.rs:753` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 3) layout/src/callbacks.rs:1568 — layout/src/callbacks.rs:1568-1574 | layout/src/callbacks.rs:1592-1598 | layout/src/callbacks.rs:1616-1622 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/callbacks.rs:1568` it does not close everything it opens, so those exact lines 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) layout/src/solver3/paged_layout.rs:412 — layout/src/solver3/paged_layout.rs:412-420 | layout/src/solver3/paged_layout.rs:2658-2666 | layout/src/window.rs:5659-5665 — 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 `layout/src/solver3/paged_layout.rs:412` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 3) webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:356 — webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:356-362 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:344-350 | webrender/swgl/src/shaders/brush_image_texture_rect.rs:274-281 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs` and `webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 392 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:444 — webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:444-450 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:416-422 | webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:400-406 — before extracting anything, compare `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs` and `webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 326 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) webrender/swgl/src/shaders/cs_clip_box_shadow_texture_2d.rs:364 — webrender/swgl/src/shaders/cs_clip_box_shadow_texture_2d.rs:364-370 | webrender/swgl/src/shaders/cs_clip_rectangle.rs:426-432 | webrender/swgl/src/shaders/cs_clip_rectangle_fast_path.rs:386-392 — before extracting anything, compare `webrender/swgl/src/shaders/cs_clip_rectangle.rs` and `webrender/swgl/src/shaders/cs_clip_rectangle_fast_path.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/swgl/src/shaders/cs_clip_box_shadow_texture_2d.rs:364` it does not close everything it opens, so those exact lines 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) webrender/swgl/src/shaders/cs_conic_gradient.rs:268 — webrender/swgl/src/shaders/cs_conic_gradient.rs:268-274 | webrender/swgl/src/shaders/cs_linear_gradient.rs:276-282 | webrender/swgl/src/shaders/cs_radial_gradient.rs:303-309 — before extracting anything, compare `webrender/swgl/src/shaders/cs_conic_gradient.rs` and `webrender/swgl/src/shaders/cs_linear_gradient.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (7 lines × 3) layout/src/cpurender/pixmap.rs:110 — layout/src/cpurender/pixmap.rs:110-116 | layout/src/cpurender/pixmap.rs:294-300 | layout/src/cpurender/pixmap.rs:475-481 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/cpurender/pixmap.rs:110` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 3) layout/src/widgets/backstage.rs:351 — layout/src/widgets/backstage.rs:351-357 | layout/src/widgets/ribbon.rs:993-999 | layout/src/widgets/ribbon.rs:1270-1276 — before extracting anything, compare `layout/src/widgets/backstage.rs` and `layout/src/widgets/ribbon.rs` as WHOLE FILES: this scan already matched 7 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. If that is what happened, the fix is to keep one copy and have the 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 `layout/src/widgets/backstage.rs:351` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 3) core/src/callbacks.rs:665 — core/src/callbacks.rs:665-671 | core/src/callbacks.rs:1431-1437 | layout/src/callbacks.rs:7298-7304 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (7 lines × 3) doc/src/codegen/v2/lang_crystal/wrappers.rs:1384 — doc/src/codegen/v2/lang_crystal/wrappers.rs:1384-1390 | doc/src/codegen/v2/lang_d/wrappers.rs:2286-2292 | doc/src/codegen/v2/lang_swift/wrappers.rs:2265-2271 — `doc/src/codegen/v2/lang_crystal/wrappers.rs` and `doc/src/codegen/v2/lang_d/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 51 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (7 lines × 3) layout/src/managers/geolocation.rs:297 — layout/src/managers/geolocation.rs:297-303 | layout/src/managers/geolocation.rs:316-322 | layout/src/managers/sensors.rs:178-184 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (7 lines × 3) doc/src/codegen/v2/lang_d/functions.rs:33 — doc/src/codegen/v2/lang_d/functions.rs:33-39 | doc/src/codegen/v2/lang_odin/functions.rs:36-43 | doc/src/codegen/v2/lang_odin/functions.rs:93-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. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_d/functions.rs:33` it does not close everything it opens, so those exact lines 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) dll/src/web/transpiler_remill.rs:5309 — dll/src/web/transpiler_remill.rs:5309-5315 | dll/src/web/transpiler_remill.rs:5390-5396 | dll/src/web/transpiler_remill.rs:5446-5452 — all 3 copies are in the same file, so extract the block into one function there and call 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) doc/src/codegen/v2/lang_cobol/types.rs:510 — doc/src/codegen/v2/lang_cobol/types.rs:510-516 | doc/src/codegen/v2/lang_lisp/mod.rs:471-477 | doc/src/codegen/v2/lang_racket/mod.rs:316-322 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_cobol/types.rs:510` 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.
  • + 1 more in this group — see findings.md.
D6 · Cohesion (LCOM4) · Low cohesion · ×25
  • Low cohesion: CssPropertyCache (LCOM4 25) core/src/prop_cache.rs:1017 — CssPropertyCache's methods fall into 25 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 25 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: HttpRequestConfig (LCOM4 10) layout/src/http.rs:179 — HttpRequestConfig'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: CallbackInfo (LCOM4 9) layout/src/callbacks.rs:1290 — CallbackInfo's methods fall into 9 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 9 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Button (LCOM4 8) layout/src/widgets/button.rs:110 — Button'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: ShaderContext (LCOM4 7) webrender/swgl/src/common.rs:8 — ShaderContext'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: CoreVideoFunctions (LCOM4 6) dll/src/desktop/shell2/macos/corevideo.rs:61 — CoreVideoFunctions'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: TextArea (LCOM4 6) layout/src/widgets/text_area.rs:238 — TextArea'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: TextInput (LCOM4 6) layout/src/widgets/text_input.rs:527 — TextInput'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: VirtualViewCallbackInfo (LCOM4 5) core/src/callbacks.rs:472 — VirtualViewCallbackInfo'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: DynamicSelectorContext (LCOM4 5) css/src/dynamic_selector.rs:979 — DynamicSelectorContext'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: MacOSWindow (LCOM4 5) dll/src/desktop/shell2/macos/mod.rs:4009 — MacOSWindow'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: RenderImageCallbackInfo (LCOM4 5) layout/src/callbacks.rs:7239 — RenderImageCallbackInfo'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: SlicerConfig (LCOM4 5) layout/src/solver3/display_list.rs:9490 — SlicerConfig'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: CheckBox (LCOM4 5) layout/src/widgets/check_box.rs:64 — CheckBox'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: DropDown (LCOM4 5) layout/src/widgets/drop_down.rs:73 — DropDown'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: ProgressBar (LCOM4 5) layout/src/widgets/progressbar.rs:206 — ProgressBar'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: LocationFix (LCOM4 4) core/src/geolocation.rs:19 — LocationFix'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: AndroidWindow (LCOM4 4) dll/src/desktop/shell2/android/mod.rs:75 — AndroidWindow'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: WaylandWindow (LCOM4 4) dll/src/desktop/shell2/linux/wayland/mod.rs:544 — WaylandWindow'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: ObjcLib (LCOM4 4) dll/src/desktop/shell2/macos/system_style.rs:42 — ObjcLib'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: DpiFunctions (LCOM4 4) dll/src/desktop/shell2/windows/dpi.rs:82 — DpiFunctions'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: Avatar (LCOM4 4) layout/src/widgets/avatar.rs:121 — Avatar'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: ListView (LCOM4 4) layout/src/widgets/list_view.rs:783 — ListView'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: Slider (LCOM4 4) layout/src/widgets/slider.rs:78 — Slider'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: Switch (LCOM4 4) layout/src/widgets/switch.rs:72 — Switch'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.
D2 · Cognitive Complexity · Emitter · ×24
  • Emitter::plan_method (cognitive 168) doc/src/codegen/v2/lang_d/wrappers.rs:1727 — Emitter::plan_method has cognitive complexity 168 (threshold 15). Drivers by points: if/else 51 (114 pts), match/switch 11 (28 pts), boolean chains 22, loops 3 (4 pts) (nesting depth added 81). 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.
  • Emitter::plan_method (cognitive 157) doc/src/codegen/v2/lang_swift/wrappers.rs:1710 — Emitter::plan_method has cognitive complexity 157 (threshold 15). Drivers by points: if/else 55 (104 pts), boolean chains 26, match/switch 8 (23 pts), loops 3 (4 pts) (nesting depth added 65). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Emitter::emit_method (cognitive 128) doc/src/codegen/v2/lang_crystal/wrappers.rs:1030 — Emitter::emit_method has cognitive complexity 128 (threshold 15). Drivers by points: if/else 41 (83 pts), match/switch 6 (17 pts), boolean chains 14, loops 8 (14 pts) (nesting depth added 59). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Emitter::emit_string_ext (cognitive 84) doc/src/codegen/v2/lang_swift/wrappers.rs:3259 — Emitter::emit_string_ext has cognitive complexity 84 (threshold 15). Drivers by points: if/else 26 (44 pts), match/switch 8 (25 pts), loops 7 (13 pts), boolean chains 2 (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Emitter::emit_methods (cognitive 58) doc/src/codegen/v2/lang_swift/wrappers.rs:1552 — Emitter::emit_methods has cognitive complexity 58 (threshold 15). Drivers by points: if/else 12 (32 pts), loops 9 (14 pts), match/switch 4 (9 pts), boolean chains 3 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Emitter::emit_traits (cognitive 45) doc/src/codegen/v2/lang_swift/wrappers.rs:1288 — Emitter::emit_traits has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (21 pts), loops 8 (16 pts), match/switch 4 (5 pts), boolean chains 3 (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.
  • Emitter::emit_variants (cognitive 34) doc/src/codegen/v2/lang_d/wrappers.rs:1101 — Emitter::emit_variants has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 3 (10 pts), match/switch 1 (4 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Emitter::emit_option_traits (cognitive 34) doc/src/codegen/v2/lang_swift/wrappers.rs:2857 — Emitter::emit_option_traits has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (25 pts), loops 3 (6 pts), boolean chains 2, 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.
  • Emitter::emit_fields (cognitive 29) doc/src/codegen/v2/lang_crystal/wrappers.rs:762 — Emitter::emit_fields has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (20 pts), match/switch 4 (8 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.
  • Emitter::emit_union (cognitive 27) doc/src/codegen/v2/lang_swift/wrappers.rs:757 — Emitter::emit_union has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18 (25 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.
  • Emitter::emit_trampolines (cognitive 25) doc/src/codegen/v2/lang_swift/wrappers.rs:2560 — Emitter::emit_trampolines has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Emitter::emit_class (cognitive 22) doc/src/codegen/v2/lang_crystal/wrappers.rs:479 — Emitter::emit_class has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (13 pts), loops 2 (4 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • Emitter::method_name (cognitive 22) doc/src/codegen/v2/lang_crystal/wrappers.rs:963 — Emitter::method_name has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 7 (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.
  • Emitter::emit_class_fields (cognitive 22) doc/src/codegen/v2/lang_swift/wrappers.rs:1191 — Emitter::emit_class_fields has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 2 (5 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.
  • Emitter::emit_constants (cognitive 22) doc/src/codegen/v2/lang_swift/wrappers.rs:3549 — Emitter::emit_constants has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 4 (7 pts), match/switch 1 (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.
  • Emitter::emit_trampolines (cognitive 20) doc/src/codegen/v2/lang_d/wrappers.rs:2513 — Emitter::emit_trampolines has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Emitter::emit_trampolines (cognitive 19) doc/src/codegen/v2/lang_crystal/wrappers.rs:1597 — Emitter::emit_trampolines has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Emitter::emit_struct (cognitive 17) doc/src/codegen/v2/lang_d/wrappers.rs:858 — Emitter::emit_struct has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 1 (2 pts), match/switch 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Emitter::emit_traits (cognitive 17) doc/src/codegen/v2/lang_d/wrappers.rs:1488 — Emitter::emit_traits has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • Emitter::emit_enums (cognitive 16) doc/src/codegen/v2/lang_crystal/wrappers.rs:384 — Emitter::emit_enums has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Emitter::emit_vec_conv (cognitive 16) doc/src/codegen/v2/lang_crystal/wrappers.rs:1801 — Emitter::emit_vec_conv has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), match/switch 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • Emitter::count (cognitive 16) doc/src/codegen/v2/lang_swift/wrappers.rs:478 — Emitter::count has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4 (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.
  • Emitter::emit_to_raw (cognitive 16) doc/src/codegen/v2/lang_swift/wrappers.rs:909 — Emitter::emit_to_raw has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Emitter::emit_union_ctors (cognitive 16) doc/src/codegen/v2/lang_swift/wrappers.rs:1111 — Emitter::emit_union_ctors has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×23
  • Edited copy of a member (13 corresponding lines) webrender/swgl/src/shaders/cs_border_segment.rs:61 — webrender/swgl/src/shaders/cs_border_segment.rs:61-73 | webrender/swgl/src/shaders/cs_border_solid.rs:58-70 — 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) layout/src/solver3/geometry.rs:591 — layout/src/solver3/geometry.rs:591-606 | layout/src/solver3/geometry.rs:611-623 — 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) layout/src/widgets/ribbon.rs:1027 — layout/src/widgets/ribbon.rs:1027-1040 | layout/src/widgets/ribbon.rs:1311-1323 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:4685 — dll/src/desktop/shell2/linux/wayland/mod.rs:4685-4697 | dll/src/desktop/shell2/linux/wayland/mod.rs:4731-4746 — 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) layout/src/xml/svg.rs:816 — layout/src/xml/svg.rs:816-828 | layout/src/xml/svg.rs:847-861 — 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) dll/src/desktop/extra/geolocation/linux.rs:48 — dll/src/desktop/extra/geolocation/linux.rs:48-60 | dll/src/desktop/extra/geolocation/windows.rs:67-79 — 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) css/src/props/basic/color.rs:1816 — css/src/props/basic/color.rs:1816-1828 | css/src/props/basic/color.rs:1856-1868 — 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) dll/src/desktop/extra/camera/avfoundation.rs:369 — dll/src/desktop/extra/camera/avfoundation.rs:369-382 | dll/src/desktop/extra/screencap/macos.rs:554-566 — 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) layout/src/widgets/map.rs:1500 — layout/src/widgets/map.rs:1500-1514 | layout/src/widgets/map.rs:1626-1638 — 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) dll/src/desktop/shell2/common/transient.rs:664 — dll/src/desktop/shell2/common/transient.rs:664-678 | layout/src/transient.rs:226-238 — 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) layout/src/solver3/layout_tree.rs:1776 — layout/src/solver3/layout_tree.rs:1776-1788 | layout/src/solver3/layout_tree.rs:1816-1833 — 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) doc/src/autofix/mod.rs:109 — doc/src/autofix/mod.rs:109-122 | doc/src/lint_orphans.rs:54-66 — 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) doc/src/codegen/v2/lang_java/types.rs:1032 — doc/src/codegen/v2/lang_java/types.rs:1032-1044 | doc/src/codegen/v2/lang_kotlin/mod.rs:1062-1075 — 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) doc/src/autofix/type_index.rs:1102 — doc/src/autofix/type_index.rs:1102-1114 | doc/src/autotest/extract.rs:382-397 — 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) dll/src/desktop/extra/geolocation/ios.rs:112 — dll/src/desktop/extra/geolocation/ios.rs:112-124 | dll/src/desktop/extra/geolocation/macos.rs:106-118 — 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) layout/src/managers/gesture.rs:1137 — layout/src/managers/gesture.rs:1137-1149 | layout/src/managers/gesture.rs:2197-2209 — 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) layout/src/solver3/layout_tree.rs:615 — layout/src/solver3/layout_tree.rs:615-627 | layout/src/window.rs:18598-18610 — 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) core/src/selection.rs:691 — core/src/selection.rs:691-703 | core/src/selection.rs:706-718 — 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) doc/src/codegen/v2/lang_go/types.rs:576 — doc/src/codegen/v2/lang_go/types.rs:576-588 | doc/src/codegen/v2/lang_swift/mod.rs:150-162 — 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) layout/src/callbacks.rs:6185 — layout/src/callbacks.rs:6185-6200 | layout/src/callbacks.rs:6207-6219 — 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) core/src/xml.rs:8249 — core/src/xml.rs:8249-8261 | core/src/xml.rs:8263-8275 — 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) layout/src/managers/eyedropper.rs:127 — layout/src/managers/eyedropper.rs:127-139 | layout/src/managers/sensors.rs:119-131 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) dll/src/desktop/shell2/linux/wayland/events.rs:2445 — dll/src/desktop/shell2/linux/wayland/events.rs:2445-2459 | dll/src/desktop/shell2/linux/x11/clipboard.rs:479-491 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×23
  • Edited copy of a member (14 corresponding lines) webrender/swgl/src/shaders/cs_conic_gradient.rs:90 — webrender/swgl/src/shaders/cs_conic_gradient.rs:90-104 | webrender/swgl/src/shaders/cs_radial_gradient.rs:93-106 — 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) layout/src/solver3/calc.rs:223 — layout/src/solver3/calc.rs:223-238 | layout/src/solver3/taffy_bridge.rs:50-63 — 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) doc/src/reftest/apply_midlevel.rs:1843 — doc/src/reftest/apply_midlevel.rs:1843-1858 | doc/src/reftest/apply_midlevel.rs:1868-1881 — 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) core/src/path_parser.rs:289 — core/src/path_parser.rs:289-305 | core/src/path_parser.rs:340-353 — 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) layout/src/managers/scroll_state.rs:983 — layout/src/managers/scroll_state.rs:983-997 | layout/src/managers/scroll_state.rs:1009-1022 — 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) layout/src/desktop/dialogs.rs:179 — layout/src/desktop/dialogs.rs:179-192 | layout/src/desktop/dialogs.rs:198-211 — 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) doc/src/codegen/v2/lang_d/wrappers.rs:229 — doc/src/codegen/v2/lang_d/wrappers.rs:229-242 | doc/src/codegen/v2/lang_swift/wrappers.rs:190-206 — 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) layout/src/xml/svg.rs:567 — layout/src/xml/svg.rs:567-580 | layout/src/xml/svg.rs:584-597 — 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) webrender/glyph/src/lib.rs:204 — webrender/glyph/src/lib.rs:204-217 | webrender/glyph/src/lib.rs:370-383 — 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) layout/src/icu.rs:912 — layout/src/icu.rs:912-925 | layout/src/icu.rs:927-940 — 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) webrender/glyph/src/lib.rs:123 — webrender/glyph/src/lib.rs:123-136 | webrender/glyph/src/lib.rs:281-296 — 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) doc/src/autofix/mod.rs:1142 — doc/src/autofix/mod.rs:1142-1155 | doc/src/autofix/mod.rs:1270-1286 — 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) core/src/callbacks.rs:618 — core/src/callbacks.rs:618-632 | core/src/callbacks.rs:648-661 — 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) core/src/json.rs:550 — core/src/json.rs:550-563 | core/src/json.rs:569-584 — 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) layout/src/solver3/taffy_bridge.rs:507 — layout/src/solver3/taffy_bridge.rs:507-520 | layout/src/solver3/taffy_bridge.rs:524-543 — 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) doc/src/reftest/apply_midlevel.rs:3402 — doc/src/reftest/apply_midlevel.rs:3402-3415 | doc/src/reftest/apply_midlevel.rs:3545-3561 — 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) doc/src/codegen/v2/lang_perl/functions.rs:33 — doc/src/codegen/v2/lang_perl/functions.rs:33-46 | doc/src/codegen/v2/lang_ruby/functions.rs:43-59 — 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) dll/src/desktop/shell2/linux/wayland/events.rs:1214 — dll/src/desktop/shell2/linux/wayland/events.rs:1214-1227 | dll/src/desktop/shell2/linux/wayland/events.rs:2050-2065 — 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) dll/src/desktop/shell2/macos/menu.rs:200 — dll/src/desktop/shell2/macos/menu.rs:200-215 | dll/src/desktop/shell2/macos/menu.rs:224-237 — 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) core/src/events.rs:4613 — core/src/events.rs:4613-4626 | core/src/events.rs:4747-4762 — 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) core/src/dom.rs:3216 — core/src/dom.rs:3216-3229 | core/src/dom.rs:3245-3258 — 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) webrender/core/src/gpu_types.rs:289 — webrender/core/src/gpu_types.rs:289-302 | webrender/core/src/gpu_types.rs:311-327 — 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) css/src/props/style/transform.rs:592 — css/src/props/style/transform.rs:592-605 | css/src/props/style/transform.rs:656-669 — 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 · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×22
  • Members sharing a duplicated core (5 members, 50+ identical tokens) core/src/resources.rs:2634 — core/src/resources.rs:2634-2656 | core/src/resources.rs:2698-2717 | core/src/resources.rs:2747-2769 | core/src/resources.rs:2826-2848 | core/src/resources.rs:2894-2916 — 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) css/src/system.rs:801 — css/src/system.rs:801-824 | css/src/system.rs:828-851 | css/src/system.rs:855-878 | css/src/system.rs:882-914 | css/src/system.rs:918-941 — 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) dll/src/desktop/extra/biometric/android.rs:139 — dll/src/desktop/extra/biometric/android.rs:139-151 | dll/src/desktop/extra/geolocation/android.rs:108-120 | dll/src/desktop/extra/keyring/android.rs:106-118 | dll/src/desktop/extra/permission/android.rs:146-158 | dll/src/desktop/extra/sensors/android.rs:80-92 — 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) dll/src/desktop/shell2/headless/mod.rs:2206 — dll/src/desktop/shell2/headless/mod.rs:2206-2241 | dll/src/desktop/shell2/linux/wayland/mod.rs:1975-2854 | dll/src/desktop/shell2/linux/x11/mod.rs:3230-4186 | dll/src/desktop/shell2/macos/mod.rs:4978-5967 | dll/src/desktop/shell2/windows/mod.rs:312-1061 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:7011 — dll/src/desktop/shell2/linux/wayland/mod.rs:7011-8271 | dll/src/desktop/shell2/linux/x11/mod.rs:6172-6276 | dll/src/desktop/shell2/linux/x11/mod.rs:6380-7131 | dll/src/desktop/shell2/windows/mod.rs:1817-1931 | dll/src/desktop/shell2/windows/mod.rs:1944-1984 — 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) dll/src/desktop/shell2/linux/x11/mod.rs:4340 — dll/src/desktop/shell2/linux/x11/mod.rs:4340-4480 | dll/src/desktop/shell2/linux/x11/mod.rs:4782-4795 | dll/src/desktop/shell2/linux/x11/mod.rs:5598-5610 | dll/src/desktop/shell2/linux/x11/mod.rs:5616-5678 | dll/src/desktop/shell2/linux/x11/mod.rs:7929-7942 — 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) dll/src/web/transpiler_remill.rs:6177 — dll/src/web/transpiler_remill.rs:6177-6207 | dll/src/web/transpiler_remill.rs:10931-10981 | dll/src/web/transpiler_remill.rs:11061-11413 | dll/src/web/transpiler_remill.rs:11423-11471 | dll/src/web/transpiler_remill.rs:11474-11503 — 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) doc/src/autofix/discovery/parallel.rs:108 — doc/src/autofix/discovery/parallel.rs:108-151 | doc/src/docgen/guide.rs:190-229 | doc/src/lint_links.rs:406-426 | doc/src/reftest/autodoc.rs:259-286 | doc/src/reftest/autoreview.rs:89-108 — 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) doc/src/codegen/v2/lang_algol68/wrappers.rs:119 — doc/src/codegen/v2/lang_algol68/wrappers.rs:119-131 | doc/src/codegen/v2/lang_cobol/wrappers.rs:87-99 | doc/src/codegen/v2/lang_freebasic/wrappers.rs:85-97 | doc/src/codegen/v2/lang_pascal/wrappers.rs:127-139 | doc/src/codegen/v2/lang_vb6/wrappers.rs:62-74 — 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) doc/src/codegen/v2/lang_crystal/mod.rs:288 — doc/src/codegen/v2/lang_crystal/mod.rs:288-294 | doc/src/codegen/v2/lang_d/mod.rs:416-422 | doc/src/codegen/v2/lang_julia/mod.rs:182-188 | doc/src/codegen/v2/lang_odin/mod.rs:117-123 | doc/src/codegen/v2/lang_v/mod.rs:140-146 — 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) doc/src/codegen/v2/lang_crystal/types.rs:324 — doc/src/codegen/v2/lang_crystal/types.rs:324-386 | doc/src/codegen/v2/lang_d/types.rs:212-261 | doc/src/codegen/v2/lang_julia/types.rs:311-370 | doc/src/codegen/v2/lang_odin/types.rs:270-327 | doc/src/codegen/v2/lang_v/types.rs:278-338 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) doc/src/codegen/v2/lang_csharp/wrappers.rs:541 — doc/src/codegen/v2/lang_csharp/wrappers.rs:541-561 | doc/src/codegen/v2/lang_haskell/types.rs:466-491 | doc/src/codegen/v2/lang_java/wrappers.rs:957-977 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:370-390 | doc/src/codegen/v2/lang_ruby/wrappers.rs:630-653 — 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) doc/src/codegen/v2/lang_python.rs:1081 — doc/src/codegen/v2/lang_python.rs:1081-1462 | doc/src/codegen/v2/lang_rust.rs:4657-4673 | doc/src/codegen/v2/lang_rust.rs:4692-4709 | doc/src/codegen/v2/lang_rust.rs:4722-4741 | doc/src/codegen/v2/lang_rust.rs:4758-4779 — 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) layout/src/callbacks.rs:3585 — layout/src/callbacks.rs:3585-3592 | layout/src/callbacks.rs:3636-3648 | layout/src/callbacks.rs:3655-3664 | layout/src/callbacks.rs:3680-3759 | layout/src/callbacks.rs:3787-3800 — 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) layout/src/dialogs/crash_reporter.rs:187 — layout/src/dialogs/crash_reporter.rs:187-292 | layout/src/dialogs/gpu_check.rs:201-322 | layout/src/dialogs/report_problem.rs:456-568 | layout/src/dialogs/telemetry_consent.rs:189-282 | layout/src/dialogs/update_version.rs:311-420 — 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) layout/src/dialogs/crash_reporter.rs:294 — layout/src/dialogs/crash_reporter.rs:294-304 | layout/src/dialogs/gpu_check.rs:383-393 | layout/src/dialogs/report_problem.rs:697-707 | layout/src/dialogs/telemetry_consent.rs:296-306 | layout/src/dialogs/update_version.rs:423-433 — 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) layout/src/widgets/breadcrumb.rs:336 — layout/src/widgets/breadcrumb.rs:336-370 | layout/src/widgets/pagination.rs:500-610 | layout/src/widgets/radio_group.rs:545-598 | layout/src/widgets/segmented.rs:443-507 | layout/src/widgets/stepper.rs:567-669 — 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) layout/src/xml/svg.rs:702 — layout/src/xml/svg.rs:702-725 | layout/src/xml/svg.rs:740-763 | layout/src/xml/svg.rs:953-976 | layout/src/xml/svg.rs:1018-1041 | layout/src/xml/svg.rs:1097-1119 — 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) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:379 — webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:379-393 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:375-388 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:368-381 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:368-382 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:333-348 — 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) webrender/swgl/src/shaders/brush_linear_gradient.rs:224 — webrender/swgl/src/shaders/brush_linear_gradient.rs:224-234 | webrender/swgl/src/shaders/brush_linear_gradient_alpha_pass.rs:233-243 | webrender/swgl/src/shaders/cs_conic_gradient.rs:175-185 | webrender/swgl/src/shaders/cs_linear_gradient.rs:163-173 | webrender/swgl/src/shaders/ps_quad_conic_gradient.rs:268-278 — 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) webrender/swgl/src/shaders/ps_quad_conic_gradient.rs:102 — webrender/swgl/src/shaders/ps_quad_conic_gradient.rs:102-170 | webrender/swgl/src/shaders/ps_quad_mask.rs:230-285 | webrender/swgl/src/shaders/ps_quad_mask_fast_path.rs:166-230 | webrender/swgl/src/shaders/ps_quad_radial_gradient.rs:86-174 | webrender/swgl/src/shaders/ps_quad_textured.rs:213-277 — 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) webrender/swgl/src/shaders/ps_quad_conic_gradient.rs:378 — webrender/swgl/src/shaders/ps_quad_conic_gradient.rs:378-385 | webrender/swgl/src/shaders/ps_quad_mask.rs:555-562 | webrender/swgl/src/shaders/ps_quad_mask_fast_path.rs:486-493 | webrender/swgl/src/shaders/ps_quad_radial_gradient.rs:366-373 | webrender/swgl/src/shaders/ps_quad_textured.rs:472-480 — 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 (11 corresponding lines) · ×22
  • Edited copy of a member (11 corresponding lines) webrender/swgl/src/shaders/composite_fast_path_texture_2d.rs:77 — webrender/swgl/src/shaders/composite_fast_path_texture_2d.rs:77-93 | webrender/swgl/src/shaders/composite_fast_path_texture_rect.rs:77-87 — 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) doc/src/codegen/v2/lang_haskell/types.rs:921 — doc/src/codegen/v2/lang_haskell/types.rs:921-943 | doc/src/codegen/v2/lang_haskell/types.rs:945-955 — 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) webrender/swgl/src/shaders/ps_quad_mask.rs:114 — webrender/swgl/src/shaders/ps_quad_mask.rs:114-124 | webrender/swgl/src/shaders/ps_quad_mask_fast_path.rs:103-113 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:3827 — dll/src/desktop/shell2/linux/wayland/mod.rs:3827-3843 | dll/src/desktop/shell2/linux/wayland/mod.rs:3850-3860 — 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) layout/src/widgets/backstage.rs:322 — layout/src/widgets/backstage.rs:322-332 | layout/src/widgets/backstage.rs:334-346 — 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) webrender/swgl/src/shaders/debug_font.rs:37 — webrender/swgl/src/shaders/debug_font.rs:37-47 | webrender/swgl/src/shaders/ps_clear.rs:37-59 — 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) layout/src/icu.rs:788 — layout/src/icu.rs:788-800 | layout/src/icu.rs:837-847 — 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) layout/src/managers/gesture.rs:2538 — layout/src/managers/gesture.rs:2538-2548 | layout/src/managers/gesture.rs:2555-2570 — 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) layout/src/icu_macos.rs:337 — layout/src/icu_macos.rs:337-349 | layout/src/icu_macos.rs:358-368 — 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) dll/src/desktop/shell2/macos/mod.rs:2596 — dll/src/desktop/shell2/macos/mod.rs:2596-2606 | dll/src/desktop/shell2/macos/mod.rs:2619-2629 — 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) css/src/parser2.rs:965 — css/src/parser2.rs:965-975 | css/src/parser2.rs:980-990 — 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) dll/src/desktop/shell2/ios/mod.rs:2323 — dll/src/desktop/shell2/ios/mod.rs:2323-2333 | dll/src/desktop/shell2/ios/mod.rs:2336-2346 — 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) webrender/core/src/device/gl.rs:3553 — webrender/core/src/device/gl.rs:3553-3563 | webrender/core/src/device/gl.rs:3648-3659 — 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) dll/src/desktop/shell2/linux/wayland/events.rs:3343 — dll/src/desktop/shell2/linux/wayland/events.rs:3343-3360 | dll/src/desktop/shell2/linux/wayland/events.rs:3955-3965 — 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) core/src/gl.rs:1242 — core/src/gl.rs:1242-1252 | core/src/gl.rs:1259-1269 — 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) layout/src/text3/dense.rs:1086 — layout/src/text3/dense.rs:1086-1096 | layout/src/text3/dense.rs:1103-1113 — 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) dll/src/desktop/shell2/macos/mod.rs:469 — dll/src/desktop/shell2/macos/mod.rs:469-479 | dll/src/desktop/shell2/macos/mod.rs:481-491 — 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) layout/src/image.rs:533 — layout/src/image.rs:533-551 | layout/src/widgets/node_graph.rs:685-695 — 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) webrender/swgl/src/shaders/ps_quad_textured.rs:366 — webrender/swgl/src/shaders/ps_quad_textured.rs:366-377 | webrender/swgl/src/shaders/ps_quad_radial_gradient.rs:250-260 — 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) layout/src/widgets/badge.rs:282 — layout/src/widgets/badge.rs:282-292 | layout/src/widgets/label.rs:135-145 — 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) webrender/swgl/src/shaders/cs_blur_alpha_target.rs:311 — webrender/swgl/src/shaders/cs_blur_alpha_target.rs:311-321 | webrender/swgl/src/shaders/cs_blur_color_target.rs:282-292 — 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) doc/src/codegen/v2/lang_java/wrappers.rs:1831 — doc/src/codegen/v2/lang_java/wrappers.rs:1831-1841 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:162-172 — 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 · Duplicated block (18 lines × 2) · ×22
  • Duplicated block (18 lines × 2) core/src/diff.rs:937 — core/src/diff.rs:937-954 | core/src/events.rs:2239-2256 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (18 lines × 2) core/src/dom.rs:837 — core/src/dom.rs:837-854 | core/src/dom.rs:877-894 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (18 lines × 2) css/src/system.rs:2896 — css/src/system.rs:2896-2913 | css/src/system.rs:2945-2962 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `css/src/system.rs:2896` it begins part-way through the construct above it, so those exact lines 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) dll/src/desktop/extra/permission/ios.rs:145 — dll/src/desktop/extra/permission/ios.rs:145-162 | dll/src/desktop/extra/permission/macos.rs:246-263 — before extracting anything, compare `dll/src/desktop/extra/permission/ios.rs` and `dll/src/desktop/extra/permission/macos.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (18 lines × 2) dll/src/desktop/shell2/common/debug_server/platform.rs:178 — dll/src/desktop/shell2/common/debug_server/platform.rs:178-195 | dll/src/desktop/shell2/common/debug_server/platform.rs:449-466 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/common/debug_server/platform.rs:178` 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) dll/src/desktop/shell2/common/transient.rs:256 — dll/src/desktop/shell2/common/transient.rs:256-273 | dll/src/desktop/shell2/common/transient.rs:330-347 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/common/transient.rs:256` 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) dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:54 — dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:54-71 | dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:103-120 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:54` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (18 lines × 2) dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:403 — dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:403-420 | dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:503-520 — both copies are in the same file, so extract the 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 (18 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:2747 — dll/src/desktop/shell2/linux/wayland/mod.rs:2747-2764 | dll/src/desktop/shell2/linux/wayland/mod.rs:2809-2826 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:2747` it begins part-way through the construct above it, so those exact lines 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) dll/src/desktop/shell2/run.rs:644 — dll/src/desktop/shell2/run.rs:644-661 | dll/src/desktop/shell2/run.rs:1997-2014 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/run.rs:644` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (18 lines × 2) dll/src/desktop/wr_translate2.rs:2166 — dll/src/desktop/wr_translate2.rs:2166-2183 | dll/src/desktop/wr_translate2.rs:2185-2202 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (18 lines × 2) dll/src/web/transpiler_remill.rs:11108 — dll/src/web/transpiler_remill.rs:11108-11125 | dll/src/web/transpiler_remill.rs:11128-11151 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/web/transpiler_remill.rs:11108` it begins part-way through the construct above it, so those exact lines 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) doc/src/codegen/v2/ir.rs:1104 — doc/src/codegen/v2/ir.rs:1104-1121 | doc/src/codegen/v2/ir.rs:1136-1153 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/ir.rs:1104` it begins part-way through the construct above it, so those exact lines 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) doc/src/codegen/v2/lang_cobol/functions.rs:134 — doc/src/codegen/v2/lang_cobol/functions.rs:134-151 | doc/src/codegen/v2/lang_cobol/types.rs:435-452 — 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 `doc/src/codegen/v2/lang_cobol/functions.rs:134` it does not close everything it opens, so those exact lines 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) doc/src/codegen/v2/lang_cpp/cpp03.rs:638 — doc/src/codegen/v2/lang_cpp/cpp03.rs:638-655 | doc/src/codegen/v2/lang_cpp/cpp11.rs:560-577 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/codegen/v2/lang_cpp/cpp03.rs:638` it begins part-way through the construct above it, so those exact lines 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) doc/src/codegen/v2/lang_lua/wrappers.rs:803 — doc/src/codegen/v2/lang_lua/wrappers.rs:803-822 | doc/src/codegen/v2/lang_lua/wrappers.rs:1267-1284 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_lua/wrappers.rs:803` it begins part-way through the construct above it, so those exact lines 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) doc/src/codegen/v2/lang_rust.rs:2327 — doc/src/codegen/v2/lang_rust.rs:2327-2344 | doc/src/codegen/v2/rust/shared.rs:16-33 — before extracting anything, compare `doc/src/codegen/v2/lang_rust.rs` and `doc/src/codegen/v2/rust/shared.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 210 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 (18 lines × 2) layout/src/cpurender/svg.rs:533 — layout/src/cpurender/svg.rs:533-550 | layout/src/xml/svg.rs:2055-2072 — `layout/src/cpurender/svg.rs` and `layout/src/xml/svg.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 36 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/cpurender/svg.rs:533` 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 after the matched lines, `layout/src/xml/svg.rs:2073` calls `add_path` and `layout/src/cpurender/svg.rs:550` 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) layout/src/solver3/fc.rs:9916 — layout/src/solver3/fc.rs:9916-9933 | layout/src/solver3/fc.rs:10059-10076 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/fc.rs:9916` 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) layout/src/widgets/node_graph.rs:1745 — layout/src/widgets/node_graph.rs:1745-1762 | layout/src/widgets/node_graph.rs:1768-1785 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/widgets/node_graph.rs:1745` 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) layout/src/widgets/themes/flat.rs:1345 — layout/src/widgets/themes/flat.rs:1345-1362 | layout/src/widgets/themes/flora.rs:1737-1754 — before extracting anything, compare `layout/src/widgets/themes/flat.rs` and `layout/src/widgets/themes/flora.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 927 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (18 lines × 2) webrender/swgl/src/shaders/cs_clip_rectangle.rs:53 — webrender/swgl/src/shaders/cs_clip_rectangle.rs:53-70 | webrender/swgl/src/shaders/cs_clip_rectangle_fast_path.rs:87-104 — before extracting anything, compare `webrender/swgl/src/shaders/cs_clip_rectangle.rs` and `webrender/swgl/src/shaders/cs_clip_rectangle_fast_path.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 (9 lines × 3) · ×22
  • Duplicated block (9 lines × 3) core/src/resources.rs:2734 — core/src/resources.rs:2734-2742 | core/src/resources.rs:2793-2801 | core/src/resources.rs:2944-2952 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/resources.rs:2734` it begins part-way through the construct above it, so those exact lines 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) dll/src/desktop/shell2/linux/wayland/mod.rs:4637 — dll/src/desktop/shell2/linux/wayland/mod.rs:4637-4645 | dll/src/desktop/shell2/linux/wayland/mod.rs:5666-5674 | dll/src/desktop/shell2/linux/wayland/mod.rs:5844-5852 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:4637` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `&mut` in one and `super) fn wayland_set_selection(&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 (9 lines × 3) dll/src/web/symbol_table.rs:1775 — dll/src/web/symbol_table.rs:1775-1783 | dll/src/web/symbol_table.rs:3105-3113 | dll/src/web/symbol_table.rs:3175-3183 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/web/symbol_table.rs:1775` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 3) dll/src/web/transpiler_remill.rs:6181 — dll/src/web/transpiler_remill.rs:6181-6189 | dll/src/web/transpiler_remill.rs:10932-10940 | dll/src/web/transpiler_remill.rs:11475-11483 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/web/transpiler_remill.rs:6181` it does not close everything it opens, so those exact lines 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) dll/src/web/transpiler_remill.rs:10933 — dll/src/web/transpiler_remill.rs:10933-10941 | dll/src/web/transpiler_remill.rs:11064-11072 | dll/src/web/transpiler_remill.rs:11427-11435 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/web/transpiler_remill.rs:10933` it does not close everything it opens, so those exact lines 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) doc/src/codegen/v2/ir_builder.rs:1127 — doc/src/codegen/v2/ir_builder.rs:1127-1135 | doc/src/codegen/v2/ir_builder.rs:1245-1253 | doc/src/codegen/v2/ir_builder.rs:1415-1423 — all 3 copies are in the same file, so extract the block into one function there and call 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) doc/src/codegen/v2/lang_crystal/model.rs:565 — doc/src/codegen/v2/lang_crystal/model.rs:565-573 | doc/src/codegen/v2/lang_d/model.rs:871-879 | doc/src/codegen/v2/lang_swift/model.rs:872-880 — `doc/src/codegen/v2/lang_crystal/model.rs` and `doc/src/codegen/v2/lang_d/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 88 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_crystal/model.rs:565` 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 × 3) doc/src/codegen/v2/lang_crystal/wrappers.rs:1018 — doc/src/codegen/v2/lang_crystal/wrappers.rs:1018-1026 | doc/src/codegen/v2/lang_d/wrappers.rs:2305-2313 | doc/src/codegen/v2/lang_swift/wrappers.rs:2284-2292 — `doc/src/codegen/v2/lang_crystal/wrappers.rs` and `doc/src/codegen/v2/lang_d/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 51 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_crystal/wrappers.rs:1018` 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 × 3) doc/src/codegen/v2/lang_node/wrappers.rs:464 — doc/src/codegen/v2/lang_node/wrappers.rs:464-472 | doc/src/codegen/v2/lang_node/wrappers.rs:681-689 | doc/src/codegen/v2/lang_node/wrappers.rs:1153-1161 — all 3 copies are in the same file, so extract the block into one function there and call 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, `doc/src/codegen/v2/lang_node/wrappers.rs:476` calls `line` and `doc/src/codegen/v2/lang_node/wrappers.rs:692` 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) layout/src/solver3/paged_layout.rs:596 — layout/src/solver3/paged_layout.rs:596-604 | layout/src/solver3/paged_layout.rs:839-847 | layout/src/solver3/paged_layout.rs:906-914 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/paged_layout.rs:596` it does not close everything it opens, so those exact lines 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) layout/src/text3/edit.rs:626 — layout/src/text3/edit.rs:626-634 | layout/src/text3/edit.rs:820-829 | layout/src/text3/edit.rs:953-962 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/text3/edit.rs:626` it does not close everything it opens, so those exact lines 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) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:465 — webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:465-473 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:467-475 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:456-464 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs` and `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 439 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:465` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:395 — webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:395-403 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:347-355 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:333-341 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs` and `webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 226 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:395` it does not close everything it opens, so those exact lines 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) webrender/swgl/src/shaders/brush_linear_gradient.rs:189 — webrender/swgl/src/shaders/brush_linear_gradient.rs:189-198 | webrender/swgl/src/shaders/brush_linear_gradient_alpha_pass.rs:190-199 | webrender/swgl/src/shaders/ps_quad_radial_gradient.rs:210-218 — before extracting anything, compare `webrender/swgl/src/shaders/brush_linear_gradient.rs` and `webrender/swgl/src/shaders/brush_linear_gradient_alpha_pass.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 218 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (9 lines × 3) webrender/swgl/src/shaders/cs_clip_box_shadow_texture_2d.rs:195 — webrender/swgl/src/shaders/cs_clip_box_shadow_texture_2d.rs:195-203 | webrender/swgl/src/shaders/cs_clip_rectangle.rs:231-239 | webrender/swgl/src/shaders/cs_clip_rectangle_fast_path.rs:195-203 — before extracting anything, compare `webrender/swgl/src/shaders/cs_clip_rectangle.rs` and `webrender/swgl/src/shaders/cs_clip_rectangle_fast_path.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 × 3) webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs:167 — webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs:167-175 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_glyph_transform_texture_2d.rs:151-159 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_texture_2d.rs:157-165 — before extracting anything, compare `webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs` and `webrender/swgl/src/shaders/ps_text_run_alpha_pass_glyph_transform_texture_2d.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 139 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs:167` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) core/src/events.rs:1778 — core/src/events.rs:1778-1786 | core/src/events.rs:1908-1916 | core/src/events.rs:2067-2075 — all 3 copies are in the same file, so extract the block into one function there and call 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) webrender/swgl/src/shaders/ps_quad_mask.rs:178 — webrender/swgl/src/shaders/ps_quad_mask.rs:178-186 | webrender/swgl/src/shaders/ps_quad_mask_fast_path.rs:266-274 | webrender/swgl/src/shaders/ps_quad_textured.rs:157-165 — before extracting anything, compare `webrender/swgl/src/shaders/ps_quad_mask.rs` and `webrender/swgl/src/shaders/ps_quad_mask_fast_path.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (9 lines × 3) doc/src/codegen/v2/lang_crystal/model.rs:417 — doc/src/codegen/v2/lang_crystal/model.rs:417-425 | doc/src/codegen/v2/lang_d/model.rs:589-597 | doc/src/codegen/v2/lang_swift/model.rs:604-612 — `doc/src/codegen/v2/lang_crystal/model.rs` and `doc/src/codegen/v2/lang_d/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 88 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (9 lines × 3) core/src/xml.rs:3258 — core/src/xml.rs:3258-3268 | core/src/xml.rs:3292-3300 | core/src/xml.rs:3326-3336 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/xml.rs:3258` it begins part-way through the construct above it, so those exact lines 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) doc/src/autofix/workspace.rs:1117 — doc/src/autofix/workspace.rs:1117-1125 | doc/src/autofix/workspace.rs:1136-1144 | doc/src/autofix/workspace.rs:1222-1231 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/workspace.rs:1117` it begins part-way through the construct above it, so those exact lines 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) doc/src/codegen/v2/lang_crystal/types.rs:354 — doc/src/codegen/v2/lang_crystal/types.rs:354-362 | doc/src/codegen/v2/lang_odin/types.rs:300-308 | doc/src/codegen/v2/lang_v/types.rs:310-318 — `doc/src/codegen/v2/lang_crystal/types.rs` and `doc/src/codegen/v2/lang_odin/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 52 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_crystal/types.rs:354` it begins part-way through the construct above it, so those 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, `doc/src/codegen/v2/lang_v/types.rs:309` calls `line` and `doc/src/codegen/v2/lang_crystal/types.rs:353` 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.
D1 · Cyclomatic Complexity · LayoutWindow · ×21
  • LayoutWindow::layout_dom_recursive_impl (cyclomatic 89) layout/src/window.rs:5543 — LayoutWindow::layout_dom_recursive_impl has cyclomatic complexity 89 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • LayoutWindow::apply_text_tweens (cyclomatic 64) layout/src/window.rs:8915 — LayoutWindow::apply_text_tweens has cyclomatic complexity 64 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • LayoutWindow::reshape_text_node (cyclomatic 59) layout/src/window.rs:17383 — LayoutWindow::reshape_text_node 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.
  • LayoutWindow::process_accessibility_action (cyclomatic 46) layout/src/window.rs:15882 — LayoutWindow::process_accessibility_action has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • LayoutWindow::process_mouse_click_for_selection (cyclomatic 43) layout/src/window.rs:19366 — LayoutWindow::process_mouse_click_for_selection has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • LayoutWindow::begin_reconciliation (cyclomatic 36) layout/src/window.rs:10861 — LayoutWindow::begin_reconciliation has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • LayoutWindow::tick_animations (cyclomatic 35) layout/src/window.rs:11609 — LayoutWindow::tick_animations has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • LayoutWindow::layout_and_generate_display_list_impl (cyclomatic 32) layout/src/window.rs:2306 — LayoutWindow::layout_and_generate_display_list_impl 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.
  • LayoutWindow::run_track_frames (cyclomatic 29) layout/src/window.rs:13918 — LayoutWindow::run_track_frames 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.
  • LayoutWindow::composite_zombies_cpu (cyclomatic 26) layout/src/window.rs:25345 — LayoutWindow::composite_zombies_cpu 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.
  • LayoutWindow::select_next_occurrence (cyclomatic 24) layout/src/window.rs:13202 — LayoutWindow::select_next_occurrence 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.
  • LayoutWindow::apply_one_text_changeset (cyclomatic 22) layout/src/window.rs:16478 — LayoutWindow::apply_one_text_changeset has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • LayoutWindow::get_selected_content_for_clipboard (cyclomatic 21) layout/src/window.rs:20281 — LayoutWindow::get_selected_content_for_clipboard 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.
  • LayoutWindow::finalize_pending_focus_changes (cyclomatic 20) layout/src/window.rs:9890 — LayoutWindow::finalize_pending_focus_changes has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • LayoutWindow::update_a11y_tree_incremental (cyclomatic 19) layout/src/window.rs:12332 — LayoutWindow::update_a11y_tree_incremental 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.
  • LayoutWindow::apply_node_css_change (cyclomatic 18) layout/src/window.rs:7327 — LayoutWindow::apply_node_css_change has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • LayoutWindow::synchronize_scrollbar_opacity (cyclomatic 18) layout/src/window.rs:11883 — LayoutWindow::synchronize_scrollbar_opacity 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.
  • LayoutWindow::finish_reconciliation (cyclomatic 17) layout/src/window.rs:11286 — LayoutWindow::finish_reconciliation 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.
  • LayoutWindow::scroll_selection_into_view (cyclomatic 17) layout/src/window.rs:13589 — LayoutWindow::scroll_selection_into_view 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.
  • LayoutWindow::remap_node_ids (cyclomatic 17) layout/src/window.rs:20900 — LayoutWindow::remap_node_ids 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.
  • LayoutWindow::apply_seat_selection_op (cyclomatic 16) layout/src/window.rs:10474 — LayoutWindow::apply_seat_selection_op has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D2 · Cognitive Complexity · webrender · ×21
  • webrender::prepare::prepare_interned_prim_for_render (cognitive 125) webrender/core/src/prepare.rs:316 — webrender::prepare::prepare_interned_prim_for_render has cognitive complexity 125 (threshold 15). Drivers by points: if/else 32 (77 pts), loops 6 (23 pts), match/switch 7 (17 pts), boolean chains 8 (nesting depth added 72). 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.
  • webrender::quad::prepare_quad (cognitive 114) webrender/core/src/quad.rs:66 — webrender::quad::prepare_quad has cognitive complexity 114 (threshold 15). Drivers by points: if/else 27 (62 pts), match/switch 10 (31 pts), loops 7 (16 pts), boolean chains 5 (nesting depth added 65). Of this number, 111 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.
  • webrender::render_target::add_svg_filter_node_instances (cognitive 50) webrender/core/src/render_target.rs:1009 — webrender::render_target::add_svg_filter_node_instances has cognitive complexity 50 (threshold 15). Drivers by points: match/switch 45 (46 pts), if/else 2 (3 pts), loops 1 (nesting depth added 2). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • webrender::prim_store::gradient::linear::optimize_linear_gradient (cognitive 42) webrender/core/src/prim_store/gradient/linear.rs:117 — webrender::prim_store::gradient::linear::optimize_linear_gradient has cognitive complexity 42 (threshold 15). Drivers by points: if/else 22 (28 pts), boolean chains 10, match/switch 2 (3 pts), loops 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
  • webrender::render_target::build_mask_tasks (cognitive 39) webrender/core/src/render_target.rs:1340 — webrender::render_target::build_mask_tasks has cognitive complexity 39 (threshold 15). Drivers by points: if/else 17 (33 pts), loops 2 (4 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.
  • webrender::renderer::upload::upload_to_texture_cache (cognitive 38) webrender/core/src/renderer/upload.rs:49 — webrender::renderer::upload::upload_to_texture_cache has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (21 pts), match/switch 3 (9 pts), loops 4 (5 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • webrender::prim_store::gradient::radial::optimize_radial_gradient (cognitive 35) webrender/core/src/prim_store/gradient/radial.rs:387 — webrender::prim_store::gradient::radial::optimize_radial_gradient has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 9 (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.
  • webrender::visibility::update_prim_visibility (cognitive 35) webrender/core/src/visibility.rs:139 — webrender::visibility::update_prim_visibility has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 4 (10 pts), loops 3 (5 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.
  • webrender::border::add_corner_segment (cognitive 33) webrender/core/src/border.rs:1007 — webrender::border::add_corner_segment has cognitive complexity 33 (threshold 15). Drivers by points: if/else 19 (27 pts), boolean chains 3, match/switch 3 (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.
  • webrender::renderer::init::create_webrender_instance (cognitive 32) webrender/core/src/renderer/init.rs:296 — webrender::renderer::init::create_webrender_instance has cognitive complexity 32 (threshold 15). Drivers by points: if/else 21 (23 pts), boolean chains 5, match/switch 3, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • webrender::border::add_segment (cognitive 21) webrender/core/src/border.rs:882 — webrender::border::add_segment has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 3 (5 pts), boolean chains 4 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • webrender::rectangle_occlusion::apply_occluder (cognitive 21) webrender/core/src/rectangle_occlusion.rs:149 — webrender::rectangle_occlusion::apply_occluder has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webrender::frame_builder::build_render_pass (cognitive 20) webrender/core/src/frame_builder.rs:956 — webrender::frame_builder::build_render_pass has cognitive complexity 20 (threshold 15). Drivers by points: loops 4 (12 pts), match/switch 3 (8 pts) (nesting depth added 13). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • webrender::picture::get_surface_rects (cognitive 20) webrender/core/src/picture.rs:8022 — webrender::picture::get_surface_rects has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 4 (7 pts), boolean chains 2, 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.
  • webrender::quad::get_prim_render_strategy (cognitive 20) webrender/core/src/quad.rs:708 — webrender::quad::get_prim_render_strategy has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 3 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • webrender::border::write_dotted_corner_instances (cognitive 18) webrender/core/src/border.rs:369 — webrender::border::write_dotted_corner_instances has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (14 pts), loops 3, boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • webrender::filterdata::push_component_transfer_data (cognitive 18) webrender/core/src/filterdata.rs:161 — webrender::filterdata::push_component_transfer_data has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 2 (6 pts), if/else 2 (5 pts), loops 2 (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.
  • webrender::prepare::prepare_prim_for_render (cognitive 18) webrender/core/src/prepare.rs:137 — webrender::prepare::prepare_prim_for_render has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (7 pts), match/switch 3 (6 pts), boolean chains 5 (nesting depth added 6). Of this number, 17 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webrender::prepare::update_clip_task_for_brush (cognitive 18) webrender/core/src/prepare.rs:1313 — webrender::prepare::update_clip_task_for_brush has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webrender::clip::polygon_contains_point (cognitive 16) webrender/core/src/clip.rs:2128 — webrender::clip::polygon_contains_point has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • webrender::render_task_graph::dump_render_tasks_as_svg (cognitive 16) webrender/core/src/render_task_graph.rs:856 — webrender::render_task_graph::dump_render_tasks_as_svg has cognitive complexity 16 (threshold 15). Drivers by points: loops 7 (9 pts), if/else 3 (7 pts) (nesting depth added 6). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×21
  • Edited copy of a member (17 corresponding lines) dll/src/desktop/shell2/macos/mod.rs:2656 — dll/src/desktop/shell2/macos/mod.rs:2656-2756 | dll/src/desktop/shell2/macos/mod.rs:2802-2825 — 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) layout/src/cpurender/compositor.rs:1667 — layout/src/cpurender/compositor.rs:1667-1684 | layout/src/cpurender/compositor.rs:1737-1765 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:6023 — dll/src/desktop/shell2/linux/wayland/mod.rs:6023-6048 | dll/src/desktop/shell2/linux/wayland/mod.rs:6102-6118 — 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) layout/src/xml/svg.rs:1469 — layout/src/xml/svg.rs:1469-1485 | layout/src/xml/svg.rs:1494-1510 — 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) layout/src/widgets/quick_access.rs:336 — layout/src/widgets/quick_access.rs:336-352 | layout/src/widgets/statusbar.rs:359-379 — 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) doc/src/autofix/type_index.rs:1075 — doc/src/autofix/type_index.rs:1075-1095 | doc/src/autotest/mod.rs:238-254 — 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) dll/src/desktop/extra/audio/avfoundation_mic.rs:308 — dll/src/desktop/extra/audio/avfoundation_mic.rs:308-324 | dll/src/desktop/extra/audio/cpal_mic.rs:102-118 — 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) doc/src/codegen/v2/lang_perl/wrappers.rs:361 — doc/src/codegen/v2/lang_perl/wrappers.rs:361-377 | doc/src/codegen/v2/lang_ruby/functions.rs:235-262 — 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) layout/src/default_actions.rs:381 — layout/src/default_actions.rs:381-397 | layout/src/default_actions.rs:433-451 — 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) doc/src/codegen/v2/lang_node/types.rs:335 — doc/src/codegen/v2/lang_node/types.rs:335-351 | doc/src/codegen/v2/lang_node/types.rs:357-377 — 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) layout/src/text3/cache.rs:6234 — layout/src/text3/cache.rs:6234-6250 | layout/src/text3/cache.rs:6260-6276 — 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) doc/src/codegen/v2/lang_java/mod.rs:419 — doc/src/codegen/v2/lang_java/mod.rs:419-437 | doc/src/codegen/v2/lang_smalltalk/mod.rs:214-230 — 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) layout/src/widgets/combobox.rs:840 — layout/src/widgets/combobox.rs:840-857 | layout/src/widgets/date_picker.rs:1034-1050 — 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) doc/src/codegen/v2/lang_lisp/mod.rs:116 — doc/src/codegen/v2/lang_lisp/mod.rs:116-132 | doc/src/codegen/v2/lang_racket/mod.rs:107-124 — 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) dll/src/desktop/extra/geolocation/android.rs:54 — dll/src/desktop/extra/geolocation/android.rs:54-82 | dll/src/desktop/extra/geolocation/android.rs:85-101 — 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) dll/src/desktop/shell2/linux/wayland/dlopen.rs:1007 — dll/src/desktop/shell2/linux/wayland/dlopen.rs:1007-1031 | dll/src/desktop/shell2/linux/wayland/dlopen.rs:1051-1067 — 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) dll/src/desktop/shell2/linux/wayland/dlopen.rs:1123 — dll/src/desktop/shell2/linux/wayland/dlopen.rs:1123-1140 | dll/src/desktop/shell2/linux/wayland/dlopen.rs:1146-1162 — 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) webrender/core/src/renderer/mod.rs:2561 — webrender/core/src/renderer/mod.rs:2561-2577 | webrender/core/src/renderer/mod.rs:2585-2606 — 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) doc/src/gene2e.rs:2279 — doc/src/gene2e.rs:2279-2295 | doc/src/mobile/e2e.rs:316-332 — 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) doc/src/api.rs:1563 — doc/src/api.rs:1563-1588 | doc/src/api.rs:1594-1610 — 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) layout/src/solver3/fc.rs:10767 — layout/src/solver3/fc.rs:10767-10783 | layout/src/text3/cache.rs:10110-10127 — 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.
D1 · Cyclomatic Complexity · azul_core · ×20
  • azul_core::compact::apply_css_property_to_compact (cyclomatic 190) core/src/compact.rs:1305 — azul_core::compact::apply_css_property_to_compact has cyclomatic complexity 190 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_core::xml::apply_xml_node_attributes (cyclomatic 55) core/src/xml.rs:5774 — azul_core::xml::apply_xml_node_attributes has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: azul_core::xml::tag_to_node_type (cyclomatic 170) 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.
  • azul_core::compact::update_dom_declared_flags (cyclomatic 47) core/src/compact.rs:1937 — azul_core::compact::update_dom_declared_flags has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_core::diff::reconcile_dom (cyclomatic 47) core/src/diff.rs:569 — azul_core::diff::reconcile_dom has cyclomatic complexity 47 (threshold 15). Of this number, 45 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.
  • azul_core::path_parser::parse_svg_path_d (cyclomatic 39) core/src/path_parser.rs:423 — azul_core::path_parser::parse_svg_path_d has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_core::xml::analyze_node_ctor (cyclomatic 33) core/src/xml.rs:7947 — azul_core::xml::analyze_node_ctor has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: azul_core::xml::tag_to_node_type (cyclomatic 170) 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.
  • azul_core::diff::compute_node_changes (cyclomatic 27) core/src/diff.rs:175 — azul_core::diff::compute_node_changes has cyclomatic complexity 27 (threshold 15). Of this number, 26 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_core::prop_cache::clone_inheritable_property (cyclomatic 22) core/src/prop_cache.rs:1493 — azul_core::prop_cache::clone_inheritable_property has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: CssPropertyCache::resolve_property_dependency (cyclomatic 45) 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.
  • azul_core::events::handle_key_down (cyclomatic 21) core/src/events.rs:5081 — azul_core::events::handle_key_down has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: azul_core::events::matches_window_filter (cyclomatic 86) 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.
  • azul_core::xml::user_defined_render_fn (cyclomatic 21) core/src/xml.rs:2993 — azul_core::xml::user_defined_render_fn 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: azul_core::xml::tag_to_node_type (cyclomatic 170) 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.
  • azul_core::xml::group_matches (cyclomatic 21) core/src/xml.rs:7140 — azul_core::xml::group_matches has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: azul_core::xml::tag_to_node_type (cyclomatic 170) 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.
  • azul_core::xml::serde_impl::string_to_field_type (cyclomatic 21) core/src/xml.rs:2093 — azul_core::xml::serde_impl::string_to_field_type 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: azul_core::xml::tag_to_node_type (cyclomatic 170) 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.
  • azul_core::resources::build_add_font_resource_updates (cyclomatic 20) core/src/resources.rs:3669 — azul_core::resources::build_add_font_resource_updates 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.
  • azul_core::styled_dom::is_layout_equivalent (cyclomatic 20) core/src/styled_dom.rs:3281 — azul_core::styled_dom::is_layout_equivalent 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.
  • azul_core::diff::fingerprint_dom (cyclomatic 19) core/src/diff.rs:2325 — azul_core::diff::fingerprint_dom has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to 3 function items inside it that branch (node_structure_hash, node_style_hash, walk). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • azul_core::style::matches_html_element (cyclomatic 17) core/src/style.rs:63 — azul_core::style::matches_html_element 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.
  • azul_core::style::match_attribute_selector (cyclomatic 17) core/src/style.rs:563 — azul_core::style::match_attribute_selector has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • azul_core::xml::user_defined_compile_fn (cyclomatic 17) core/src/xml.rs:3180 — azul_core::xml::user_defined_compile_fn 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: azul_core::xml::tag_to_node_type (cyclomatic 170) 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.
  • azul_core::diff::calculate_reconciliation_key (cyclomatic 16) core/src/diff.rs:361 — azul_core::diff::calculate_reconciliation_key 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.
  • azul_core::diff::calculate_contenteditable_key (cyclomatic 16) core/src/diff.rs:1426 — azul_core::diff::calculate_contenteditable_key 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 · AttribLocations · ×20
  • AttribLocations::get_loc (cognitive 64) webrender/swgl/src/shaders/cs_clip_rectangle.rs:72 — AttribLocations::get_loc has cognitive complexity 64 (threshold 15). Drivers by points: if/else 48 (64 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • AttribLocations::get_loc (cognitive 41) webrender/swgl/src/shaders/cs_border_segment.rs:61 — AttribLocations::get_loc has cognitive complexity 41 (threshold 15). Drivers by points: if/else 31 (41 pts) (nesting depth added 10). 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.
  • AttribLocations::get_loc (cognitive 41) webrender/swgl/src/shaders/cs_border_solid.rs:58 — AttribLocations::get_loc has cognitive complexity 41 (threshold 15). Drivers by points: if/else 31 (41 pts) (nesting depth added 10). 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.
  • AttribLocations::get_loc (cognitive 41) webrender/swgl/src/shaders/cs_clip_box_shadow_texture_2d.rs:88 — AttribLocations::get_loc has cognitive complexity 41 (threshold 15). Drivers by points: if/else 31 (41 pts) (nesting depth added 10). 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.
  • AttribLocations::get_loc (cognitive 37) webrender/swgl/src/shaders/cs_conic_gradient.rs:49 — AttribLocations::get_loc has cognitive complexity 37 (threshold 15). Drivers by points: if/else 28 (37 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.
  • AttribLocations::get_loc (cognitive 37) webrender/swgl/src/shaders/cs_radial_gradient.rs:49 — AttribLocations::get_loc has cognitive complexity 37 (threshold 15). Drivers by points: if/else 28 (37 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.
  • AttribLocations::get_loc (cognitive 37) webrender/swgl/src/shaders/cs_svg_filter_node.rs:53 — AttribLocations::get_loc has cognitive complexity 37 (threshold 15). Drivers by points: if/else 28 (37 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.
  • AttribLocations::get_loc (cognitive 33) webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:90 — AttribLocations::get_loc has cognitive complexity 33 (threshold 15). Drivers by points: if/else 25 (33 pts) (nesting depth added 8). 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.
  • AttribLocations::get_loc (cognitive 33) webrender/swgl/src/shaders/composite_texture_rect_yuv.rs:90 — AttribLocations::get_loc has cognitive complexity 33 (threshold 15). Drivers by points: if/else 25 (33 pts) (nesting depth added 8). 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.
  • AttribLocations::get_loc (cognitive 29) webrender/swgl/src/shaders/composite_texture_rect.rs:44 — AttribLocations::get_loc has cognitive complexity 29 (threshold 15). Drivers by points: if/else 22 (29 pts) (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.
  • AttribLocations::get_loc (cognitive 29) webrender/swgl/src/shaders/cs_linear_gradient.rs:45 — AttribLocations::get_loc has cognitive complexity 29 (threshold 15). Drivers by points: if/else 22 (29 pts) (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.
  • AttribLocations::get_loc (cognitive 25) webrender/swgl/src/shaders/composite_fast_path_texture_rect.rs:39 — AttribLocations::get_loc has cognitive complexity 25 (threshold 15). Drivers by points: if/else 19 (25 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • AttribLocations::get_loc (cognitive 25) webrender/swgl/src/shaders/cs_blur_alpha_target.rs:57 — AttribLocations::get_loc has cognitive complexity 25 (threshold 15). Drivers by points: if/else 19 (25 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • AttribLocations::get_loc (cognitive 21) webrender/swgl/src/shaders/cs_fast_linear_gradient.rs:46 — AttribLocations::get_loc has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16 (21 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.
  • AttribLocations::get_loc (cognitive 19) webrender/swgl/src/shaders/cs_clip_rectangle_fast_path.rs:106 — AttribLocations::get_loc has cognitive complexity 19 (threshold 15). Drivers by points: if/else 19. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • AttribLocations::get_loc (cognitive 17) webrender/swgl/src/shaders/cs_scale_texture_2d.rs:39 — AttribLocations::get_loc has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (17 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • AttribLocations::get_loc (cognitive 17) webrender/swgl/src/shaders/cs_scale_texture_rect.rs:42 — AttribLocations::get_loc has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (17 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • AttribLocations::get_loc (cognitive 17) webrender/swgl/src/shaders/ps_copy.rs:35 — AttribLocations::get_loc has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (17 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • AttribLocations::bind_loc (cognitive 16) webrender/swgl/src/shaders/cs_clip_rectangle.rs:52 — AttribLocations::bind_loc has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • AttribLocations::bind_loc (cognitive 16) webrender/swgl/src/shaders/cs_clip_rectangle_fast_path.rs:86 — AttribLocations::bind_loc has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×20
  • Edited copy of a member (7 corresponding lines) css/src/props/basic/animation.rs:326 — css/src/props/basic/animation.rs:326-332 | css/src/props/basic/animation.rs:336-342 — 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) webrender/swgl/src/shaders/debug_color.rs:75 — webrender/swgl/src/shaders/debug_color.rs:75-81 | webrender/swgl/src/shaders/debug_font.rs:75-84 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) doc/src/codegen/v2/lang_csharp/derives.rs:473 — doc/src/codegen/v2/lang_csharp/derives.rs:473-479 | doc/src/codegen/v2/lang_node/wrappers.rs:289-296 — 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) dll/src/desktop/shell2/linux/wayland/dlopen.rs:1104 — dll/src/desktop/shell2/linux/wayland/dlopen.rs:1104-1110 | dll/src/desktop/shell2/linux/wayland/dlopen.rs:1112-1118 — 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) doc/src/reftest/autodoc.rs:149 — doc/src/reftest/autodoc.rs:149-155 | doc/src/reftest/telegram.rs:51-61 — 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) dll/src/desktop/shell2/linux/system_style.rs:3005 — dll/src/desktop/shell2/linux/system_style.rs:3005-3011 | dll/src/desktop/shell2/linux/system_style.rs:3015-3021 — 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) doc/src/codegen/v2/lang_lisp/types.rs:329 — doc/src/codegen/v2/lang_lisp/types.rs:329-337 | doc/src/codegen/v2/lang_racket/types.rs:282-288 — 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) core/src/dom.rs:3518 — core/src/dom.rs:3518-3524 | core/src/dom.rs:3526-3532 — 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) webrender/swgl/src/shaders/brush_image_texture_2d.rs:273 — webrender/swgl/src/shaders/brush_image_texture_2d.rs:273-279 | webrender/swgl/src/shaders/brush_image_texture_rect.rs:330-336 — 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) core/src/dom.rs:3504 — core/src/dom.rs:3504-3515 | core/src/dom.rs:7010-7016 — 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) core/src/geom.rs:263 — core/src/geom.rs:263-269 | core/src/geom.rs:387-395 — 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) layout/src/fluent.rs:772 — layout/src/fluent.rs:772-779 | layout/src/icu.rs:1659-1665 — 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) doc/src/codegen/v2/lang_csharp/types.rs:211 — doc/src/codegen/v2/lang_csharp/types.rs:211-217 | doc/src/codegen/v2/lang_java/types.rs:372-379 — 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) layout/src/fluent.rs:900 — layout/src/fluent.rs:900-906 | layout/src/zip.rs:557-563 — 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) doc/src/codegen/v2/lang_d/model.rs:904 — doc/src/codegen/v2/lang_d/model.rs:904-910 | doc/src/codegen/v2/lang_swift/model.rs:905-912 — 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) webrender/core/src/space.rs:90 — webrender/core/src/space.rs:90-96 | webrender/core/src/spatial_tree.rs:712-718 — 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) css/src/props/basic/animation.rs:2856 — css/src/props/basic/animation.rs:2856-2862 | css/src/props/style/background.rs:182-188 — 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) dll/src/desktop/shell2/ios/text_input.rs:123 — dll/src/desktop/shell2/ios/text_input.rs:123-131 | dll/src/desktop/shell2/macos/mod.rs:3532-3538 — 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) dll/src/desktop/extra/camera/windows.rs:182 — dll/src/desktop/extra/camera/windows.rs:182-188 | dll/src/desktop/extra/screencap/windows.rs:77-83 — 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) dll/src/desktop/extra/file_picker/ios.rs:153 — dll/src/desktop/extra/file_picker/ios.rs:153-159 | dll/src/desktop/shell2/ios/clipboard.rs:223-232 — 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 (19 lines × 2) · ×20
  • Duplicated block (19 lines × 2) core/src/resources.rs:2635 — core/src/resources.rs:2635-2653 | core/src/resources.rs:2827-2845 — both copies are in the same file, so extract the block into 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) core/src/style.rs:122 — core/src/style.rs:122-140 | core/src/style.rs:166-184 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/style.rs:122` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (19 lines × 2) dll/src/desktop/shell2/headless/mod.rs:1709 — dll/src/desktop/shell2/headless/mod.rs:1709-1727 | dll/src/desktop/shell2/headless/mod.rs:1891-1909 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/headless/mod.rs:1709` 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, `dll/src/desktop/shell2/headless/mod.rs:1738` calls `rebuild_cpu_hit_tester` and `dll/src/desktop/shell2/headless/mod.rs:1914` 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) dll/src/desktop/shell2/linux/wayland/mod.rs:3349 — dll/src/desktop/shell2/linux/wayland/mod.rs:3349-3367 | dll/src/desktop/shell2/linux/x11/mod.rs:4352-4370 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:3349` it begins part-way through the construct above it, so those exact lines 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) dll/src/desktop/shell2/linux/wayland/mod.rs:5032 — dll/src/desktop/shell2/linux/wayland/mod.rs:5032-5050 | dll/src/desktop/shell2/macos/events.rs:673-691 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/macos/events.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 142 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 `dll/src/desktop/shell2/linux/wayland/mod.rs:5032` it begins part-way through the construct above it, so those exact lines 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) dll/src/desktop/shell2/linux/wayland/mod.rs:11047 — dll/src/desktop/shell2/linux/wayland/mod.rs:11047-11065 | dll/src/desktop/shell2/linux/x11/mod.rs:8798-8816 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:11047` it begins part-way through the construct above it, so those exact lines 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) doc/src/autofix/workspace.rs:1401 — doc/src/autofix/workspace.rs:1401-1419 | doc/src/autofix/workspace.rs:1645-1663 — both copies are in the same file, so extract the block into 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) doc/src/codegen/v2/lang_c.rs:1172 — doc/src/codegen/v2/lang_c.rs:1172-1190 | doc/src/codegen/v2/lang_cpp/common.rs:245-263 — before extracting anything, compare `doc/src/codegen/v2/lang_c.rs` and `doc/src/codegen/v2/lang_cpp/common.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 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 `doc/src/codegen/v2/lang_c.rs:1172` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) doc/src/codegen/v2/lang_cpp/cpp11.rs:278 — doc/src/codegen/v2/lang_cpp/cpp11.rs:278-296 | doc/src/codegen/v2/lang_cpp/cpp17.rs:435-453 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp11.rs` and `doc/src/codegen/v2/lang_cpp/cpp17.rs` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 669 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/codegen/v2/lang_cpp/cpp11.rs:278` it begins part-way through the construct above it, so those exact lines 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) doc/src/codegen/v2/lang_rust.rs:2662 — doc/src/codegen/v2/lang_rust.rs:2662-2680 | doc/src/codegen/v2/rust/shared.rs:216-234 — before extracting anything, compare `doc/src/codegen/v2/lang_rust.rs` and `doc/src/codegen/v2/rust/shared.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 210 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 `doc/src/codegen/v2/lang_rust.rs:2662` it begins part-way through the construct above it, so those exact lines 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) doc/src/patch/index.rs:325 — doc/src/patch/index.rs:325-343 | doc/src/patch/index.rs:427-445 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/patch/index.rs:325` it does not close everything it opens, so those exact lines 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) doc/src/patch/mod.rs:1952 — doc/src/patch/mod.rs:1952-1970 | doc/src/patch/mod.rs:1974-1992 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/patch/mod.rs:1952` it begins part-way through the construct above it, so those exact lines 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) doc/src/print.rs:234 — doc/src/print.rs:234-252 | doc/src/print.rs:261-279 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/print.rs:234` it begins part-way through the construct above it, so those exact lines 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) doc/src/reftest/debug.rs:328 — doc/src/reftest/debug.rs:328-346 | doc/src/reftest/regression.rs:1634-1652 — 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 (19 lines × 2) layout/src/managers/scroll_state.rs:1489 — layout/src/managers/scroll_state.rs:1489-1507 | layout/src/managers/scroll_state.rs:1532-1550 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/managers/scroll_state.rs:1489` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (19 lines × 2) layout/src/solver3/paged_layout.rs:407 — layout/src/solver3/paged_layout.rs:407-425 | layout/src/solver3/paged_layout.rs:2653-2671 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/paged_layout.rs:407` it does not close everything it opens, so those exact lines 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) layout/src/window.rs:2041 — layout/src/window.rs:2041-2059 | layout/src/window.rs:7770-7788 — both copies are in the same file, so extract the block into 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) layout/src/window.rs:14447 — layout/src/window.rs:14447-14465 | layout/src/window.rs:14543-14561 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/window.rs:14447` it does not close everything it opens, so those exact lines 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) webrender/core/src/frame_builder.rs:1061 — webrender/core/src/frame_builder.rs:1061-1079 | webrender/core/src/render_target.rs:328-346 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `webrender/core/src/render_target.rs:326` calls `get` and `webrender/core/src/frame_builder.rs:1059` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (19 lines × 2) webrender/swgl/src/shaders/brush_blend.rs:137 — webrender/swgl/src/shaders/brush_blend.rs:137-155 | webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs:121-139 — before extracting anything, compare `webrender/swgl/src/shaders/brush_blend.rs` and `webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 244 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_blend.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. Note first that the copies are not typed on the same thing: the declarations holding them bind `context` to `&mut ShaderContext` in one and `&ShaderContext` 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 · Edited copy of a member (8 corresponding lines) · ×19
  • Edited copy of a member (8 corresponding lines) core/src/json.rs:460 — core/src/json.rs:460-467 | core/src/json.rs:475-483 — 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) webrender/swgl/src/shaders/cs_clip_rectangle.rs:282 — webrender/swgl/src/shaders/cs_clip_rectangle.rs:282-289 | webrender/swgl/src/shaders/cs_clip_rectangle_fast_path.rs:251-261 — 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) webrender/swgl/src/shaders/brush_mix_blend.rs:69 — webrender/swgl/src/shaders/brush_mix_blend.rs:69-80 | webrender/swgl/src/shaders/brush_mix_blend_alpha_pass.rs:379-386 — 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) dll/src/desktop/extra/screencap/linux.rs:607 — dll/src/desktop/extra/screencap/linux.rs:607-614 | dll/src/desktop/extra/screencap/linux.rs:618-625 — 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) webrender/swgl/src/common.rs:137 — webrender/swgl/src/common.rs:137-144 | webrender/swgl/src/common.rs:146-154 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:9890 — dll/src/desktop/shell2/linux/wayland/mod.rs:9890-9897 | dll/src/desktop/shell2/linux/wayland/mod.rs:9901-9911 — 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) doc/src/codegen/v2/lang_fortran/mod.rs:144 — doc/src/codegen/v2/lang_fortran/mod.rs:144-151 | doc/src/codegen/v2/lang_haskell/mod.rs:152-162 — 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) webrender/swgl/src/shaders/composite_texture_rect.rs:231 — webrender/swgl/src/shaders/composite_texture_rect.rs:231-247 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_glyph_transform_texture_2d.rs:279-286 — 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) webrender/glyph/src/lib.rs:185 — webrender/glyph/src/lib.rs:185-192 | webrender/glyph/src/lib.rs:349-358 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:8709 — dll/src/desktop/shell2/linux/wayland/mod.rs:8709-8716 | dll/src/desktop/shell2/linux/wayland/mod.rs:8719-8727 — 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) layout/src/text3/cache.rs:3200 — layout/src/text3/cache.rs:3200-3207 | layout/src/text3/cache.rs:3702-3709 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:1618 — dll/src/desktop/shell2/linux/wayland/mod.rs:1618-1625 | dll/src/desktop/shell2/linux/x11/mod.rs:7879-7886 — 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) dll/src/desktop/extra/gamepad/apple.rs:443 — dll/src/desktop/extra/gamepad/apple.rs:443-450 | dll/src/desktop/extra/media_keys/apple.rs:97-106 — 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) doc/src/codegen/v2/lang_odin/types.rs:349 — doc/src/codegen/v2/lang_odin/types.rs:349-356 | doc/src/codegen/v2/lang_v/types.rs:360-367 — 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) dll/src/desktop/shell2/linux/wayland/events.rs:1342 — dll/src/desktop/shell2/linux/wayland/events.rs:1342-1350 | dll/src/desktop/shell2/linux/wayland/mod.rs:10501-10508 — 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) core/src/icon.rs:397 — core/src/icon.rs:397-405 | doc/src/codegen/v2/ir_builder.rs:2653-2660 — 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) dll/src/desktop/shell2/common/cpu_compositor.rs:41 — dll/src/desktop/shell2/common/cpu_compositor.rs:41-48 | layout/src/cpurender/pixmap.rs:712-719 — 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) webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs:201 — webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs:201-208 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_texture_2d.rs:192-199 — 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) core/src/hid.rs:89 — core/src/hid.rs:89-96 | doc/src/gene2e.rs:1595-1602 — 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 (18 corresponding lines) · ×18
  • Edited copy of a member (18 corresponding lines) doc/src/codegen/v2/lang_crystal/wrappers.rs:271 — doc/src/codegen/v2/lang_crystal/wrappers.rs:271-288 | doc/src/codegen/v2/lang_crystal/wrappers.rs:291-309 — 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) webrender/swgl/src/shaders/brush_mix_blend.rs:266 — webrender/swgl/src/shaders/brush_mix_blend.rs:266-283 | webrender/swgl/src/shaders/brush_mix_blend_alpha_pass.rs:149-175 — 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) css/src/props/basic/animation.rs:445 — css/src/props/basic/animation.rs:445-482 | css/src/props/basic/animation.rs:544-561 — 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) doc/src/codegen/v2/lang_d/wrappers.rs:2296 — doc/src/codegen/v2/lang_d/wrappers.rs:2296-2313 | doc/src/codegen/v2/lang_swift/wrappers.rs:2275-2292 — 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) doc/src/reftest/debug.rs:385 — doc/src/reftest/debug.rs:385-411 | doc/src/reftest/mod.rs:571-588 — 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) layout/src/font.rs:173 — layout/src/font.rs:173-190 | layout/src/font.rs:198-219 — 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) doc/src/codegen/v2/lang_go/mod.rs:304 — doc/src/codegen/v2/lang_go/mod.rs:304-321 | doc/src/codegen/v2/lang_go/mod.rs:326-345 — 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) layout/src/widgets/color_input.rs:1423 — layout/src/widgets/color_input.rs:1423-1441 | layout/src/widgets/color_input.rs:1453-1470 — 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) doc/src/codegen/v2/lang_cpp/common.rs:1859 — doc/src/codegen/v2/lang_cpp/common.rs:1859-1878 | doc/src/codegen/v2/lang_cpp/common.rs:1944-1961 — 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) doc/src/codegen/v2/lang_haskell/wrappers.rs:1071 — doc/src/codegen/v2/lang_haskell/wrappers.rs:1071-1092 | doc/src/codegen/v2/lang_haskell/wrappers.rs:1095-1112 — 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) dll/src/web/transpiler_remill.rs:9014 — dll/src/web/transpiler_remill.rs:9014-9033 | dll/src/web/transpiler_remill.rs:9072-9089 — 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) core/src/resources.rs:1146 — core/src/resources.rs:1146-1164 | core/src/resources.rs:1180-1197 — 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) layout/src/solver3/taffy_bridge.rs:2558 — layout/src/solver3/taffy_bridge.rs:2558-2575 | layout/src/solver3/taffy_bridge.rs:2586-2603 — 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) doc/src/codegen/v2/lang_haskell/wrappers.rs:87 — doc/src/codegen/v2/lang_haskell/wrappers.rs:87-104 | doc/src/codegen/v2/lang_haskell/wrappers.rs:134-157 — 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) layout/src/window_state.rs:228 — layout/src/window_state.rs:228-246 | layout/src/window_state.rs:300-317 — 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) dll/src/desktop/shell2/macos/events.rs:415 — dll/src/desktop/shell2/macos/events.rs:415-432 | dll/src/desktop/shell2/macos/events.rs:435-456 — 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) doc/src/codegen/v2/lang_crystal/mod.rs:372 — doc/src/codegen/v2/lang_crystal/mod.rs:372-389 | doc/src/codegen/v2/lang_d/mod.rs:451-468 — 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) css/src/props/style/transform.rs:570 — css/src/props/style/transform.rs:570-587 | css/src/props/style/transform.rs:634-651 — 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 (5 lines × 3) · ×18
  • Duplicated block (5 lines × 3) core/src/diff.rs:741 — core/src/diff.rs:741-746 | core/src/diff.rs:787-791 | core/src/diff.rs:801-805 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/diff.rs:741` it begins part-way through the construct above it, so those exact lines 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) css/src/props/property.rs:1586 — css/src/props/property.rs:1586-1608 | css/src/props/property.rs:1833-1867 | css/src/props/property.rs:1874-1878 — all 3 copies are in the same file, so extract the block into one function there and call 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 (5 lines × 3) dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:187 — dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:187-191 | dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:403-407 | dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:503-507 — all 3 copies are in the same file, so extract the block into one function there and call 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) doc/src/codegen/v2/lang_cobol/types.rs:136 — doc/src/codegen/v2/lang_cobol/types.rs:136-140 | doc/src/codegen/v2/lang_cobol/types.rs:319-323 | doc/src/codegen/v2/lang_cobol/types.rs:357-361 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_cobol/types.rs:136` it begins part-way through the construct above it, so those exact lines 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) doc/src/codegen/v2/lang_crystal/model.rs:581 — doc/src/codegen/v2/lang_crystal/model.rs:581-585 | doc/src/codegen/v2/lang_d/model.rs:896-900 | doc/src/codegen/v2/lang_swift/model.rs:897-901 — `doc/src/codegen/v2/lang_crystal/model.rs` and `doc/src/codegen/v2/lang_d/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 88 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_crystal/model.rs:581` 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 × 3) layout/src/widgets/backstage.rs:387 — layout/src/widgets/backstage.rs:387-391 | layout/src/widgets/ribbon.rs:1046-1050 | layout/src/widgets/ribbon.rs:1094-1098 — before extracting anything, compare `layout/src/widgets/backstage.rs` and `layout/src/widgets/ribbon.rs` as WHOLE FILES: this scan already matched 7 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. If that is what happened, the fix is to keep one copy and have the 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, `layout/src/widgets/ribbon.rs:1052` calls `simple`, `const_min_width`, `const_px` and `layout/src/widgets/ribbon.rs:1100` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 3) layout/src/widgets/ribbon.rs:949 — layout/src/widgets/ribbon.rs:949-953 | layout/src/widgets/ribbon.rs:1047-1051 | layout/src/widgets/ribbon.rs:1095-1099 — all 3 copies are in the same file, so extract the block into one function there and call 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, `layout/src/widgets/ribbon.rs:1046` calls `simple`, `const_align_items` and `layout/src/widgets/ribbon.rs:948` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 3) layout/src/widgets/ribbon.rs:999 — layout/src/widgets/ribbon.rs:999-1003 | layout/src/widgets/ribbon.rs:1181-1185 | layout/src/widgets/ribbon.rs:1224-1228 — all 3 copies are in the same file, so extract the block into one function there and call 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, `layout/src/widgets/ribbon.rs:1004` calls `simple`, `const_height`, `const_px` and `layout/src/widgets/ribbon.rs:1186` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 3) dll/src/desktop/extra/audio/mod.rs:211 — dll/src/desktop/extra/audio/mod.rs:211-215 | dll/src/desktop/extra/video_codec/mod.rs:313-317 | dll/src/desktop/extra/video_codec/mod.rs:463-467 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (5 lines × 3) doc/src/codegen/v2/lang_swift/wrappers.rs:2907 — doc/src/codegen/v2/lang_swift/wrappers.rs:2907-2911 | doc/src/codegen/v2/lang_swift/wrappers.rs:2929-2933 | doc/src/codegen/v2/lang_swift/wrappers.rs:2952-2958 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_swift/wrappers.rs:2907` it begins part-way through the construct above it, so those exact lines 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) doc/src/reftest/autodebug.rs:2184 — doc/src/reftest/autodebug.rs:2184-2189 | doc/src/reftest/autoreview.rs:1131-1135 | doc/src/reftest/autoreview.rs:1570-1574 — before extracting anything, compare `doc/src/reftest/autodebug.rs` and `doc/src/reftest/autoreview.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/reftest/autodebug.rs:2184` it begins part-way through the construct above it, so those exact lines 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) doc/src/codegen/v2/lang_freebasic/types.rs:328 — doc/src/codegen/v2/lang_freebasic/types.rs:328-332 | doc/src/codegen/v2/lang_nim/types.rs:414-418 | doc/src/codegen/v2/lang_vb6/types.rs:320-324 — `doc/src/codegen/v2/lang_freebasic/types.rs` and `doc/src/codegen/v2/lang_vb6/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 114 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (5 lines × 3) dll/src/desktop/shell2/linux/wayland/events.rs:2594 — dll/src/desktop/shell2/linux/wayland/events.rs:2594-2598 | dll/src/desktop/shell2/linux/x11/mod.rs:1531-1535 | layout/src/fetch.rs:163-167 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/events.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 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 `dll/src/desktop/shell2/linux/wayland/events.rs:2594` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 3) doc/src/autofix/type_index.rs:1117 — doc/src/autofix/type_index.rs:1117-1121 | doc/src/autofix/type_index.rs:1218-1222 | doc/src/autotest/extract.rs:92-96 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (5 lines × 3) layout/src/cpurender/compositor.rs:2393 — layout/src/cpurender/compositor.rs:2393-2397 | layout/src/cpurender/compositor.rs:2437-2441 | layout/src/cpurender/compositor.rs:2449-2453 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/cpurender/compositor.rs:2393` 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 × 3) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:211 — webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:211-215 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:221-225 | webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:162-166 — before extracting anything, compare `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs` and `webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 326 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (5 lines × 3) webrender/swgl/src/shaders/composite_fast_path_texture_2d.rs:79 — webrender/swgl/src/shaders/composite_fast_path_texture_2d.rs:79-83 | webrender/swgl/src/shaders/composite_texture_2d.rs:79-83 | webrender/swgl/src/shaders/composite_texture_rect.rs:86-90 — before extracting anything, compare `webrender/swgl/src/shaders/composite_fast_path_texture_2d.rs` and `webrender/swgl/src/shaders/composite_texture_2d.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 3) webrender/swgl/src/shaders/composite_fast_path_texture_2d.rs:102 — webrender/swgl/src/shaders/composite_fast_path_texture_2d.rs:102-106 | webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:241-245 | webrender/swgl/src/shaders/composite_texture_rect_yuv.rs:235-239 — before extracting anything, compare `webrender/swgl/src/shaders/composite_texture_2d_yuv.rs` and `webrender/swgl/src/shaders/composite_texture_rect_yuv.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 178 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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, `webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:238` calls `add` and `webrender/swgl/src/shaders/composite_fast_path_texture_2d.rs:101` 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.
D2 · Cognitive Complexity · WaylandWindow · ×17
  • WaylandWindow::generate_frame_if_needed (cognitive 409) dll/src/desktop/shell2/linux/wayland/mod.rs:7011 — WaylandWindow::generate_frame_if_needed has cognitive complexity 409 (threshold 15). Drivers by points: if/else 90 (309 pts), loops 9 (68 pts), match/switch 5 (17 pts), boolean chains 15 (nesting depth added 290). 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.
  • WaylandWindow::new (cognitive 99) dll/src/desktop/shell2/linux/wayland/mod.rs:1972 — WaylandWindow::new has cognitive complexity 99 (threshold 15). Drivers by points: if/else 43 (78 pts), match/switch 6 (14 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • WaylandWindow::wait_for_events (cognitive 58) dll/src/desktop/shell2/linux/wayland/mod.rs:2971 — WaylandWindow::wait_for_events has cognitive complexity 58 (threshold 15). Drivers by points: if/else 22 (41 pts), boolean chains 9, loops 4 (8 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • WaylandWindow::handle_pointer_button (cognitive 47) dll/src/desktop/shell2/linux/wayland/mod.rs:4438 — WaylandWindow::handle_pointer_button has cognitive complexity 47 (threshold 15). Drivers by points: if/else 19 (37 pts), match/switch 4 (6 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.
  • WaylandWindow::handle_key (cognitive 46) dll/src/desktop/shell2/linux/wayland/mod.rs:3450 — WaylandWindow::handle_key has cognitive complexity 46 (threshold 15). Drivers by points: if/else 20 (36 pts), boolean chains 6, match/switch 3 (4 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • WaylandWindow::set_cursor_for (cognitive 33) dll/src/desktop/shell2/linux/wayland/mod.rs:8284 — WaylandWindow::set_cursor_for has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (24 pts), match/switch 7 (8 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.
  • WaylandWindow::set_prevent_system_sleep (cognitive 33) dll/src/desktop/shell2/linux/wayland/mod.rs:10845 — WaylandWindow::set_prevent_system_sleep has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (25 pts), match/switch 5 (8 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • WaylandWindow::sync_window_state (cognitive 29) dll/src/desktop/shell2/linux/wayland/mod.rs:6656 — WaylandWindow::sync_window_state has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (20 pts), match/switch 5 (9 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.
  • WaylandWindow::handle_tablet_frame (cognitive 28) dll/src/desktop/shell2/linux/wayland/mod.rs:4259 — WaylandWindow::handle_tablet_frame has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 8 (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.
  • WaylandWindow::handle_seat_pointer_button (cognitive 28) dll/src/desktop/shell2/linux/wayland/mod.rs:6124 — WaylandWindow::handle_seat_pointer_button has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 4, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • WaylandWindow::handle_seat_key (cognitive 26) dll/src/desktop/shell2/linux/wayland/mod.rs:5312 — WaylandWindow::handle_seat_key has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 4, match/switch 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • WaylandWindow::drop (cognitive 25) dll/src/desktop/shell2/linux/wayland/mod.rs:8509 — WaylandWindow::drop has cognitive complexity 25 (threshold 15). Drivers by points: if/else 22 (23 pts), loops 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • WaylandWindow::send_surrounding_text (cognitive 24) dll/src/desktop/shell2/linux/wayland/mod.rs:10323 — WaylandWindow::send_surrounding_text has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 8 (17 pts), if/else 1 (4 pts), loops 1 (3 pts) (nesting depth added 14). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • WaylandWindow::handle_process_event_result (cognitive 21) dll/src/desktop/shell2/linux/wayland/mod.rs:3716 — WaylandWindow::handle_process_event_result has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 1 (3 pts), match/switch 1 (nesting depth added 14). 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.
  • WaylandWindow::handle_tablet_frame_for_seat (cognitive 19) dll/src/desktop/shell2/linux/wayland/mod.rs:4170 — WaylandWindow::handle_tablet_frame_for_seat has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (17 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.
  • WaylandWindow::dispatch_scroll_delta (cognitive 19) dll/src/desktop/shell2/linux/wayland/mod.rs:4944 — WaylandWindow::dispatch_scroll_delta has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (18 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.
  • WaylandWindow::apply_seat_text_input_done (cognitive 17) dll/src/desktop/shell2/linux/wayland/mod.rs:10692 — WaylandWindow::apply_seat_text_input_done has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D3 · God Classes · TooManyFields · ×17
  • TooManyFields: Wayland dll/src/desktop/shell2/linux/wayland/dlopen.rs:24 — TooManyFields — 145 stored fields beside 1 method. The bar is 30 stored fields; this is 115 over it, 4.83× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: WaylandWindow dll/src/desktop/shell2/linux/wayland/mod.rs:544 — TooManyFields — 122 stored fields beside 132 methods. The bar is 30 stored fields; this is 92 over it, 4.07× 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: LayoutWindow layout/src/window.rs:1184 — TooManyFields — 104 stored fields beside 322 methods. The bar is 30 stored fields; this is 74 over it, 3.47× 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: Xlib dll/src/desktop/shell2/linux/x11/dlopen.rs:91 — TooManyFields — 84 stored fields beside 1 method. The bar is 30 stored fields; this is 54 over it, 2.80× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: User32Functions dll/src/desktop/shell2/windows/dlopen.rs:595 — TooManyFields — 74 stored fields. The bar is 30 stored fields; this is 44 over it, 2.47× 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: X11Window dll/src/desktop/shell2/linux/x11/mod.rs:2593 — TooManyFields — 72 stored fields beside 84 methods. The bar is 30 stored fields; this is 42 over it, 2.40× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: Renderer webrender/core/src/renderer/mod.rs:761 — TooManyFields — 63 stored fields beside 86 methods. The bar is 30 stored fields; this is 33 over it, 2.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: VtLib dll/src/desktop/extra/video_codec/videotoolbox.rs:115 — TooManyFields — 50 stored fields beside 1 method. The bar is 30 stored fields; this is 20 over it, 1.67× 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: WebRenderOptions webrender/core/src/renderer/init.rs:122 — TooManyFields — 48 stored fields. The bar is 30 stored fields; this is 18 over it, 1.60× 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: RibbonStyle layout/src/widgets/ribbon.rs:1643 — TooManyFields — 45 stored fields beside 49 methods. The bar is 30 stored fields; this is 15 over it, 1.50× 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: TileCacheInstance webrender/core/src/picture.rs:1689 — TooManyFields — 44 stored fields beside 18 methods. The bar is 30 stored fields; this is 14 over it, 1.47× 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: WaylandTheme core/src/window.rs:2046 — TooManyFields — 44 stored fields. The bar is 30 stored fields; this is 14 over it, 1.47× 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: Device webrender/core/src/device/gl.rs:1076 — TooManyFields — 40 stored fields beside 133 methods. The bar is 30 stored fields; this is 10 over it, 1.33× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: Win32Window dll/src/desktop/shell2/windows/mod.rs:147 — TooManyFields — 39 stored fields beside 62 methods. The bar is 30 stored fields; this is 9 over it, 1.30× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: UnifiedConstraints layout/src/text3/cache.rs:2280 — TooManyFields — 37 stored fields beside 3 methods. The bar is 30 stored fields; this is 7 over it, 1.23× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: Shaders webrender/core/src/renderer/shade.rs:572 — TooManyFields — 35 stored fields beside 7 methods. The bar is 30 stored fields; this is 5 over it, 1.17× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: MacOSWindow dll/src/desktop/shell2/macos/mod.rs:4009 — TooManyFields — 33 stored fields beside 99 methods. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×17
  • Edited copy of a member (19 corresponding lines) dll/src/desktop/shell2/linux/wayland/events.rs:2593 — dll/src/desktop/shell2/linux/wayland/events.rs:2593-2611 | dll/src/desktop/shell2/linux/x11/mod.rs:1530-1548 — 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) css/src/shape_parser.rs:99 — css/src/shape_parser.rs:99-117 | css/src/shape_parser.rs:124-145 — 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) layout/src/widgets/camera.rs:341 — layout/src/widgets/camera.rs:341-360 | layout/src/widgets/screencap.rs:306-324 — 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) webrender/core/src/render_api.rs:1002 — webrender/core/src/render_api.rs:1002-1022 | webrender/core/src/render_api.rs:1029-1047 — 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) layout/src/solver3/getters.rs:4349 — layout/src/solver3/getters.rs:4349-4372 | layout/src/solver3/getters.rs:4388-4406 — 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) doc/src/codegen/v2/lang_d/types.rs:187 — doc/src/codegen/v2/lang_d/types.rs:187-205 | doc/src/codegen/v2/lang_zig/c_decls.rs:347-366 — 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) layout/src/widgets/quick_access.rs:268 — layout/src/widgets/quick_access.rs:268-286 | layout/src/widgets/statusbar.rs:289-309 — 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) webrender/core/src/scene_building.rs:2621 — webrender/core/src/scene_building.rs:2621-2639 | webrender/core/src/scene_building.rs:2646-2666 — 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) dll/src/desktop/shell2/linux/system_style.rs:614 — dll/src/desktop/shell2/linux/system_style.rs:614-632 | dll/src/desktop/shell2/linux/system_style.rs:1147-1165 — 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) layout/src/cpurender/raster.rs:3372 — layout/src/cpurender/raster.rs:3372-3390 | layout/src/solver3/getters.rs:5207-5228 — 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) dll/src/desktop/shell2/macos/mod.rs:8879 — dll/src/desktop/shell2/macos/mod.rs:8879-8901 | dll/src/desktop/shell2/macos/mod.rs:8904-8922 — 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) doc/src/codegen/v2/lang_haskell/mod.rs:109 — doc/src/codegen/v2/lang_haskell/mod.rs:109-127 | doc/src/codegen/v2/lang_ocaml/mod.rs:717-748 — 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) dll/src/desktop/shell2/ios/mod.rs:2137 — dll/src/desktop/shell2/ios/mod.rs:2137-2155 | dll/src/desktop/shell2/ios/text_input.rs:473-495 — 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) dll/src/desktop/shell2/ios/text_input.rs:676 — dll/src/desktop/shell2/ios/text_input.rs:676-694 | dll/src/desktop/shell2/ios/text_input.rs:696-715 — 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) dll/src/desktop/shell2/linux/wayland/dlopen.rs:1167 — dll/src/desktop/shell2/linux/wayland/dlopen.rs:1167-1185 | dll/src/desktop/shell2/linux/wayland/dlopen.rs:1193-1217 — 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) layout/src/dialogs/gpu_check.rs:79 — layout/src/dialogs/gpu_check.rs:79-97 | layout/src/dialogs/update_version.rs:80-101 — 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) webrender/api/src/display_list.rs:1902 — webrender/api/src/display_list.rs:1902-1921 | webrender/api/src/display_list.rs:2039-2057 — 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 (7 lines × 4) · ×17
  • Duplicated block (7 lines × 4) dll/src/desktop/shell2/linux/wayland/mod.rs:7526 — dll/src/desktop/shell2/linux/wayland/mod.rs:7526-7532 | dll/src/desktop/shell2/linux/x11/mod.rs:6583-6589 | dll/src/desktop/shell2/macos/mod.rs:8081-8087 | dll/src/desktop/shell2/windows/mod.rs:1199-1205 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:7526` it does not close everything it opens, so those 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, `dll/src/desktop/shell2/linux/x11/mod.rs:6580` calls `elapsed`, `as_secs_f64` and `dll/src/desktop/shell2/windows/mod.rs:1196` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 4) doc/src/autofix/type_index.rs:2027 — doc/src/autofix/type_index.rs:2027-2033 | doc/src/autofix/type_index.rs:2045-2051 | doc/src/autofix/type_index.rs:2204-2210 | doc/src/autofix/type_index.rs:2240-2246 — 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 `doc/src/autofix/type_index.rs:2027` it does not close everything it opens, so those exact lines 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) doc/src/codegen/v2/ir_builder.rs:1128 — doc/src/codegen/v2/ir_builder.rs:1128-1134 | doc/src/codegen/v2/ir_builder.rs:1246-1252 | doc/src/codegen/v2/ir_builder.rs:1416-1422 | doc/src/codegen/v2/ir_builder.rs:1464-1470 — 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) doc/src/codegen/v2/lang_cpp/cpp03.rs:38 — doc/src/codegen/v2/lang_cpp/cpp03.rs:38-50 | doc/src/codegen/v2/lang_cpp/cpp11.rs:38-52 | doc/src/codegen/v2/lang_cpp/cpp14.rs:32-38 | doc/src/codegen/v2/lang_cpp/cpp17.rs:37-50 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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, `doc/src/codegen/v2/lang_cpp/cpp03.rs:33` calls `push_str`, `generate_cpp03_move_docs` and `doc/src/codegen/v2/lang_cpp/cpp14.rs:27` 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) layout/src/text3/edit.rs:557 — layout/src/text3/edit.rs:557-567 | layout/src/text3/edit.rs:628-634 | layout/src/text3/edit.rs:822-829 | layout/src/text3/edit.rs:955-962 — 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 `layout/src/text3/edit.rs:557` it does not close everything it opens, so those exact lines 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) layout/src/widgets/alert.rs:258 — layout/src/widgets/alert.rs:258-264 | layout/src/widgets/badge.rs:163-169 | layout/src/widgets/chip.rs:273-279 | layout/src/widgets/toast.rs:281-287 — before extracting anything, compare `layout/src/widgets/alert.rs` and `layout/src/widgets/toast.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `layout/src/widgets/alert.rs:258` it does not close everything it opens, so those 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, `layout/src/widgets/badge.rs:170` calls `simple`, `const_justify_content` and `layout/src/widgets/alert.rs:265` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 4) layout/src/widgets/quick_access.rs:364 — layout/src/widgets/quick_access.rs:364-370 | layout/src/widgets/quick_access.rs:407-413 | layout/src/widgets/statusbar.rs:427-433 | layout/src/widgets/statusbar.rs:466-472 — before extracting anything, compare `layout/src/widgets/quick_access.rs` and `layout/src/widgets/statusbar.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 106 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `layout/src/widgets/quick_access.rs:364` it does not close everything it opens, so those 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 `t` to `&QuickAccessTheme` in one and `&StatusBarTheme` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (7 lines × 4) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:149 — webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:149-155 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:123-129 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:159-166 | webrender/swgl/src/shaders/brush_image_texture_2d.rs:122-128 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs` and `webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 251 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `context` to `&mut ShaderContext` in one and `&ShaderContext` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (7 lines × 4) css/src/system.rs:2687 — css/src/system.rs:2687-2693 | css/src/system.rs:2894-2900 | css/src/system.rs:2943-2949 | css/src/system.rs:2992-2998 — 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 `css/src/system.rs:2687` it does not close everything it opens, so those exact lines 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) dll/src/desktop/shell2/android/mod.rs:613 — dll/src/desktop/shell2/android/mod.rs:613-619 | dll/src/desktop/shell2/ios/mod.rs:2061-2067 | dll/src/desktop/shell2/linux/wayland/mod.rs:10117-10123 | dll/src/desktop/shell2/windows/mod.rs:7426-7432 — `dll/src/desktop/shell2/android/mod.rs` and `dll/src/desktop/shell2/ios/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 17 separate duplicated blocks between them, totalling at least 242 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/android/mod.rs:613` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 4) doc/src/codegen/v2/lang_ada/wrappers.rs:101 — doc/src/codegen/v2/lang_ada/wrappers.rs:101-107 | doc/src/codegen/v2/lang_ocaml/wrappers.rs:251-257 | doc/src/codegen/v2/lang_perl/wrappers.rs:71-77 | doc/src/codegen/v2/lang_ruby/wrappers.rs:251-257 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
  • Duplicated block (7 lines × 4) doc/src/codegen/v2/lang_csharp/managed.rs:800 — doc/src/codegen/v2/lang_csharp/managed.rs:800-806 | doc/src/codegen/v2/lang_java/managed.rs:393-399 | doc/src/codegen/v2/lang_kotlin/managed.rs:958-964 | doc/src/codegen/v2/lang_node/managed.rs:753-759 — `doc/src/codegen/v2/lang_java/managed.rs` and `doc/src/codegen/v2/lang_kotlin/managed.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 34 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (7 lines × 4) layout/src/widgets/quick_access.rs:684 — layout/src/widgets/quick_access.rs:684-690 | layout/src/widgets/ribbon.rs:2823-2829 | layout/src/widgets/ribbon.rs:3024-3030 | layout/src/widgets/statusbar.rs:1059-1065 — before extracting anything, compare `layout/src/widgets/quick_access.rs` and `layout/src/widgets/ribbon.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `layout/src/widgets/quick_access.rs:684` it begins part-way through the construct above it, so those exact lines 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) layout/src/managers/geolocation.rs:307 — layout/src/managers/geolocation.rs:307-313 | layout/src/managers/geolocation.rs:326-332 | layout/src/managers/hid.rs:80-86 | layout/src/managers/sensors.rs:188-194 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (7 lines × 4) doc/src/codegen/v2/lang_freebasic/functions.rs:123 — doc/src/codegen/v2/lang_freebasic/functions.rs:123-131 | doc/src/codegen/v2/lang_freebasic/types.rs:368-374 | doc/src/codegen/v2/lang_freebasic/wrappers.rs:434-440 | doc/src/codegen/v2/lang_pascal/functions.rs:178-184 — before extracting anything, compare `doc/src/codegen/v2/lang_freebasic/functions.rs` and `doc/src/codegen/v2/lang_freebasic/types.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/codegen/v2/lang_freebasic/functions.rs:123` 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 × 4) doc/src/codegen/v2/lang_haskell/functions.rs:78 — doc/src/codegen/v2/lang_haskell/functions.rs:78-84 | doc/src/codegen/v2/lang_haskell/functions.rs:106-112 | doc/src/codegen/v2/lang_haskell/functions.rs:245-251 | doc/src/codegen/v2/lang_haskell/types.rs:296-302 — 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 `doc/src/codegen/v2/lang_haskell/functions.rs:78` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `doc/src/codegen/v2/lang_haskell/functions.rs:104` calls `line` and `doc/src/codegen/v2/lang_haskell/functions.rs:76` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 4) doc/src/main.rs:1807 — doc/src/main.rs:1807-1813 | doc/src/main.rs:1818-1824 | doc/src/main.rs:1830-1836 | doc/src/main.rs:1842-1848 — 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 `doc/src/main.rs:1807` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D2 · Cognitive Complexity · X11Window · ×16
  • X11Window::render_and_present (cognitive 177) dll/src/desktop/shell2/linux/x11/mod.rs:6380 — X11Window::render_and_present has cognitive complexity 177 (threshold 15). Drivers by points: if/else 49 (136 pts), loops 3 (27 pts), boolean chains 8, match/switch 5 (6 pts) (nesting depth added 112). 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.
  • X11Window::handle_event (cognitive 133) dll/src/desktop/shell2/linux/x11/mod.rs:4836 — X11Window::handle_event has cognitive complexity 133 (threshold 15). Drivers by points: if/else 45 (108 pts), match/switch 7 (15 pts), boolean chains 10 (nesting depth added 71). 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.
  • X11Window::new_with_resources (cognitive 74) dll/src/desktop/shell2/linux/x11/mod.rs:3227 — X11Window::new_with_resources has cognitive complexity 74 (threshold 15). Drivers by points: if/else 33 (41 pts), match/switch 13 (27 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 24). 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.
  • X11Window::wait_for_events (cognitive 49) dll/src/desktop/shell2/linux/x11/mod.rs:4486 — X11Window::wait_for_events has cognitive complexity 49 (threshold 15). Drivers by points: if/else 19 (34 pts), loops 4 (8 pts), boolean chains 7 (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.
  • X11Window::handle_mouse_button (cognitive 41) dll/src/desktop/shell2/linux/x11/events.rs:476 — X11Window::handle_mouse_button has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (29 pts), boolean chains 6, match/switch 4 (6 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • X11Window::handle_keyboard (cognitive 41) dll/src/desktop/shell2/linux/x11/events.rs:1002 — X11Window::handle_keyboard has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (26 pts), match/switch 4 (12 pts), boolean chains 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.
  • X11Window::close (cognitive 36) dll/src/desktop/shell2/linux/x11/mod.rs:3092 — X11Window::close has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (32 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • X11Window::set_prevent_system_sleep (cognitive 33) dll/src/desktop/shell2/linux/x11/mod.rs:8606 — X11Window::set_prevent_system_sleep has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (25 pts), match/switch 5 (8 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • X11Window::sync_window_state (cognitive 32) dll/src/desktop/shell2/linux/x11/mod.rs:7443 — X11Window::sync_window_state has cognitive complexity 32 (threshold 15). Drivers by points: if/else 20 (28 pts), match/switch 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • X11Window::process_pending_menu_callbacks (cognitive 29) dll/src/desktop/shell2/linux/x11/mod.rs:4340 — X11Window::process_pending_menu_callbacks has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 3 (6 pts), match/switch 3 (6 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • X11Window::handle_xdnd_client_message (cognitive 28) dll/src/desktop/shell2/linux/x11/mod.rs:5739 — X11Window::handle_xdnd_client_message has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (25 pts), loops 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • X11Window::handle_seat_key_event (cognitive 24) dll/src/desktop/shell2/linux/x11/mod.rs:1870 — X11Window::handle_seat_key_event has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (22 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.
  • X11Window::handle_scroll_input_for_seat (cognitive 22) dll/src/desktop/shell2/linux/x11/events.rs:868 — X11Window::handle_scroll_input_for_seat has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (21 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.
  • X11Window::apply_size_to_content (cognitive 22) dll/src/desktop/shell2/linux/x11/mod.rs:6006 — X11Window::apply_size_to_content has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 12). 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.
  • X11Window::handle_property_notify (cognitive 20) dll/src/desktop/shell2/linux/x11/mod.rs:7358 — X11Window::handle_property_notify has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (7 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • X11Window::apply_event_result (cognitive 18) dll/src/desktop/shell2/linux/x11/mod.rs:5616 — X11Window::apply_event_result has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×16
  • Edited copy of a member (21 corresponding lines) layout/src/widgets/backstage.rs:350 — layout/src/widgets/backstage.rs:350-373 | layout/src/widgets/backstage.rs:382-402 — 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) webrender/swgl/src/shaders/brush_blend.rs:330 — webrender/swgl/src/shaders/brush_blend.rs:330-350 | webrender/swgl/src/shaders/brush_blend_alpha_pass.rs:282-305 — 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) doc/src/codegen/v2/lang_ocaml/wrappers.rs:2571 — doc/src/codegen/v2/lang_ocaml/wrappers.rs:2571-2591 | doc/src/codegen/v2/lang_ocaml/wrappers.rs:2667-2688 — 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) doc/src/codegen/v2/lang_perl/types.rs:66 — doc/src/codegen/v2/lang_perl/types.rs:66-86 | doc/src/codegen/v2/lang_ruby/types.rs:86-106 — 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) doc/src/codegen/v2/lang_rust.rs:2325 — doc/src/codegen/v2/lang_rust.rs:2325-2345 | doc/src/codegen/v2/rust/shared.rs:14-35 — 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) layout/src/telemetry/mod.rs:619 — layout/src/telemetry/mod.rs:619-639 | layout/src/telemetry/mod.rs:668-689 — 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) layout/src/window.rs:4253 — layout/src/window.rs:4253-4273 | layout/src/window.rs:4276-4296 — 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) dll/src/desktop/shell2/linux/system_style.rs:2359 — dll/src/desktop/shell2/linux/system_style.rs:2359-2379 | dll/src/desktop/shell2/macos/system_style.rs:763-789 — 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) doc/src/codegen/v2/lang_nim/types.rs:288 — doc/src/codegen/v2/lang_nim/types.rs:288-319 | doc/src/codegen/v2/lang_nim/types.rs:391-411 — 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) dll/src/desktop/shell2/common/capability_pump.rs:232 — dll/src/desktop/shell2/common/capability_pump.rs:232-252 | dll/src/desktop/shell2/common/capability_pump.rs:271-291 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:1791 — dll/src/desktop/shell2/linux/wayland/mod.rs:1791-1817 | dll/src/desktop/shell2/linux/wayland/mod.rs:6417-6437 — 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) layout/src/solver3/getters.rs:6855 — layout/src/solver3/getters.rs:6855-6876 | layout/src/window.rs:9507-9527 — 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) layout/src/window.rs:15661 — layout/src/window.rs:15661-15682 | layout/src/window.rs:15700-15720 — 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) dll/src/desktop/shell2/linux/x11/clipboard.rs:266 — dll/src/desktop/shell2/linux/x11/clipboard.rs:266-292 | dll/src/desktop/shell2/linux/x11/clipboard.rs:295-315 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:1698 — dll/src/desktop/shell2/linux/wayland/mod.rs:1698-1718 | dll/src/desktop/shell2/linux/x11/mod.rs:7955-7975 — 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) scripts/android/NativeTextBridge.java:451 — scripts/android/NativeTextBridge.java:451-471 | scripts/android/NativeTextBridge.java:480-503 — 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 · Duplicated block (20 lines × 2) · ×16
  • Duplicated block (20 lines × 2) dll/src/desktop/extra/geolocation/ios.rs:90 — dll/src/desktop/extra/geolocation/ios.rs:90-109 | dll/src/desktop/extra/geolocation/macos.rs:84-103 — before extracting anything, compare `dll/src/desktop/extra/geolocation/ios.rs` and `dll/src/desktop/extra/geolocation/macos.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `dll/src/desktop/extra/geolocation/ios.rs:90` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:4980 — dll/src/desktop/shell2/linux/wayland/mod.rs:4980-5002 | dll/src/desktop/shell2/linux/x11/events.rs:921-940 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/events.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 263 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 `dll/src/desktop/shell2/linux/wayland/mod.rs:4980` it begins part-way through the construct above it, so those exact lines 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) doc/src/autofix/type_index.rs:2975 — doc/src/autofix/type_index.rs:2975-2994 | doc/src/autofix/type_index.rs:3030-3049 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/type_index.rs:2975` it begins part-way through the construct above it, so those exact lines 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) doc/src/codegen/v2/lang_cpp/cpp11.rs:41 — doc/src/codegen/v2/lang_cpp/cpp11.rs:41-60 | doc/src/codegen/v2/lang_cpp/cpp17.rs:40-59 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp11.rs` and `doc/src/codegen/v2/lang_cpp/cpp17.rs` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 669 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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, `doc/src/codegen/v2/lang_cpp/cpp17.rs:32` calls `push_str`, `generate_feature_docs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs:33` 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 (20 lines × 2) doc/src/codegen/v2/lang_kotlin/mod.rs:221 — doc/src/codegen/v2/lang_kotlin/mod.rs:221-240 | doc/src/codegen/v2/lang_red/mod.rs:377-396 — 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 `doc/src/codegen/v2/lang_kotlin/mod.rs:221` 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) doc/src/codegen/v2/lang_lisp/mod.rs:247 — doc/src/codegen/v2/lang_lisp/mod.rs:247-266 | doc/src/codegen/v2/lang_racket/mod.rs:199-218 — 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 `doc/src/codegen/v2/lang_lisp/mod.rs:247` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) doc/src/codegen/v2/lang_perl/functions.rs:71 — doc/src/codegen/v2/lang_perl/functions.rs:71-90 | doc/src/codegen/v2/lang_ruby/functions.rs:90-109 — `doc/src/codegen/v2/lang_perl/functions.rs` and `doc/src/codegen/v2/lang_ruby/functions.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 48 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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 (20 lines × 2) layout/src/glyph_cache.rs:369 — layout/src/glyph_cache.rs:369-388 | layout/src/glyph_cache.rs:521-540 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/glyph_cache.rs:369` it does not close everything it opens, so those exact lines 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) layout/src/glyph_cache.rs:451 — layout/src/glyph_cache.rs:451-470 | layout/src/glyph_cache.rs:585-604 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/glyph_cache.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.
  • Duplicated block (20 lines × 2) layout/src/text3/cache.rs:1481 — layout/src/text3/cache.rs:1481-1500 | layout/src/text3/cache.rs:1613-1632 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/text3/cache.rs:1481` it does not close everything it opens, so those exact lines 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) layout/src/widgets/pagination.rs:285 — layout/src/widgets/pagination.rs:285-304 | layout/src/widgets/segmented.rs:254-273 — before extracting anything, compare `layout/src/widgets/pagination.rs` and `layout/src/widgets/segmented.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `layout/src/widgets/pagination.rs:285` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) layout/src/widgets/themes/flat.rs:568 — layout/src/widgets/themes/flat.rs:568-587 | layout/src/widgets/themes/flora.rs:790-809 — before extracting anything, compare `layout/src/widgets/themes/flat.rs` and `layout/src/widgets/themes/flora.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 927 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `layout/src/widgets/themes/flat.rs:568` it does not close everything it opens, so those exact lines 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) webrender/swgl/src/shaders/ps_quad_mask_fast_path.rs:193 — webrender/swgl/src/shaders/ps_quad_mask_fast_path.rs:193-212 | webrender/swgl/src/shaders/ps_quad_textured.rs:241-260 — before extracting anything, compare `webrender/swgl/src/shaders/ps_quad_mask_fast_path.rs` and `webrender/swgl/src/shaders/ps_quad_textured.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/swgl/src/shaders/ps_quad_mask_fast_path.rs:193` it begins part-way through the construct above it, so those exact lines 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) dll/src/desktop/extra/geolocation/ios.rs:151 — dll/src/desktop/extra/geolocation/ios.rs:151-170 | dll/src/desktop/extra/geolocation/macos.rs:145-164 — before extracting anything, compare `dll/src/desktop/extra/geolocation/ios.rs` and `dll/src/desktop/extra/geolocation/macos.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (20 lines × 2) dll/src/desktop/shell2/linux/system_style.rs:3149 — dll/src/desktop/shell2/linux/system_style.rs:3149-3170 | dll/src/desktop/shell2/macos/system_style.rs:927-946 — `dll/src/desktop/shell2/linux/system_style.rs` and `dll/src/desktop/shell2/macos/system_style.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 50 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/system_style.rs:3149` 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) dll/src/desktop/shell2/linux/wayland/mod.rs:2835 — dll/src/desktop/shell2/linux/wayland/mod.rs:2835-2854 | dll/src/desktop/shell2/linux/x11/mod.rs:4167-4186 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:2835` 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, `dll/src/desktop/shell2/linux/x11/mod.rs:4160` calls `ensure_layout_window_initialized` and `dll/src/desktop/shell2/linux/wayland/mod.rs:2830` 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–10 lines × 2) · ×16
  • Duplicated block (9–10 lines × 2) core/src/diff.rs:376 — core/src/diff.rs:376-385 | core/src/diff.rs:714-722 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/diff.rs:376` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9–10 lines × 2) css/src/props/layout/dimensions.rs:159 — css/src/props/layout/dimensions.rs:159-167 | css/src/props/layout/dimensions.rs:175-184 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9–10 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:10264 — dll/src/desktop/shell2/linux/wayland/mod.rs:10264-10273 | dll/src/desktop/shell2/linux/wayland/mod.rs:10558-10566 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:10264` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9–10 lines × 2) doc/src/codegen/v2/lang_c.rs:528 — doc/src/codegen/v2/lang_c.rs:528-536 | doc/src/codegen/v2/lang_c.rs:788-797 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_c.rs:528` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9–10 lines × 2) doc/src/codegen/v2/lang_go/wrappers.rs:718 — doc/src/codegen/v2/lang_go/wrappers.rs:718-727 | doc/src/codegen/v2/lang_go/wrappers.rs:794-802 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_go/wrappers.rs:718` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9–10 lines × 2) doc/src/codegen/v2/lang_kotlin/mod.rs:758 — doc/src/codegen/v2/lang_kotlin/mod.rs:758-767 | doc/src/codegen/v2/lang_kotlin/mod.rs:1126-1134 — both copies are in the same file, so extract the 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, `doc/src/codegen/v2/lang_kotlin/mod.rs:1137` calls `iter`, `any` and `doc/src/codegen/v2/lang_kotlin/mod.rs:769` 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–10 lines × 2) doc/src/codegen/v2/lang_swift/wrappers.rs:1478 — doc/src/codegen/v2/lang_swift/wrappers.rs:1478-1487 | doc/src/codegen/v2/lang_swift/wrappers.rs:3011-3019 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_swift/wrappers.rs:1478` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9–10 lines × 2) doc/src/codegen/v2/lang_v/types.rs:207 — doc/src/codegen/v2/lang_v/types.rs:207-216 | doc/src/codegen/v2/lang_v/types.rs:301-309 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_v/types.rs:207` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9–10 lines × 2) doc/src/main.rs:974 — doc/src/main.rs:974-983 | doc/src/main.rs:1221-1229 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/main.rs:974` it does not close everything it opens, so those 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, `doc/src/main.rs:971` calls `build` and `doc/src/main.rs:1218` 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) doc/src/reftest/autodebug.rs:1091 — doc/src/reftest/autodebug.rs:1091-1100 | doc/src/reftest/autodebug.rs:1119-1127 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/reftest/autodebug.rs:1091` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9–10 lines × 2) layout/src/cpurender/pixmap.rs:819 — layout/src/cpurender/pixmap.rs:819-827 | layout/src/cpurender/pixmap.rs:866-875 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9–10 lines × 2) layout/src/probe.rs:2575 — layout/src/probe.rs:2575-2583 | layout/src/probe.rs:2605-2614 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/probe.rs:2575` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9–10 lines × 2) layout/src/widgets/node_graph.rs:1464 — layout/src/widgets/node_graph.rs:1464-1472 | layout/src/widgets/node_graph.rs:1900-1909 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/widgets/node_graph.rs:1900` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9–10 lines × 2) layout/src/widgets/titlebar.rs:227 — layout/src/widgets/titlebar.rs:227-235 | layout/src/widgets/titlebar.rs:301-310 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9–10 lines × 2) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:403 — webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:403-412 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:330-338 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs` and `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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.
  • Duplicated block (9–10 lines × 2) webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs:119 — webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs:119-128 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_glyph_transform_texture_2d.rs:102-110 — before extracting anything, compare `webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs` and `webrender/swgl/src/shaders/ps_text_run_alpha_pass_glyph_transform_texture_2d.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 139 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D2 · Cognitive Complexity · azul_css · ×15
  • azul_css::parser2::new_from_str_inner (cognitive 165) css/src/parser2.rs:1465 — azul_css::parser2::new_from_str_inner has cognitive complexity 165 (threshold 15). Drivers by points: if/else 40 (122 pts), loops 5 (22 pts), match/switch 6 (17 pts), boolean chains 4 (nesting depth added 110). Of this number, 160 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • azul_css::props::property::parse_combined_css_property (cognitive 59) css/src/props/property.rs:3689 — azul_css::props::property::parse_combined_css_property has cognitive complexity 59 (threshold 15). Drivers by points: if/else 20 (42 pts), match/switch 8 (12 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 28). 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.
  • azul_css::props::style::background::parser::parse_gradient (cognitive 36) css/src/props/style/background.rs:1361 — azul_css::props::style::background::parser::parse_gradient has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 5 (11 pts), boolean chains 1, match/switch 1 (nesting depth added 17). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • azul_css::props::basic::animation::parse_style_animation (cognitive 34) css/src/props/basic/animation.rs:2720 — azul_css::props::basic::animation::parse_style_animation has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (30 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_css::props::style::background::parser::get_normalized_linear_stops (cognitive 33) css/src/props/style/background.rs:1729 — azul_css::props::style::background::parser::get_normalized_linear_stops has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 5 (9 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (azul_css::props::style::background::parser::get_normalized_radial_stops) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • azul_css::props::style::background::parser::get_normalized_radial_stops (cognitive 33) css/src/props/style/background.rs:1739 — azul_css::props::style::background::parser::get_normalized_radial_stops has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 5 (9 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (azul_css::props::style::background::parser::get_normalized_linear_stops) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • azul_css::parser2::parse_media_feature (cognitive 30) css/src/parser2.rs:1186 — azul_css::parser2::parse_media_feature has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 2, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_css::system::detect_linux_desktop_env (cognitive 29) css/src/system.rs:1920 — azul_css::system::detect_linux_desktop_env has cognitive complexity 29 (threshold 15). Drivers by points: if/else 24 (26 pts), boolean chains 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
  • azul_css::props::layout::grid::parse_grid_template_areas (cognitive 26) css/src/props/layout/grid.rs:1393 — azul_css::props::layout::grid::parse_grid_template_areas has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 6 (9 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_css::parser2::parse_declaration_resilient (cognitive 25) css/src/parser2.rs:2070 — azul_css::parser2::parse_declaration_resilient has cognitive complexity 25 (threshold 15). Drivers by points: match/switch 5 (14 pts), if/else 8 (11 pts) (nesting depth added 12). 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.
  • azul_css::props::layout::grid::parse_grid_track_owned (cognitive 19) css/src/props/layout/grid.rs:490 — azul_css::props::layout::grid::parse_grid_track_owned has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_css::props::style::transform::parse_style_transform (cognitive 19) css/src/props/style/transform.rs:766 — azul_css::props::style::transform::parse_style_transform has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 3 (4 pts), boolean chains 2 (nesting depth added 6). Of this number, 17 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_css::props::layout::dimensions::parse_calc_expression (cognitive 18) css/src/props/layout/dimensions.rs:104 — azul_css::props::layout::dimensions::parse_calc_expression has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_css::parser2::parse_media_conditions (cognitive 17) css/src/parser2.rs:1136 — azul_css::parser2::parse_media_conditions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • azul_css::props::style::border::parse_border_side (cognitive 17) css/src/props/style/border.rs:386 — azul_css::props::style::border::parse_border_side has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Edited copy of a member (24 corresponding lines) · ×15
  • Edited copy of a member (24 corresponding lines) webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:135 — webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:135-159 | webrender/swgl/src/shaders/composite_texture_rect_yuv.rs:135-158 — 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) dll/src/desktop/extra/camera/windows.rs:131 — dll/src/desktop/extra/camera/windows.rs:131-161 | dll/src/desktop/extra/screencap/windows.rs:52-75 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:3914 — dll/src/desktop/shell2/linux/wayland/mod.rs:3914-3937 | dll/src/desktop/shell2/linux/wayland/mod.rs:3946-3972 — 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) dll/src/desktop/shell2/linux/wayland/gl.rs:374 — dll/src/desktop/shell2/linux/wayland/gl.rs:374-397 | dll/src/desktop/shell2/linux/x11/gl.rs:362-388 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:495 — dll/src/desktop/shell2/linux/wayland/mod.rs:495-518 | dll/src/desktop/shell2/linux/wayland/mod.rs:5577-5611 — 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) doc/src/patch/locatesource.rs:205 — doc/src/patch/locatesource.rs:205-236 | doc/src/patch/locatesource.rs:393-416 — 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) doc/src/autotest/extract.rs:186 — doc/src/autotest/extract.rs:186-209 | doc/src/autotest/extract.rs:212-235 — 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) doc/src/codegen/v2/lang_csharp/types.rs:274 — doc/src/codegen/v2/lang_csharp/types.rs:274-304 | doc/src/codegen/v2/lang_lisp/types.rs:151-174 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:5964 — dll/src/desktop/shell2/linux/wayland/mod.rs:5964-6000 | dll/src/desktop/shell2/linux/wayland/mod.rs:6077-6100 — 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) core/src/xml.rs:4274 — core/src/xml.rs:4274-4299 | core/src/xml.rs:4452-4475 — 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) doc/src/codegen/v2/lang_java/derives.rs:370 — doc/src/codegen/v2/lang_java/derives.rs:370-397 | doc/src/codegen/v2/lang_java/derives.rs:537-560 — 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) doc/src/codegen/v2/config.rs:515 — doc/src/codegen/v2/config.rs:515-538 | doc/src/codegen/v2/config.rs:785-816 — 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) css/src/props/style/background.rs:1479 — css/src/props/style/background.rs:1479-1502 | css/src/props/style/background.rs:1512-1535 — 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) doc/src/reftest/regression.rs:147 — doc/src/reftest/regression.rs:147-170 | doc/src/reftest/regression.rs:173-199 — 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) dll/src/desktop/shell2/macos/mod.rs:904 — dll/src/desktop/shell2/macos/mod.rs:904-929 | dll/src/desktop/shell2/macos/mod.rs:945-968 — 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 copy of a member (20 corresponding lines) · ×15
  • Edited copy of a member (20 corresponding lines) doc/src/codegen/v2/lang_d/wrappers.rs:261 — doc/src/codegen/v2/lang_d/wrappers.rs:261-280 | doc/src/codegen/v2/lang_swift/wrappers.rs:224-243 — 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) dll/src/desktop/extra/video_codec/mod.rs:706 — dll/src/desktop/extra/video_codec/mod.rs:706-725 | dll/src/desktop/extra/video_codec/mod.rs:730-754 — 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) doc/src/lint_derives.rs:1281 — doc/src/lint_derives.rs:1281-1300 | doc/src/lint_derives.rs:1305-1329 — 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) layout/src/widgets/map.rs:1455 — layout/src/widgets/map.rs:1455-1474 | layout/src/widgets/video.rs:396-416 — 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) css/src/parser2.rs:1400 — css/src/parser2.rs:1400-1419 | css/src/parser2.rs:1423-1448 — 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) doc/src/codegen/v2/lang_julia/mod.rs:83 — doc/src/codegen/v2/lang_julia/mod.rs:83-102 | doc/src/codegen/v2/lang_nim/mod.rs:91-115 — 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) css/src/props/basic/angle.rs:257 — css/src/props/basic/angle.rs:257-276 | css/src/props/basic/pixel.rs:837-856 — 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) dll/src/desktop/shell2/common/event.rs:3764 — dll/src/desktop/shell2/common/event.rs:3764-3785 | dll/src/desktop/shell2/common/event.rs:3859-3878 — 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) doc/src/codegen/v2/lang_perl/types.rs:441 — doc/src/codegen/v2/lang_perl/types.rs:441-460 | doc/src/codegen/v2/lang_ruby/types.rs:716-737 — 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) layout/src/solver3/getters.rs:1374 — layout/src/solver3/getters.rs:1374-1393 | layout/src/solver3/getters.rs:1401-1420 — 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) doc/src/codegen/v2/lang_odin/mod.rs:60 — doc/src/codegen/v2/lang_odin/mod.rs:60-80 | doc/src/codegen/v2/lang_v/mod.rs:72-91 — 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) dll/src/desktop/display.rs:434 — dll/src/desktop/display.rs:434-453 | dll/src/desktop/display.rs:863-884 — 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) doc/src/autofix/module_map.rs:479 — doc/src/autofix/module_map.rs:479-503 | doc/src/autotest/mod.rs:259-278 — 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) doc/src/codegen/v2/ir_builder.rs:2448 — doc/src/codegen/v2/ir_builder.rs:2448-2467 | doc/src/codegen/v2/ir_builder.rs:2471-2490 — 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) webrender/core/src/scene_building.rs:3226 — webrender/core/src/scene_building.rs:3226-3245 | webrender/core/src/scene_building.rs:3375-3397 — 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 · Duplicated block (11–12 lines × 2) · ×15
  • Duplicated block (11–12 lines × 2) css/src/dynamic_selector.rs:2327 — css/src/dynamic_selector.rs:2327-2337 | css/src/parser2.rs:1335-1346 — 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 `css/src/dynamic_selector.rs:2327` it does not close everything it opens, so those exact lines 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) dll/src/desktop/extra/geolocation/ios.rs:113 — dll/src/desktop/extra/geolocation/ios.rs:113-124 | dll/src/desktop/extra/geolocation/macos.rs:107-117 — before extracting anything, compare `dll/src/desktop/extra/geolocation/ios.rs` and `dll/src/desktop/extra/geolocation/macos.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `dll/src/desktop/extra/geolocation/ios.rs:113` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11–12 lines × 2) dll/src/web/symbol_table.rs:1594 — dll/src/web/symbol_table.rs:1594-1604 | dll/src/web/symbol_table.rs:1620-1631 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/web/symbol_table.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 (11–12 lines × 2) doc/src/autofix/diff.rs:650 — doc/src/autofix/diff.rs:650-661 | doc/src/autofix/diff.rs:2269-2279 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/diff.rs:650` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11–12 lines × 2) doc/src/autofix/diff.rs:1377 — doc/src/autofix/diff.rs:1377-1388 | doc/src/autofix/diff.rs:1394-1404 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/diff.rs:1377` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11–12 lines × 2) doc/src/autofix/discovery/parallel.rs:132 — doc/src/autofix/discovery/parallel.rs:132-142 | doc/src/autofix/discovery/workspace.rs:147-158 — 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 `doc/src/autofix/discovery/parallel.rs:132` it begins part-way through the construct above it, so those exact lines 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) doc/src/codegen/v2/lang_d/wrappers.rs:2076 — doc/src/codegen/v2/lang_d/wrappers.rs:2076-2086 | doc/src/codegen/v2/lang_swift/wrappers.rs:2033-2044 — `doc/src/codegen/v2/lang_d/wrappers.rs` and `doc/src/codegen/v2/lang_swift/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 27 separate duplicated blocks between them, totalling at least 281 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_d/wrappers.rs:2076` 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 × 2) doc/src/codegen/v2/lang_ruby/types.rs:257 — doc/src/codegen/v2/lang_ruby/types.rs:257-267 | doc/src/codegen/v2/lang_ruby/types.rs:494-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 `doc/src/codegen/v2/lang_ruby/types.rs:257` it begins part-way through the construct above it, so those exact lines 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) doc/src/reftest/pipeline.rs:100 — doc/src/reftest/pipeline.rs:100-111 | doc/src/reftest/pipeline.rs:457-467 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11–12 lines × 2) layout/src/cpurender/svg.rs:521 — layout/src/cpurender/svg.rs:521-531 | layout/src/xml/svg.rs:2043-2054 — `layout/src/cpurender/svg.rs` and `layout/src/xml/svg.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 36 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (11–12 lines × 2) layout/src/solver3/getters.rs:230 — layout/src/solver3/getters.rs:230-240 | layout/src/solver3/getters.rs:352-363 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/getters.rs:352` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11–12 lines × 2) layout/src/text3/edit.rs:771 — layout/src/text3/edit.rs:771-782 | layout/src/text3/edit.rs:911-921 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/text3/edit.rs:771` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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–12 lines × 2) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:469 — webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:469-479 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:460-471 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs` and `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 369 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:469` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11–12 lines × 2) webrender/swgl/src/shaders/cs_scale_texture_2d.rs:83 — webrender/swgl/src/shaders/cs_scale_texture_2d.rs:83-93 | webrender/swgl/src/shaders/cs_scale_texture_rect.rs:89-100 — before extracting anything, compare `webrender/swgl/src/shaders/cs_scale_texture_2d.rs` and `webrender/swgl/src/shaders/cs_scale_texture_rect.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 89 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/cs_scale_texture_2d.rs:83` 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, `webrender/swgl/src/shaders/cs_scale_texture_2d.rs:94` calls `texture_size`, `extend`, `xyxy` and `webrender/swgl/src/shaders/cs_scale_texture_rect.rs:103` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11–12 lines × 2) doc/src/codegen/v2/lang_c.rs:916 — doc/src/codegen/v2/lang_c.rs:916-926 | doc/src/codegen/v2/lang_c.rs:1003-1014 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_c.rs:916` 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.
D2 · Cognitive Complexity · RustGenerator · ×14
  • RustGenerator::generate_transmute_trait_impls_enum (cognitive 38) doc/src/codegen/v2/lang_rust.rs:2963 — RustGenerator::generate_transmute_trait_impls_enum has cognitive complexity 38 (threshold 15). Drivers by points: if/else 27 (33 pts), boolean chains 5 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • RustGenerator::generate_result_convenience_methods (cognitive 37) doc/src/codegen/v2/lang_rust.rs:1387 — RustGenerator::generate_result_convenience_methods has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (26 pts), match/switch 5 (10 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.
  • RustGenerator::generate_trait_impls (cognitive 36) doc/src/codegen/v2/lang_rust.rs:302 — RustGenerator::generate_trait_impls has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 6 (12 pts), match/switch 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.
  • RustGenerator::generate_method (cognitive 30) doc/src/codegen/v2/lang_rust.rs:2116 — RustGenerator::generate_method has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 8, match/switch 2 (4 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • RustGenerator::generate_transmute_trait_impls (cognitive 24) doc/src/codegen/v2/lang_rust.rs:2733 — RustGenerator::generate_transmute_trait_impls has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 8 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • RustGenerator::generate_method_body (cognitive 23) doc/src/codegen/v2/lang_rust.rs:4377 — RustGenerator::generate_method_body has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (19 pts), match/switch 2 (3 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • RustGenerator::generate_struct (cognitive 20) doc/src/codegen/v2/lang_rust.rs:2513 — RustGenerator::generate_struct has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (14 pts), loops 2 (4 pts), boolean chains 2 (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.
  • RustGenerator::generate_abi_derived_trait_impls (cognitive 20) doc/src/codegen/v2/lang_rust.rs:3586 — RustGenerator::generate_abi_derived_trait_impls has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 7 (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.
  • RustGenerator::generate_auto_from_impls (cognitive 18) doc/src/codegen/v2/lang_rust.rs:1124 — RustGenerator::generate_auto_from_impls has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, if/else 3 (6 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • RustGenerator::generate_enum (cognitive 18) doc/src/codegen/v2/lang_rust.rs:2588 — RustGenerator::generate_enum has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8, loops 3 (6 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • RustGenerator::generate_tests (cognitive 18) doc/src/codegen/v2/lang_rust.rs:4841 — RustGenerator::generate_tests has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 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.
  • RustGenerator::generate_functions (cognitive 16) doc/src/codegen/v2/lang_rust.rs:241 — RustGenerator::generate_functions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 2 (4 pts), boolean chains 2, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • RustGenerator::generate_vec_ref_convenience_methods (cognitive 16) doc/src/codegen/v2/lang_rust.rs:1888 — RustGenerator::generate_vec_ref_convenience_methods has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • RustGenerator::emit_byref_twin (cognitive 16) doc/src/codegen/v2/lang_rust.rs:4565 — RustGenerator::emit_byref_twin has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×14
  • Duplicated block (8 lines × 3) dll/src/desktop/shell2/linux/wayland/mod.rs:5163 — dll/src/desktop/shell2/linux/wayland/mod.rs:5163-5170 | dll/src/desktop/shell2/linux/wayland/mod.rs:5240-5247 | dll/src/desktop/shell2/linux/x11/mod.rs:4818-4825 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:5163` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `super) fn handle_seat_pointer_axis_stop(&mut` in one and `&mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (8 lines × 3) dll/src/desktop/tray/linux.rs:480 — dll/src/desktop/tray/linux.rs:480-487 | dll/src/desktop/tray/linux.rs:634-641 | dll/src/desktop/tray/linux.rs:838-845 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 3) doc/src/codegen/v2/lang_crystal/wrappers.rs:1037 — doc/src/codegen/v2/lang_crystal/wrappers.rs:1037-1044 | doc/src/codegen/v2/lang_d/wrappers.rs:1743-1750 | doc/src/codegen/v2/lang_swift/wrappers.rs:1719-1726 — `doc/src/codegen/v2/lang_crystal/wrappers.rs` and `doc/src/codegen/v2/lang_d/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 51 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (8 lines × 3) layout/src/cpurender/pixmap.rs:1325 — layout/src/cpurender/pixmap.rs:1325-1332 | layout/src/cpurender/pixmap.rs:1435-1442 | layout/src/cpurender/raster.rs:3842-3849 — 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 `layout/src/cpurender/pixmap.rs:1325` it begins part-way through the construct above it, so those exact lines 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) layout/src/dom_lint.rs:775 — layout/src/dom_lint.rs:775-782 | layout/src/dom_lint.rs:862-869 | layout/src/dom_lint.rs:1167-1174 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/dom_lint.rs:775` it does not close everything it opens, so those exact lines 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) layout/src/solver3/fc.rs:8890 — layout/src/solver3/fc.rs:8890-8897 | layout/src/solver3/fc.rs:9421-9431 | layout/src/solver3/fc.rs:9965-9972 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/fc.rs:8890` it does not close everything it opens, so those exact lines 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) layout/src/text3/dense.rs:1199 — layout/src/text3/dense.rs:1199-1206 | layout/src/text3/dense.rs:1299-1306 | layout/src/text3/dense.rs:1459-1466 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/text3/dense.rs:1199` it does not close everything it opens, so those exact lines 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) layout/src/widgets/node_graph.rs:1482 — layout/src/widgets/node_graph.rs:1482-1489 | layout/src/widgets/node_graph.rs:1791-1798 | layout/src/widgets/node_graph.rs:1818-1825 — all 3 copies are in the same file, so extract the block into one function there and call 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, `layout/src/widgets/node_graph.rs:1479` calls `simple`, `FontFamily`, `Exact` and `layout/src/widgets/node_graph.rs:1789` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 3) doc/src/codegen/v2/lang_csharp/wrappers.rs:162 — doc/src/codegen/v2/lang_csharp/wrappers.rs:162-169 | doc/src/codegen/v2/lang_java/wrappers.rs:1324-1331 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:151-158 — `doc/src/codegen/v2/lang_csharp/wrappers.rs` and `doc/src/codegen/v2/lang_java/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 167 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (8 lines × 3) doc/src/codegen/v2/lang_haskell/functions.rs:864 — doc/src/codegen/v2/lang_haskell/functions.rs:864-871 | doc/src/codegen/v2/lang_haskell/types.rs:1073-1080 | doc/src/codegen/v2/lang_haskell/wrappers.rs:2352-2359 — 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) webrender/swgl/src/shaders/ps_quad_mask.rs:168 — webrender/swgl/src/shaders/ps_quad_mask.rs:168-175 | webrender/swgl/src/shaders/ps_quad_mask_fast_path.rs:256-263 | webrender/swgl/src/shaders/ps_quad_textured.rs:147-154 — before extracting anything, compare `webrender/swgl/src/shaders/ps_quad_mask.rs` and `webrender/swgl/src/shaders/ps_quad_mask_fast_path.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 3) dll/src/desktop/tray/linux.rs:471 — dll/src/desktop/tray/linux.rs:471-478 | dll/src/desktop/tray/linux.rs:829-836 | dll/src/desktop/tray/linux.rs:912-919 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 3) doc/src/codegen/v2/lang_crystal/types.rs:161 — doc/src/codegen/v2/lang_crystal/types.rs:161-168 | doc/src/codegen/v2/lang_odin/types.rs:145-152 | doc/src/codegen/v2/lang_v/types.rs:150-157 — `doc/src/codegen/v2/lang_crystal/types.rs` and `doc/src/codegen/v2/lang_odin/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 52 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_crystal/types.rs:161` it does not close everything it opens, so those 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, `doc/src/codegen/v2/lang_v/types.rs:160` calls `line` and `doc/src/codegen/v2/lang_odin/types.rs:155` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 3) doc/src/autofix/mod.rs:2602 — doc/src/autofix/mod.rs:2602-2609 | doc/src/autofix/mod.rs:2658-2665 | doc/src/autofix/mod.rs:2694-2701 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/mod.rs:2602` it does not close everything it opens, so those 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 · azul_css · ×13
  • azul_css::props::property::parse_combined_css_property (cyclomatic 87) css/src/props/property.rs:3689 — azul_css::props::property::parse_combined_css_property has cyclomatic complexity 87 (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: azul_css::props::property::parse_css_property (cyclomatic 195) 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.
  • azul_css::parser2::new_from_str_inner (cyclomatic 72) css/src/parser2.rs:1465 — azul_css::parser2::new_from_str_inner has cyclomatic complexity 72 (threshold 15). Of this number, 69 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • azul_css::props::style::transform::parse_style_transform (cyclomatic 32) css/src/props/style/transform.rs:766 — azul_css::props::style::transform::parse_style_transform has cyclomatic complexity 32 (threshold 15). Of this number, 31 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, 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.
  • azul_css::parser2::parse_media_feature (cyclomatic 30) css/src/parser2.rs:1186 — azul_css::parser2::parse_media_feature 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.
  • azul_css::system::detect_linux_desktop_env (cyclomatic 28) css/src/system.rs:1920 — azul_css::system::detect_linux_desktop_env 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.
  • azul_css::props::basic::animation::parse_style_animation (cyclomatic 21) css/src/props/basic/animation.rs:2720 — azul_css::props::basic::animation::parse_style_animation 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.
  • azul_css::props::style::filter::parser::parse_style_filter (cyclomatic 21) css/src/props/style/filter.rs:707 — azul_css::props::style::filter::parser::parse_style_filter 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.
  • azul_css::props::style::background::parser::get_normalized_linear_stops (cyclomatic 18) css/src/props/style/background.rs:1729 — azul_css::props::style::background::parser::get_normalized_linear_stops 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 shape REPEATS in the file: one other method here (azul_css::props::style::background::parser::get_normalized_radial_stops) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • azul_css::props::style::background::parser::get_normalized_radial_stops (cyclomatic 18) css/src/props/style/background.rs:1739 — azul_css::props::style::background::parser::get_normalized_radial_stops 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 shape REPEATS in the file: one other method here (azul_css::props::style::background::parser::get_normalized_linear_stops) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • azul_css::props::style::effects::parse_style_object_position (cyclomatic 18) css/src/props/style/effects.rs:944 — azul_css::props::style::effects::parse_style_object_position 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. This is NOT this file's highest cyclomatic complexity: azul_css::props::style::effects::parsers::parse_style_cursor (cyclomatic 31) 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.
  • azul_css::props::style::background::parser::parse_gradient (cyclomatic 17) css/src/props/style/background.rs:1361 — azul_css::props::style::background::parser::parse_gradient 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.
  • azul_css::dynamic_selector::parse_os_at_rule_content (cyclomatic 16) css/src/dynamic_selector.rs:1453 — azul_css::dynamic_selector::parse_os_at_rule_content 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: azul_css::dynamic_selector::parse_android_version (cyclomatic 24) 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.
  • azul_css::props::layout::grid::parse_grid_template_areas (cyclomatic 16) css/src/props/layout/grid.rs:1393 — azul_css::props::layout::grid::parse_grid_template_areas 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 · DisplayListGenerator · ×13
  • DisplayListGenerator::paint_inline_content (cognitive 102) layout/src/solver3/display_list.rs:7603 — DisplayListGenerator::paint_inline_content has cognitive complexity 102 (threshold 15). Drivers by points: if/else 29 (70 pts), boolean chains 11, match/switch 4 (11 pts), loops 6 (10 pts) (nesting depth added 52). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DisplayListGenerator::generate_for_stacking_context (cognitive 57) layout/src/solver3/display_list.rs:4690 — DisplayListGenerator::generate_for_stacking_context has cognitive complexity 57 (threshold 15). Drivers by points: if/else 27 (52 pts), loops 3, boolean chains 2 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DisplayListGenerator::paint_in_flow_descendants (cognitive 53) layout/src/solver3/display_list.rs:4993 — DisplayListGenerator::paint_in_flow_descendants has cognitive complexity 53 (threshold 15). Drivers by points: if/else 24 (49 pts), loops 4 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DisplayListGenerator::paint_cursor (cognitive 45) layout/src/solver3/display_list.rs:4375 — DisplayListGenerator::paint_cursor has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (30 pts), match/switch 2 (6 pts), boolean chains 5, loops 2 (4 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.
  • DisplayListGenerator::paint_node_content_inner (cognitive 45) layout/src/solver3/display_list.rs:6665 — DisplayListGenerator::paint_node_content_inner has cognitive complexity 45 (threshold 15). Drivers by points: if/else 22 (43 pts), boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DisplayListGenerator::paint_collapsed_table_borders (cognitive 43) layout/src/solver3/display_list.rs:6372 — DisplayListGenerator::paint_collapsed_table_borders has cognitive complexity 43 (threshold 15). Drivers by points: if/else 10 (19 pts), match/switch 5 (12 pts), loops 7 (11 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.
  • DisplayListGenerator::paint_node_background_and_border_inner (cognitive 40) layout/src/solver3/display_list.rs:5889 — DisplayListGenerator::paint_node_background_and_border_inner has cognitive complexity 40 (threshold 15). Drivers by points: if/else 20 (31 pts), loops 2 (5 pts), boolean chains 4 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DisplayListGenerator::maybe_paint_placeholder_prompt (cognitive 40) layout/src/solver3/display_list.rs:6892 — DisplayListGenerator::maybe_paint_placeholder_prompt has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (31 pts), loops 3 (4 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DisplayListGenerator::paint_selections (cognitive 36) layout/src/solver3/display_list.rs:4091 — DisplayListGenerator::paint_selections has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 3 (12 pts), match/switch 1 (4 pts), boolean chains 2 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • DisplayListGenerator::paint_scrollbars (cognitive 35) layout/src/solver3/display_list.rs:7128 — DisplayListGenerator::paint_scrollbars has cognitive complexity 35 (threshold 15). Drivers by points: if/else 20 (31 pts), boolean chains 4 (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.
  • DisplayListGenerator::paint_table_items (cognitive 23) layout/src/solver3/display_list.rs:6217 — DisplayListGenerator::paint_table_items has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (10 pts), match/switch 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DisplayListGenerator::paint_table_row_and_cells (cognitive 23) layout/src/solver3/display_list.rs:6552 — DisplayListGenerator::paint_table_row_and_cells has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 14). 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.
  • DisplayListGenerator::push_node_clips (cognitive 18) layout/src/solver3/display_list.rs:5545 — DisplayListGenerator::push_node_clips has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 8 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×13
  • Edited copy of a member (22 corresponding lines) layout/src/widgets/ribbon.rs:992 — layout/src/widgets/ribbon.rs:992-1013 | layout/src/widgets/ribbon.rs:1174-1196 — 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) layout/src/window.rs:15727 — layout/src/window.rs:15727-15758 | layout/src/window.rs:15773-15794 — 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) doc/src/patch/mod.rs:144 — doc/src/patch/mod.rs:144-165 | doc/src/patch/mod.rs:178-199 — 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) layout/src/probe.rs:2574 — layout/src/probe.rs:2574-2595 | layout/src/probe.rs:2604-2630 — 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) layout/src/widgets/combobox.rs:910 — layout/src/widgets/combobox.rs:910-932 | layout/src/widgets/combobox.rs:939-960 — 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) doc/src/codegen/v2/lang_odin/mod.rs:82 — doc/src/codegen/v2/lang_odin/mod.rs:82-104 | doc/src/codegen/v2/lang_v/mod.rs:93-114 — 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) doc/src/codegen/v2/lang_haskell/mod.rs:1098 — doc/src/codegen/v2/lang_haskell/mod.rs:1098-1119 | doc/src/codegen/v2/lang_haskell/mod.rs:1125-1157 — 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) layout/src/widgets/ribbon.rs:4131 — layout/src/widgets/ribbon.rs:4131-4154 | layout/src/widgets/ribbon.rs:4221-4242 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:4748 — dll/src/desktop/shell2/linux/wayland/mod.rs:4748-4769 | dll/src/desktop/shell2/linux/x11/events.rs:705-731 — 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) doc/src/utils/string.rs:20 — doc/src/utils/string.rs:20-43 | doc/src/utils/string.rs:48-69 — 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) doc/src/codegen/v2/lang_julia/functions.rs:99 — doc/src/codegen/v2/lang_julia/functions.rs:99-120 | doc/src/codegen/v2/lang_odin/functions.rs:90-111 — 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) dll/src/web/symbol_table.rs:3016 — dll/src/web/symbol_table.rs:3016-3043 | dll/src/web/symbol_table.rs:3048-3069 — 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) layout/src/managers/gamepad.rs:164 — layout/src/managers/gamepad.rs:164-193 | layout/src/managers/geolocation.rs:232-253 — 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 (16 corresponding lines) · ×13
  • Edited copy of a member (16 corresponding lines) layout/src/document_edit.rs:332 — layout/src/document_edit.rs:332-347 | layout/src/document_edit.rs:354-372 — 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) dll/src/desktop/shell2/android/mod.rs:3520 — dll/src/desktop/shell2/android/mod.rs:3520-3535 | dll/src/desktop/shell2/android/mod.rs:3544-3559 — 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) doc/src/codegen/v2/lang_ruby/types.rs:151 — doc/src/codegen/v2/lang_ruby/types.rs:151-166 | doc/src/codegen/v2/lang_ruby/types.rs:353-369 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) layout/src/text3/cache.rs:1373 — layout/src/text3/cache.rs:1373-1388 | layout/src/text3/cache.rs:1698-1713 — 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) layout/src/text3/cache.rs:3853 — layout/src/text3/cache.rs:3853-3878 | layout/src/text3/cache.rs:4172-4187 — 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) doc/src/lint_examples.rs:594 — doc/src/lint_examples.rs:594-611 | doc/src/reftest/autoreview.rs:2666-2681 — 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) dll/src/desktop/extra/zip/mod.rs:101 — dll/src/desktop/extra/zip/mod.rs:101-116 | dll/src/desktop/extra/zip/mod.rs:120-138 — 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) dll/src/desktop/extra/permission/ios.rs:39 — dll/src/desktop/extra/permission/ios.rs:39-58 | dll/src/desktop/extra/permission/macos.rs:96-111 — 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) dll/src/web/lift_audit.rs:69 — dll/src/web/lift_audit.rs:69-84 | dll/src/web/lift_audit.rs:86-104 — 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) css/src/props/style/scrollbar.rs:606 — css/src/props/style/scrollbar.rs:606-621 | css/src/system.rs:2191-2207 — 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) doc/src/codegen/v2/lang_algol68/mod.rs:68 — doc/src/codegen/v2/lang_algol68/mod.rs:68-84 | doc/src/codegen/v2/lang_smalltalk/mod.rs:89-104 — 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) dll/src/desktop/tray/mod.rs:211 — dll/src/desktop/tray/mod.rs:211-228 | dll/src/desktop/tray/mod.rs:297-312 — 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) layout/src/telemetry/metrics.rs:599 — layout/src/telemetry/metrics.rs:599-616 | layout/src/telemetry/metrics.rs:668-683 — 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 copy of a member (6 corresponding lines) · ×13
  • Edited copy of a member (6 corresponding lines) webrender/swgl/src/shaders/cs_conic_gradient.rs:164 — webrender/swgl/src/shaders/cs_conic_gradient.rs:164-169 | webrender/swgl/src/shaders/ps_quad_conic_gradient.rs:280-286 — 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) doc/src/codegen/v2/lang_d/wrappers.rs:2375 — doc/src/codegen/v2/lang_d/wrappers.rs:2375-2380 | doc/src/codegen/v2/lang_swift/wrappers.rs:2355-2360 — 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) webrender/swgl/src/shaders/cs_clip_rectangle.rs:291 — webrender/swgl/src/shaders/cs_clip_rectangle.rs:291-296 | webrender/swgl/src/shaders/cs_clip_rectangle_fast_path.rs:244-249 — 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) webrender/swgl/src/shaders/ps_text_run_alpha_pass_texture_2d.rs:176 — webrender/swgl/src/shaders/ps_text_run_alpha_pass_texture_2d.rs:176-181 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs:185-190 — 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) dll/src/desktop/shell2/common/layout.rs:2112 — dll/src/desktop/shell2/common/layout.rs:2112-2117 | layout/src/window.rs:24711-24716 — 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) dll/src/desktop/extra/camera/windows.rs:479 — dll/src/desktop/extra/camera/windows.rs:479-484 | dll/src/desktop/extra/screencap/windows.rs:394-399 — 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) doc/src/codegen/v2/lang_java/wrappers.rs:593 — doc/src/codegen/v2/lang_java/wrappers.rs:593-598 | doc/src/codegen/v2/lang_node/wrappers.rs:1368-1373 — 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) core/src/selection.rs:860 — core/src/selection.rs:860-865 | doc/src/codegen/v2/lang_go/managed.rs:251-256 — 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) layout/src/widgets/backstage.rs:375 — layout/src/widgets/backstage.rs:375-380 | layout/src/widgets/statusbar.rs:397-402 — 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) doc/src/reftest/autodoc.rs:1974 — doc/src/reftest/autodoc.rs:1974-1979 | doc/src/reftest/regression.rs:2808-2814 — 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) dll/src/desktop/extra/iroh/loadbalancer.rs:148 — dll/src/desktop/extra/iroh/loadbalancer.rs:148-153 | dll/src/desktop/extra/zip/mod.rs:73-78 — 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) layout/src/callbacks.rs:7397 — layout/src/callbacks.rs:7397-7402 | layout/src/json.rs:126-131 — 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) core/src/dom.rs:4053 — core/src/dom.rs:4053-4058 | layout/src/dom_lint.rs:127-132 — 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 (11 lines × 3) · ×13
  • Duplicated block (11 lines × 3) core/src/resources.rs:2731 — core/src/resources.rs:2731-2741 | core/src/resources.rs:2790-2800 | core/src/resources.rs:2806-2816 — all 3 copies are in the same file, so extract the block into one function there and call 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) dll/src/desktop/extra/geolocation/ios.rs:206 — dll/src/desktop/extra/geolocation/ios.rs:206-216 | dll/src/desktop/extra/geolocation/linux.rs:215-225 | dll/src/desktop/extra/geolocation/macos.rs:200-210 — before extracting anything, compare `dll/src/desktop/extra/geolocation/ios.rs` and `dll/src/desktop/extra/geolocation/macos.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `dll/src/desktop/extra/geolocation/ios.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.
  • Duplicated block (11 lines × 3) doc/src/autofix/function_diff.rs:777 — doc/src/autofix/function_diff.rs:777-787 | doc/src/autofix/function_diff.rs:805-815 | doc/src/autofix/function_diff.rs:823-833 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/function_diff.rs:777` 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) doc/src/codegen/v2/lang_c.rs:1177 — doc/src/codegen/v2/lang_c.rs:1177-1187 | doc/src/codegen/v2/lang_cpp/common.rs:250-260 | doc/src/codegen/v2/lang_haskell/cshim.rs:503-513 — before extracting anything, compare `doc/src/codegen/v2/lang_c.rs` and `doc/src/codegen/v2/lang_cpp/common.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 3) doc/src/codegen/v2/lang_rust.rs:4663 — doc/src/codegen/v2/lang_rust.rs:4663-4673 | doc/src/codegen/v2/lang_rust.rs:4699-4709 | doc/src/codegen/v2/lang_rust.rs:4731-4741 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_rust.rs:4663` it begins part-way through the construct above it, so those exact lines 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) layout/src/cpurender/pixmap.rs:1557 — layout/src/cpurender/pixmap.rs:1557-1567 | layout/src/cpurender/pixmap.rs:1615-1625 | layout/src/cpurender/pixmap.rs:1650-1660 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/cpurender/pixmap.rs:1557` it does not close everything it opens, so those 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 × 3) layout/src/widgets/ribbon.rs:846 — layout/src/widgets/ribbon.rs:846-856 | layout/src/widgets/ribbon.rs:877-887 | layout/src/widgets/ribbon.rs:910-920 — all 3 copies are in the same file, so extract the block into one function there and call 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) layout/src/window.rs:4812 — layout/src/window.rs:4812-4822 | layout/src/window.rs:4984-4994 | layout/src/window.rs:5148-5158 — all 3 copies are in the same file, so extract the block into one function there and call 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, `layout/src/window.rs:4983` calls `is_some` and `layout/src/window.rs:5147` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 3) webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs:332 — webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs:332-342 | webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs:316-326 | webrender/swgl/src/shaders/brush_opacity_antialiasing.rs:299-309 — before extracting anything, compare `webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs` and `webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 200 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 3) doc/src/codegen/v2/lang_cpp/cpp11.rs:308 — doc/src/codegen/v2/lang_cpp/cpp11.rs:308-318 | doc/src/codegen/v2/lang_cpp/cpp17.rs:488-498 | doc/src/codegen/v2/lang_cpp/cpp20.rs:174-184 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp11.rs` and `doc/src/codegen/v2/lang_cpp/cpp17.rs` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 669 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/codegen/v2/lang_cpp/cpp11.rs:308` it begins part-way through the construct above it, so those exact lines 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) doc/src/codegen/v2/lang_rust.rs:4084 — doc/src/codegen/v2/lang_rust.rs:4084-4094 | doc/src/codegen/v2/lang_rust.rs:4106-4116 | doc/src/codegen/v2/lang_rust.rs:4133-4143 — all 3 copies are in the same file, so extract the block into one function there and call 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) webrender/core/src/render_backend.rs:1678 — webrender/core/src/render_backend.rs:1678-1688 | webrender/core/src/render_backend.rs:1690-1700 | webrender/core/src/render_backend.rs:1702-1712 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/core/src/render_backend.rs:1678` it begins part-way through the construct above it, so those exact lines 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) dll/src/desktop/shell2/linux/wayland/screencopy.rs:79 — dll/src/desktop/shell2/linux/wayland/screencopy.rs:79-89 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:113-123 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:156-166 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/screencopy.rs:79` 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 × 3) · ×13
  • Duplicated block (10 lines × 3) dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:225 — dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:225-234 | dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:352-361 | dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:438-447 — all 3 copies are in the same file, so extract the block into one function there and call 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, `dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:235` calls `unwrap` and `dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:448` 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 × 3) dll/src/desktop/shell2/windows/mod.rs:2289 — dll/src/desktop/shell2/windows/mod.rs:2289-2298 | dll/src/desktop/shell2/windows/mod.rs:2918-2927 | dll/src/desktop/shell2/windows/mod.rs:2973-2982 — all 3 copies are in the same file, so extract the block into one function there and call 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) doc/src/autofix/type_index.rs:2037 — doc/src/autofix/type_index.rs:2037-2046 | doc/src/autofix/type_index.rs:2055-2065 | doc/src/autofix/type_index.rs:2074-2083 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/type_index.rs:2037` 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) doc/src/autofix/workspace.rs:1098 — doc/src/autofix/workspace.rs:1098-1107 | doc/src/autofix/workspace.rs:1117-1126 | doc/src/autofix/workspace.rs:1136-1145 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/workspace.rs:1098` it begins part-way through the construct above it, so those exact lines 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) doc/src/codegen/v2/lang_crystal/functions.rs:38 — doc/src/codegen/v2/lang_crystal/functions.rs:38-47 | doc/src/codegen/v2/lang_julia/functions.rs:33-42 | doc/src/codegen/v2/lang_v/functions.rs:38-47 — `doc/src/codegen/v2/lang_crystal/functions.rs` and `doc/src/codegen/v2/lang_v/functions.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 31 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_crystal/functions.rs:38` it does not close everything it opens, so those exact lines 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) doc/src/codegen/v2/lang_haskell/wrappers.rs:1395 — doc/src/codegen/v2/lang_haskell/wrappers.rs:1395-1404 | doc/src/codegen/v2/lang_node/managed.rs:149-161 | doc/src/codegen/v2/lang_ruby/managed.rs:497-508 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_haskell/wrappers.rs:1395` 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) layout/src/widgets/alert.rs:343 — layout/src/widgets/alert.rs:343-352 | layout/src/widgets/chip.rs:313-322 | layout/src/widgets/toast.rs:376-385 — before extracting anything, compare `layout/src/widgets/alert.rs` and `layout/src/widgets/toast.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `layout/src/widgets/alert.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 (10 lines × 3) layout/src/window.rs:14459 — layout/src/window.rs:14459-14468 | layout/src/window.rs:14555-14564 | layout/src/window.rs:14715-14724 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/window.rs:14459` 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, `layout/src/window.rs:14458` calls `clone` and `layout/src/window.rs:14714` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 3) layout/src/xml/svg.rs:1868 — layout/src/xml/svg.rs:1868-1877 | layout/src/xml/svg.rs:1885-1894 | layout/src/xml/svg.rs:1909-1918 — all 3 copies are in the same file, so extract the block into one function there and call 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) webrender/swgl/src/shaders/ps_quad_mask.rs:157 — webrender/swgl/src/shaders/ps_quad_mask.rs:157-166 | webrender/swgl/src/shaders/ps_quad_mask_fast_path.rs:245-254 | webrender/swgl/src/shaders/ps_quad_textured.rs:136-145 — before extracting anything, compare `webrender/swgl/src/shaders/ps_quad_mask.rs` and `webrender/swgl/src/shaders/ps_quad_mask_fast_path.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 3) core/src/xml.rs:3081 — core/src/xml.rs:3081-3090 | core/src/xml.rs:3094-3103 | core/src/xml.rs:3107-3121 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/xml.rs:3081` it begins part-way through the construct above it, so those exact lines 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) doc/src/reftest/autodebug.rs:2246 — doc/src/reftest/autodebug.rs:2246-2258 | doc/src/reftest/autoreview.rs:1189-1198 | doc/src/reftest/autoreview.rs:1628-1637 — before extracting anything, compare `doc/src/reftest/autodebug.rs` and `doc/src/reftest/autoreview.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/reftest/autodebug.rs:2246` it begins part-way through the construct above it, so those 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, `doc/src/reftest/autoreview.rs:1201` calls `store`, `join` and `doc/src/reftest/autodebug.rs:2261` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 3) doc/src/codegen/v2/lang_csharp/mod.rs:232 — doc/src/codegen/v2/lang_csharp/mod.rs:232-242 | doc/src/codegen/v2/lang_java/mod.rs:261-272 | doc/src/codegen/v2/lang_node/mod.rs:1005-1014 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_csharp/mod.rs:232` it begins part-way through the construct above it, so those 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.
D1 · Cyclomatic Complexity · WaylandWindow · ×12
  • WaylandWindow::generate_frame_if_needed (cyclomatic 104) dll/src/desktop/shell2/linux/wayland/mod.rs:7011 — WaylandWindow::generate_frame_if_needed has cyclomatic complexity 104 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • WaylandWindow::set_cursor_for (cyclomatic 55) dll/src/desktop/shell2/linux/wayland/mod.rs:8284 — WaylandWindow::set_cursor_for has cyclomatic complexity 55 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • WaylandWindow::new (cyclomatic 48) dll/src/desktop/shell2/linux/wayland/mod.rs:1972 — WaylandWindow::new has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • WaylandWindow::handle_pointer_button (cyclomatic 36) dll/src/desktop/shell2/linux/wayland/mod.rs:4438 — WaylandWindow::handle_pointer_button has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • WaylandWindow::wait_for_events (cyclomatic 35) dll/src/desktop/shell2/linux/wayland/mod.rs:2971 — WaylandWindow::wait_for_events has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • WaylandWindow::handle_key (cyclomatic 28) dll/src/desktop/shell2/linux/wayland/mod.rs:3450 — WaylandWindow::handle_key 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.
  • WaylandWindow::drop (cyclomatic 25) dll/src/desktop/shell2/linux/wayland/mod.rs:8509 — WaylandWindow::drop has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • WaylandWindow::handle_tablet_frame (cyclomatic 20) dll/src/desktop/shell2/linux/wayland/mod.rs:4259 — WaylandWindow::handle_tablet_frame 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.
  • WaylandWindow::handle_seat_pointer_button (cyclomatic 20) dll/src/desktop/shell2/linux/wayland/mod.rs:6124 — WaylandWindow::handle_seat_pointer_button 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.
  • WaylandWindow::sync_window_state (cyclomatic 20) dll/src/desktop/shell2/linux/wayland/mod.rs:6656 — WaylandWindow::sync_window_state 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.
  • WaylandWindow::set_prevent_system_sleep (cyclomatic 18) dll/src/desktop/shell2/linux/wayland/mod.rs:10845 — WaylandWindow::set_prevent_system_sleep 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.
  • WaylandWindow::handle_seat_key (cyclomatic 16) dll/src/desktop/shell2/linux/wayland/mod.rs:5312 — WaylandWindow::handle_seat_key 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 · AttribLocations · ×12
  • AttribLocations::get_loc (cyclomatic 33) webrender/swgl/src/shaders/cs_clip_rectangle.rs:72 — AttribLocations::get_loc has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • AttribLocations::get_loc (cyclomatic 21) webrender/swgl/src/shaders/cs_border_segment.rs:61 — AttribLocations::get_loc has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • AttribLocations::get_loc (cyclomatic 21) webrender/swgl/src/shaders/cs_border_solid.rs:58 — AttribLocations::get_loc has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • AttribLocations::get_loc (cyclomatic 21) webrender/swgl/src/shaders/cs_clip_box_shadow_texture_2d.rs:88 — AttribLocations::get_loc has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • AttribLocations::get_loc (cyclomatic 19) webrender/swgl/src/shaders/cs_conic_gradient.rs:49 — AttribLocations::get_loc has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • AttribLocations::get_loc (cyclomatic 19) webrender/swgl/src/shaders/cs_radial_gradient.rs:49 — AttribLocations::get_loc has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • AttribLocations::get_loc (cyclomatic 19) webrender/swgl/src/shaders/cs_svg_filter_node.rs:53 — AttribLocations::get_loc has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • AttribLocations::get_loc (cyclomatic 18) webrender/swgl/src/shaders/cs_clip_rectangle_fast_path.rs:106 — AttribLocations::get_loc has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • AttribLocations::get_loc (cyclomatic 17) webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:90 — AttribLocations::get_loc 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.
  • AttribLocations::get_loc (cyclomatic 17) webrender/swgl/src/shaders/composite_texture_rect_yuv.rs:90 — AttribLocations::get_loc 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.
  • AttribLocations::bind_loc (cyclomatic 17) webrender/swgl/src/shaders/cs_clip_rectangle.rs:52 — AttribLocations::bind_loc 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.
  • AttribLocations::bind_loc (cyclomatic 17) webrender/swgl/src/shaders/cs_clip_rectangle_fast_path.rs:86 — AttribLocations::bind_loc 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.
D30 · Dependency Vulnerabilities · Medium advisory (unsound) · ×12
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×12
  • Edited copy of a member (26 corresponding lines) webrender/swgl/src/shaders/cs_scale_texture_2d.rs:76 — webrender/swgl/src/shaders/cs_scale_texture_2d.rs:76-101 | webrender/swgl/src/shaders/cs_scale_texture_rect.rs:81-107 — 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) webrender/swgl/src/shaders/brush_blend.rs:382 — webrender/swgl/src/shaders/brush_blend.rs:382-414 | webrender/swgl/src/shaders/brush_blend_alpha_pass.rs:334-359 — 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) layout/src/cpurender/raster.rs:80 — layout/src/cpurender/raster.rs:80-105 | layout/src/cpurender/raster.rs:111-142 — 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) dll/src/desktop/extra/sqlite/mod.rs:622 — dll/src/desktop/extra/sqlite/mod.rs:622-647 | dll/src/desktop/extra/sqlite/mod.rs:672-697 — 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) layout/src/window_state.rs:196 — layout/src/window_state.rs:196-221 | layout/src/window_state.rs:272-297 — 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) doc/src/codegen/v2/lang_lisp/wrappers.rs:43 — doc/src/codegen/v2/lang_lisp/wrappers.rs:43-71 | doc/src/codegen/v2/lang_racket/wrappers.rs:40-65 — 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) dll/src/desktop/shell2/linux/wayland/events.rs:4135 — dll/src/desktop/shell2/linux/wayland/events.rs:4135-4161 | dll/src/desktop/shell2/linux/wayland/events.rs:4167-4192 — 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) webrender/api/src/display_list.rs:1660 — webrender/api/src/display_list.rs:1660-1685 | webrender/api/src/display_list.rs:1695-1728 — 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) doc/src/codegen/v2/mod.rs:627 — doc/src/codegen/v2/mod.rs:627-656 | doc/src/codegen/v2/mod.rs:663-688 — 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) doc/src/codegen/v2/lang_lisp/types.rs:300 — doc/src/codegen/v2/lang_lisp/types.rs:300-327 | doc/src/codegen/v2/lang_racket/types.rs:255-280 — 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) webrender/core/src/render_backend.rs:153 — webrender/core/src/render_backend.rs:153-178 | webrender/core/src/render_backend.rs:188-213 — 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) dll/src/desktop/shell2/linux/system_style.rs:3143 — dll/src/desktop/shell2/linux/system_style.rs:3143-3170 | dll/src/desktop/shell2/macos/system_style.rs:921-946 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×12
  • Duplicated block (16–17 lines × 2) dll/src/desktop/extra/screencap/linux.rs:587 — dll/src/desktop/extra/screencap/linux.rs:587-603 | dll/src/desktop/extra/screencap/linux.rs:660-675 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/extra/screencap/linux.rs:587` it begins part-way through the construct above it, so those exact lines 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) dll/src/desktop/shell2/linux/wayland/mod.rs:3717 — dll/src/desktop/shell2/linux/wayland/mod.rs:3717-3732 | dll/src/desktop/shell2/windows/mod.rs:2014-2030 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 319 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 `dll/src/desktop/shell2/linux/wayland/mod.rs:3717` it does not close everything it opens, so those 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 `result` to `ProcessEventResult` in one and `azul_core::events::ProcessEventResult` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (16–17 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:4589 — dll/src/desktop/shell2/linux/wayland/mod.rs:4589-4605 | dll/src/desktop/shell2/linux/x11/events.rs:680-695 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/events.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 263 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 `dll/src/desktop/shell2/linux/wayland/mod.rs:4589` 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–17 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:8768 — dll/src/desktop/shell2/linux/wayland/mod.rs:8768-8784 | dll/src/desktop/shell2/linux/wayland/tooltip.rs:286-301 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:8768` 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) doc/src/codegen/v2/lang_node/managed.rs:144 — doc/src/codegen/v2/lang_node/managed.rs:144-160 | doc/src/codegen/v2/lang_ruby/managed.rs:492-507 — 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 `doc/src/codegen/v2/lang_node/managed.rs:144` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16–17 lines × 2) doc/src/reftest/autoreview.rs:1104 — doc/src/reftest/autoreview.rs:1104-1119 | doc/src/reftest/autoreview.rs:1540-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 `doc/src/reftest/autoreview.rs:1540` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (16–17 lines × 2) doc/src/reftest/regression.rs:2499 — doc/src/reftest/regression.rs:2499-2515 | doc/src/reftest/regression.rs:2606-2621 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/reftest/regression.rs:2499` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16–17 lines × 2) layout/src/cpurender/pixmap.rs:1259 — layout/src/cpurender/pixmap.rs:1259-1275 | layout/src/solver3/display_list.rs:11173-11188 — before extracting anything, compare `layout/src/cpurender/pixmap.rs` and `layout/src/solver3/display_list.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/cpurender/pixmap.rs:1259` it begins part-way through the construct above it, so those exact lines 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) layout/src/solver3/cache.rs:1937 — layout/src/solver3/cache.rs:1937-1953 | layout/src/solver3/cache.rs:2195-2210 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16–17 lines × 2) layout/src/widgets/text_area.rs:721 — layout/src/widgets/text_area.rs:721-736 | layout/src/widgets/text_input.rs:1101-1117 — before extracting anything, compare `layout/src/widgets/text_area.rs` and `layout/src/widgets/text_input.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `layout/src/widgets/text_area.rs:721` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `layout/src/widgets/text_input.rs:1118` calls `get_text`, `engine_selection`, `into` and `layout/src/widgets/text_area.rs:737` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (16–17 lines × 2) layout/src/widgets/text_area.rs:780 — layout/src/widgets/text_area.rs:780-795 | layout/src/widgets/text_input.rs:1171-1187 — before extracting anything, compare `layout/src/widgets/text_area.rs` and `layout/src/widgets/text_input.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `layout/src/widgets/text_area.rs:780` 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, `layout/src/widgets/text_input.rs:1188` calls `get_text`, `engine_selection`, `into` and `layout/src/widgets/text_area.rs:797` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (16–17 lines × 2) webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs:138 — webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs:138-153 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_glyph_transform_texture_2d.rs:121-137 — before extracting anything, compare `webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs` and `webrender/swgl/src/shaders/ps_text_run_alpha_pass_glyph_transform_texture_2d.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 139 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs:138` it does not close everything it opens, so those 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, `webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs:154` calls `swgl_blend_drop_shadow` and `webrender/swgl/src/shaders/ps_text_run_alpha_pass_glyph_transform_texture_2d.rs:139` 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–14 lines × 2) · ×12
  • Duplicated block (13–14 lines × 2) dll/src/desktop/shell2/ios/clipboard.rs:153 — dll/src/desktop/shell2/ios/clipboard.rs:153-166 | dll/src/desktop/shell2/macos/clipboard.rs:130-142 — 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 `dll/src/desktop/shell2/ios/clipboard.rs:153` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13–14 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:4654 — dll/src/desktop/shell2/linux/wayland/mod.rs:4654-4666 | dll/src/desktop/shell2/linux/wayland/mod.rs:5863-5876 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:4654` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `&mut` in one and `super) fn wayland_set_primary_selection(&mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (13–14 lines × 2) doc/src/autofix/diff.rs:615 — doc/src/autofix/diff.rs:615-627 | doc/src/autofix/diff.rs:2235-2248 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/diff.rs:615` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13–14 lines × 2) doc/src/codegen/v2/lang_crystal/mod.rs:337 — doc/src/codegen/v2/lang_crystal/mod.rs:337-350 | doc/src/codegen/v2/lang_julia/mod.rs:229-241 — `doc/src/codegen/v2/lang_crystal/mod.rs` and `doc/src/codegen/v2/lang_julia/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 51 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (13–14 lines × 2) doc/src/codegen/v2/lang_d/mod.rs:380 — doc/src/codegen/v2/lang_d/mod.rs:380-393 | doc/src/codegen/v2/lang_swift/mod.rs:356-368 — `doc/src/codegen/v2/lang_d/mod.rs` and `doc/src/codegen/v2/lang_swift/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 68 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_d/mod.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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (13–14 lines × 2) layout/src/cpurender/svg.rs:72 — layout/src/cpurender/svg.rs:72-85 | layout/src/cpurender/svg.rs:134-146 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/cpurender/svg.rs:72` 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–14 lines × 2) layout/src/solver3/cache.rs:2861 — layout/src/solver3/cache.rs:2861-2873 | layout/src/solver3/cache.rs:3540-3553 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13–14 lines × 2) layout/src/solver3/fc.rs:1762 — layout/src/solver3/fc.rs:1762-1774 | layout/src/solver3/fc.rs:1912-1925 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/fc.rs:1762` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13–14 lines × 2) layout/src/solver3/getters.rs:3273 — layout/src/solver3/getters.rs:3273-3286 | layout/src/solver3/getters.rs:4285-4297 — both copies are in the same file, so extract the 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 (13–14 lines × 2) layout/src/widgets/camera.rs:347 — layout/src/widgets/camera.rs:347-360 | layout/src/widgets/screencap.rs:312-324 — before extracting anything, compare `layout/src/widgets/camera.rs` and `layout/src/widgets/screencap.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 108 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `layout/src/widgets/camera.rs:347` 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–14 lines × 2) webrender/glyph/src/lib.rs:124 — webrender/glyph/src/lib.rs:124-136 | webrender/glyph/src/lib.rs:283-296 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/glyph/src/lib.rs:283` 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–14 lines × 2) webrender/swgl/src/shaders/brush_mix_blend.rs:395 — webrender/swgl/src/shaders/brush_mix_blend.rs:395-407 | webrender/swgl/src/shaders/brush_mix_blend_alpha_pass.rs:309-322 — before extracting anything, compare `webrender/swgl/src/shaders/brush_mix_blend.rs` and `webrender/swgl/src/shaders/brush_mix_blend_alpha_pass.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 132 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×12
  • Duplicated block (12–13 lines × 2) dll/src/desktop/compositor2.rs:374 — dll/src/desktop/compositor2.rs:374-386 | dll/src/desktop/compositor2.rs:389-400 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/compositor2.rs:374` it begins part-way through the construct above it, so those exact lines 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) dll/src/desktop/compositor2.rs:1633 — dll/src/desktop/compositor2.rs:1633-1644 | dll/src/desktop/compositor2.rs:1941-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 `dll/src/desktop/compositor2.rs:1633` it does not close everything it opens, so those exact lines 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) dll/src/desktop/extra/pdf/mod.rs:629 — dll/src/desktop/extra/pdf/mod.rs:629-640 | dll/src/desktop/extra/pdf/mod.rs:700-712 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/extra/pdf/mod.rs:629` 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) dll/src/desktop/shell2/common/event.rs:7844 — dll/src/desktop/shell2/common/event.rs:7844-7856 | dll/src/desktop/shell2/common/event.rs:7946-7957 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/common/event.rs:7844` it does not close everything it opens, so those exact lines 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) dll/src/desktop/shell2/windows/mod.rs:5878 — dll/src/desktop/shell2/windows/mod.rs:5878-5890 | dll/src/desktop/shell2/windows/mod.rs:5995-6006 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/windows/mod.rs:5878` it begins part-way through the construct above it, so those 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) dll/src/desktop/tray/linux.rs:633 — dll/src/desktop/tray/linux.rs:633-644 | dll/src/desktop/tray/linux.rs:836-848 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/tray/linux.rs:836` it begins part-way through the construct above it, so those exact lines 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) doc/src/autofix/type_index.rs:1858 — doc/src/autofix/type_index.rs:1858-1870 | doc/src/patch/index.rs:1687-1698 — before extracting anything, compare `doc/src/autofix/type_index.rs` and `doc/src/patch/index.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `doc/src/autofix/type_index.rs:1858` it does not close everything it opens, so those exact lines 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) doc/src/autofix/type_index.rs:1902 — doc/src/autofix/type_index.rs:1902-1914 | doc/src/autofix/type_index.rs:1959-1970 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/type_index.rs:1902` it begins part-way through the construct above it, so those exact lines 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) doc/src/codegen/v2/lang_python.rs:1836 — doc/src/codegen/v2/lang_python.rs:1836-1848 | doc/src/codegen/v2/lang_python.rs:1854-1865 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12–13 lines × 2) layout/src/solver3/getters.rs:6767 — layout/src/solver3/getters.rs:6767-6779 | layout/src/solver3/getters.rs:6889-6900 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/getters.rs:6767` it does not close everything it opens, so those exact lines 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) layout/src/solver3/layout_tree.rs:505 — layout/src/solver3/layout_tree.rs:505-516 | layout/src/text3/dense.rs:1203-1215 — 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 `layout/src/solver3/layout_tree.rs:505` it begins part-way through the construct above it, so those 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 `dense` to `&crate::text3::dense::DenseText` in one and `&DenseText` 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–13 lines × 2) layout/src/text3/edit.rs:842 — layout/src/text3/edit.rs:842-853 | layout/src/text3/edit.rs:975-987 — both copies are in the same file, so extract the 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 `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×12
  • Duplicated block (7–8 lines × 2) core/src/resources.rs:2674 — core/src/resources.rs:2674-2680 | core/src/resources.rs:2683-2690 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/resources.rs:2674` it does not close everything it opens, so those exact lines 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) dll/src/desktop/extra/permission/linux.rs:151 — dll/src/desktop/extra/permission/linux.rs:151-158 | dll/src/desktop/eyedropper/wayland.rs:102-108 — 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 `dll/src/desktop/extra/permission/linux.rs:151` it does not close everything it opens, so those 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) dll/src/desktop/shell2/common/event.rs:2362 — dll/src/desktop/shell2/common/event.rs:2362-2369 | dll/src/desktop/shell2/linux/x11/mod.rs:8253-8259 — 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 `dll/src/desktop/shell2/common/event.rs:2362` 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–8 lines × 2) dll/src/desktop/shell2/linux/wayland/gl.rs:382 — dll/src/desktop/shell2/linux/wayland/gl.rs:382-388 | dll/src/desktop/shell2/linux/x11/gl.rs:366-373 — `dll/src/desktop/shell2/linux/wayland/gl.rs` and `dll/src/desktop/shell2/linux/x11/gl.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 133 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/gl.rs:382` it begins part-way through the construct above it, so those 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) doc/src/codegen/v2/lang_php/wrappers.rs:428 — doc/src/codegen/v2/lang_php/wrappers.rs:428-435 | doc/src/codegen/v2/lang_php/wrappers.rs:546-552 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_php/wrappers.rs:428` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) layout/src/callbacks.rs:3683 — layout/src/callbacks.rs:3683-3690 | layout/src/callbacks.rs:3788-3794 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/callbacks.rs:3683` it does not close everything it opens, so those exact lines 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) layout/src/cpurender/raster.rs:83 — layout/src/cpurender/raster.rs:83-90 | layout/src/cpurender/raster.rs:114-120 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/cpurender/raster.rs:83` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7–8 lines × 2) layout/src/managers/a11y.rs:623 — layout/src/managers/a11y.rs:623-630 | layout/src/window.rs:12378-12384 — 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 `layout/src/managers/a11y.rs:623` it does not close everything it opens, so those exact lines 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) layout/src/scroll_timer.rs:519 — layout/src/scroll_timer.rs:519-525 | layout/src/scroll_timer.rs:687-694 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/scroll_timer.rs:519` it does not close everything it opens, so those exact lines 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) layout/src/solver3/taffy_bridge.rs:273 — layout/src/solver3/taffy_bridge.rs:273-280 | layout/src/solver3/taffy_bridge.rs:1380-1386 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/taffy_bridge.rs:273` 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–8 lines × 2) layout/src/xml/svg.rs:821 — layout/src/xml/svg.rs:821-828 | layout/src/xml/svg.rs:853-859 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/xml/svg.rs:821` 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 before the matched lines, `layout/src/xml/svg.rs:852` calls `iter`, `any` and `layout/src/xml/svg.rs:820` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7–8 lines × 2) webrender/swgl/src/shaders/brush_blend.rs:338 — webrender/swgl/src/shaders/brush_blend.rs:338-345 | webrender/swgl/src/shaders/brush_blend_alpha_pass.rs:289-295 — before extracting anything, compare `webrender/swgl/src/shaders/brush_blend.rs` and `webrender/swgl/src/shaders/brush_blend_alpha_pass.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_blend.rs:338` it begins part-way through the construct above it, so those 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 · webrender · ×11
  • webrender::render_target::add_svg_filter_node_instances (cyclomatic 101) webrender/core/src/render_target.rs:1009 — webrender::render_target::add_svg_filter_node_instances has cyclomatic complexity 101 (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.
  • webrender::prepare::prepare_interned_prim_for_render (cyclomatic 64) webrender/core/src/prepare.rs:316 — webrender::prepare::prepare_interned_prim_for_render has cyclomatic complexity 64 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • webrender::quad::prepare_quad (cyclomatic 52) webrender/core/src/quad.rs:66 — webrender::quad::prepare_quad has cyclomatic complexity 52 (threshold 15). Of this number, 50 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.
  • webrender::prim_store::gradient::linear::optimize_linear_gradient (cyclomatic 33) webrender/core/src/prim_store/gradient/linear.rs:117 — webrender::prim_store::gradient::linear::optimize_linear_gradient has cyclomatic complexity 33 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • webrender::renderer::upload::upload_to_texture_cache (cyclomatic 28) webrender/core/src/renderer/upload.rs:49 — webrender::renderer::upload::upload_to_texture_cache 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.
  • webrender::prim_store::gradient::radial::optimize_radial_gradient (cyclomatic 27) webrender/core/src/prim_store/gradient/radial.rs:387 — webrender::prim_store::gradient::radial::optimize_radial_gradient has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • webrender::renderer::init::create_webrender_instance (cyclomatic 26) webrender/core/src/renderer/init.rs:296 — webrender::renderer::init::create_webrender_instance has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • webrender::border::add_corner_segment (cyclomatic 24) webrender/core/src/border.rs:1007 — webrender::border::add_corner_segment 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.
  • webrender::prepare::update_clip_task_for_brush (cyclomatic 19) webrender/core/src/prepare.rs:1313 — webrender::prepare::update_clip_task_for_brush 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.
  • webrender::prepare::prepare_prim_for_render (cyclomatic 17) webrender/core/src/prepare.rs:137 — webrender::prepare::prepare_prim_for_render has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • webrender::visibility::update_prim_visibility (cyclomatic 16) webrender/core/src/visibility.rs:139 — webrender::visibility::update_prim_visibility 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 · Emitter · ×11
  • Emitter::plan_method (cyclomatic 88) doc/src/codegen/v2/lang_swift/wrappers.rs:1710 — Emitter::plan_method has cyclomatic complexity 88 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Emitter::plan_method (cyclomatic 82) doc/src/codegen/v2/lang_d/wrappers.rs:1727 — Emitter::plan_method has cyclomatic complexity 82 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Emitter::emit_method (cyclomatic 62) doc/src/codegen/v2/lang_crystal/wrappers.rs:1030 — Emitter::emit_method has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Emitter::emit_string_ext (cyclomatic 42) doc/src/codegen/v2/lang_swift/wrappers.rs:3259 — Emitter::emit_string_ext has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Emitter::emit_traits (cyclomatic 34) doc/src/codegen/v2/lang_swift/wrappers.rs:1288 — Emitter::emit_traits has cyclomatic complexity 34 (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.
  • Emitter::emit_methods (cyclomatic 31) doc/src/codegen/v2/lang_swift/wrappers.rs:1552 — Emitter::emit_methods 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.
  • Emitter::emit_accessor (cyclomatic 23) doc/src/codegen/v2/lang_d/wrappers.rs:1300 — Emitter::emit_accessor 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.
  • Emitter::emit_option_traits (cyclomatic 23) doc/src/codegen/v2/lang_swift/wrappers.rs:2857 — Emitter::emit_option_traits 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.
  • Emitter::method_name (cyclomatic 17) doc/src/codegen/v2/lang_crystal/wrappers.rs:963 — Emitter::method_name 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.
  • Emitter::emit_class (cyclomatic 16) doc/src/codegen/v2/lang_crystal/wrappers.rs:479 — Emitter::emit_class 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.
  • Emitter::emit_fields (cyclomatic 16) doc/src/codegen/v2/lang_crystal/wrappers.rs:762 — Emitter::emit_fields 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 · Renderer · ×11
  • Renderer::draw_frame (cognitive 63) webrender/core/src/renderer/mod.rs:4534 — Renderer::draw_frame has cognitive complexity 63 (threshold 15). Drivers by points: if/else 15 (37 pts), loops 7 (16 pts), match/switch 3 (10 pts) (nesting depth added 38). 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.
  • Renderer::update (cognitive 56) webrender/core/src/renderer/mod.rs:984 — Renderer::update has cognitive complexity 56 (threshold 15). Drivers by points: if/else 11 (36 pts), loops 4 (11 pts), match/switch 3 (9 pts) (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Renderer::render_impl (cognitive 53) webrender/core/src/renderer/mod.rs:1417 — Renderer::render_impl has cognitive complexity 53 (threshold 15). Drivers by points: if/else 29 (45 pts), match/switch 3 (5 pts), loops 2 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Renderer::update_texture_cache (cognitive 49) webrender/core/src/renderer/mod.rs:1796 — Renderer::update_texture_cache has cognitive complexity 49 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 7 (15 pts), match/switch 4 (12 pts), boolean chains 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Renderer::draw_alpha_batch_container (cognitive 33) webrender/core/src/renderer/mod.rs:2837 — Renderer::draw_alpha_batch_container has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 2 (4 pts), match/switch 1 (4 pts), boolean chains 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Renderer::calculate_dirty_rects (cognitive 33) webrender/core/src/renderer/mod.rs:4324 — Renderer::calculate_dirty_rects has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (28 pts), loops 1 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Renderer::save_capture (cognitive 32) webrender/core/src/renderer/mod.rs:5683 — Renderer::save_capture has cognitive complexity 32 (threshold 15). Drivers by points: match/switch 4 (16 pts), if/else 6 (9 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 18). 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.
  • Renderer::draw_texture_cache_target (cognitive 25) webrender/core/src/renderer/mod.rs:3949 — Renderer::draw_texture_cache_target has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 2, loops 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Renderer::draw_color_target (cognitive 21) webrender/core/src/renderer/mod.rs:3568 — Renderer::draw_color_target has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (13 pts), loops 3, match/switch 2 (3 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • Renderer::load_capture (cognitive 20) webrender/core/src/renderer/mod.rs:5839 — Renderer::load_capture has cognitive complexity 20 (threshold 15). Drivers by points: loops 5 (9 pts), match/switch 3 (8 pts), if/else 3 (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.
  • Renderer::composite_simple (cognitive 17) webrender/core/src/renderer/mod.rs:3419 — Renderer::composite_simple has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×11
  • Edited copy of a member (27 corresponding lines) webrender/swgl/src/shaders/composite_texture_2d.rs:77 — webrender/swgl/src/shaders/composite_texture_2d.rs:77-104 | webrender/swgl/src/shaders/composite_texture_rect.rs:83-109 — 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) doc/src/codegen/v2/lang_cpp/common.rs:1973 — doc/src/codegen/v2/lang_cpp/common.rs:1973-1999 | doc/src/codegen/v2/lang_cpp/common.rs:2009-2047 — 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) webrender/core/src/prim_store/gradient/conic.rs:416 — webrender/core/src/prim_store/gradient/conic.rs:416-442 | webrender/core/src/prim_store/gradient/radial.rs:546-572 — 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) core/src/resources.rs:2600 — core/src/resources.rs:2600-2632 | core/src/resources.rs:2719-2745 — 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) layout/src/window.rs:13484 — layout/src/window.rs:13484-13525 | layout/src/window.rs:13539-13565 — 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) doc/src/codegen/v2/lang_ada/types.rs:493 — doc/src/codegen/v2/lang_ada/types.rs:493-519 | doc/src/codegen/v2/lang_ocaml/types.rs:359-386 — 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) doc/src/codegen/v2/lang_ocaml/wrappers.rs:95 — doc/src/codegen/v2/lang_ocaml/wrappers.rs:95-121 | doc/src/codegen/v2/lang_ocaml/wrappers.rs:152-178 — 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) dll/src/web/server.rs:675 — dll/src/web/server.rs:675-711 | dll/src/web/server.rs:796-822 — 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) doc/src/codegen/v2/rust/dynamic_binding.rs:114 — doc/src/codegen/v2/rust/dynamic_binding.rs:114-140 | doc/src/codegen/v2/rust/static_binding.rs:185-225 — 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) dll/src/desktop/shell2/linux/wayland/events.rs:352 — dll/src/desktop/shell2/linux/wayland/events.rs:352-382 | dll/src/desktop/shell2/linux/wayland/events.rs:426-452 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:9132 — dll/src/desktop/shell2/linux/wayland/mod.rs:9132-9159 | dll/src/desktop/shell2/linux/x11/mod.rs:8550-8576 — 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 · Duplicated block (23 lines × 2) · ×11
  • Duplicated block (23 lines × 2) core/src/xml.rs:8376 — core/src/xml.rs:8376-8398 | core/src/xml.rs:8667-8689 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/xml.rs:8376` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (23 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:3034 — dll/src/desktop/shell2/linux/wayland/mod.rs:3034-3056 | dll/src/desktop/shell2/linux/x11/mod.rs:4552-4574 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (23 lines × 2) dll/src/desktop/shell2/windows/mod.rs:4981 — dll/src/desktop/shell2/windows/mod.rs:4981-5003 | dll/src/desktop/shell2/windows/mod.rs:5073-5095 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/windows/mod.rs:4981` 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 (23 lines × 2) doc/src/api.rs:2064 — doc/src/api.rs:2064-2086 | doc/src/api.rs:2342-2364 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/api.rs:2064` it does not close everything it opens, so those 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, `doc/src/api.rs:2338` calls `contains` and `doc/src/api.rs:2061` 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) doc/src/codegen/v2/lang_java/types.rs:318 — doc/src/codegen/v2/lang_java/types.rs:318-340 | doc/src/codegen/v2/lang_java/types.rs:612-634 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_java/types.rs:318` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (23 lines × 2) layout/src/solver3/cache.rs:1939 — layout/src/solver3/cache.rs:1939-1961 | layout/src/solver3/cache.rs:2102-2124 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/cache.rs:1939` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (23 lines × 2) webrender/core/src/batch.rs:1843 — webrender/core/src/batch.rs:1843-1865 | webrender/core/src/batch.rs:1898-1920 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/core/src/batch.rs:1843` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (23 lines × 2) webrender/core/src/picture.rs:4316 — webrender/core/src/picture.rs:4316-4338 | webrender/core/src/picture.rs:4451-4473 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/core/src/picture.rs:4316` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (23 lines × 2) webrender/core/src/render_task.rs:1366 — webrender/core/src/render_task.rs:1366-1388 | webrender/core/src/render_task.rs:1555-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. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/core/src/render_task.rs:1366` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (23 lines × 2) webrender/swgl/src/shaders/ps_quad_mask.rs:263 — webrender/swgl/src/shaders/ps_quad_mask.rs:263-285 | webrender/swgl/src/shaders/ps_quad_textured.rs:255-277 — before extracting anything, compare `webrender/swgl/src/shaders/ps_quad_mask.rs` and `webrender/swgl/src/shaders/ps_quad_textured.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 107 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/ps_quad_mask.rs:263` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (23 lines × 2) dll/src/desktop/shell2/android/mod.rs:1682 — dll/src/desktop/shell2/android/mod.rs:1682-1704 | dll/src/desktop/shell2/ios/mod.rs:673-695 — `dll/src/desktop/shell2/android/mod.rs` and `dll/src/desktop/shell2/ios/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 17 separate duplicated blocks between them, totalling at least 242 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/android/mod.rs:1682` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D1 · Cyclomatic Complexity · PlatformWindow · ×10
  • PlatformWindow::apply_user_change (cyclomatic 315) dll/src/desktop/shell2/common/event.rs:4824 — PlatformWindow::apply_user_change has cyclomatic complexity 315 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • PlatformWindow::process_window_events_inner (cyclomatic 188) dll/src/desktop/shell2/common/event.rs:10294 — PlatformWindow::process_window_events_inner has cyclomatic complexity 188 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • PlatformWindow::apply_system_change (cyclomatic 178) dll/src/desktop/shell2/common/event.rs:7142 — PlatformWindow::apply_system_change has cyclomatic complexity 178 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • PlatformWindow::dispatch_events_propagated (cyclomatic 75) dll/src/desktop/shell2/common/event.rs:8536 — PlatformWindow::dispatch_events_propagated has cyclomatic complexity 75 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: azul_dll::desktop::shell2::common::event::win32_vkey_to_virtual_key (cyclomatic 135) 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.
  • PlatformWindow::process_window_events (cyclomatic 31) dll/src/desktop/shell2/common/event.rs:9942 — PlatformWindow::process_window_events 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. This is NOT this file's highest cyclomatic complexity: azul_dll::desktop::shell2::common::event::win32_vkey_to_virtual_key (cyclomatic 135) 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.
  • PlatformWindow::feed_seat_gesture_sessions (cyclomatic 17) dll/src/desktop/shell2/common/event.rs:9182 — PlatformWindow::feed_seat_gesture_sessions has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: azul_dll::desktop::shell2::common::event::win32_vkey_to_virtual_key (cyclomatic 135) 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.
  • PlatformWindow::handle_scrollbar_drag (cyclomatic 17) dll/src/desktop/shell2/common/event.rs:13166 — PlatformWindow::handle_scrollbar_drag has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: azul_dll::desktop::shell2::common::event::win32_vkey_to_virtual_key (cyclomatic 135) 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.
  • PlatformWindow::process_timers_and_threads (cyclomatic 16) dll/src/desktop/shell2/common/event.rs:12369 — PlatformWindow::process_timers_and_threads 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: azul_dll::desktop::shell2::common::event::win32_vkey_to_virtual_key (cyclomatic 135) 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.
  • PlatformWindow::handle_track_click (cyclomatic 16) dll/src/desktop/shell2/common/event.rs:12688 — PlatformWindow::handle_track_click 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: azul_dll::desktop::shell2::common::event::win32_vkey_to_virtual_key (cyclomatic 135) 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.
  • PlatformWindow::invoke_expired_timers (cyclomatic 16) dll/src/desktop/shell2/common/event.rs:12843 — PlatformWindow::invoke_expired_timers has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: azul_dll::desktop::shell2::common::event::win32_vkey_to_virtual_key (cyclomatic 135) 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 · PlatformWindow · ×10
  • PlatformWindow::apply_user_change (cognitive 551) dll/src/desktop/shell2/common/event.rs:4824 — PlatformWindow::apply_user_change has cognitive complexity 551 (threshold 15). Drivers by points: if/else 209 (496 pts), match/switch 10 (30 pts), loops 6 (18 pts), boolean chains 7 (nesting depth added 319). 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.
  • PlatformWindow::process_window_events_inner (cognitive 497) dll/src/desktop/shell2/common/event.rs:10294 — PlatformWindow::process_window_events_inner has cognitive complexity 497 (threshold 15). Drivers by points: if/else 147 (394 pts), match/switch 13 (48 pts), loops 14 (42 pts), boolean chains 13 (nesting depth added 310). 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.
  • PlatformWindow::apply_system_change (cognitive 460) dll/src/desktop/shell2/common/event.rs:7142 — PlatformWindow::apply_system_change has cognitive complexity 460 (threshold 15). Drivers by points: if/else 150 (428 pts), match/switch 9 (24 pts), loops 2 (6 pts), boolean chains 2 (nesting depth added 297). 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.
  • PlatformWindow::dispatch_events_propagated (cognitive 255) dll/src/desktop/shell2/common/event.rs:8536 — PlatformWindow::dispatch_events_propagated has cognitive complexity 255 (threshold 15). Drivers by points: if/else 43 (167 pts), loops 17 (66 pts), match/switch 7 (18 pts), boolean chains 4 (nesting depth added 184). 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.
  • PlatformWindow::process_window_events (cognitive 54) dll/src/desktop/shell2/common/event.rs:9942 — PlatformWindow::process_window_events has cognitive complexity 54 (threshold 15). Drivers by points: if/else 25 (42 pts), loops 4 (8 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.
  • PlatformWindow::handle_track_click (cognitive 25) dll/src/desktop/shell2/common/event.rs:12688 — PlatformWindow::handle_track_click has cognitive complexity 25 (threshold 15). Drivers by points: if/else 17 (19 pts), match/switch 5 (6 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.
  • PlatformWindow::invoke_expired_timers (cognitive 24) dll/src/desktop/shell2/common/event.rs:12843 — PlatformWindow::invoke_expired_timers has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 3, loops 2 (3 pts), match/switch 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • PlatformWindow::handle_scrollbar_drag (cognitive 24) dll/src/desktop/shell2/common/event.rs:13166 — PlatformWindow::handle_scrollbar_drag has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19, match/switch 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.
  • PlatformWindow::process_timers_and_threads (cognitive 22) dll/src/desktop/shell2/common/event.rs:12369 — PlatformWindow::process_timers_and_threads has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (14 pts), match/switch 3 (6 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • PlatformWindow::feed_seat_gesture_sessions (cognitive 21) dll/src/desktop/shell2/common/event.rs:9182 — PlatformWindow::feed_seat_gesture_sessions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 3, loops 3, match/switch 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PythonGenerator · ×10
  • PythonGenerator::generate_pymethod (cognitive 139) doc/src/codegen/v2/lang_python.rs:2467 — PythonGenerator::generate_pymethod has cognitive complexity 139 (threshold 15). Drivers by points: if/else 74 (114 pts), loops 6 (9 pts), match/switch 5 (9 pts), boolean chains 7 (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • PythonGenerator::field_type_needs_unsendable (cognitive 67) doc/src/codegen/v2/lang_python.rs:3564 — PythonGenerator::field_type_needs_unsendable has cognitive complexity 67 (threshold 15). Drivers by points: if/else 20 (43 pts), loops 5 (14 pts), boolean chains 7, match/switch 1 (3 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • PythonGenerator::function_has_unsupported_args (cognitive 54) doc/src/codegen/v2/lang_python.rs:3771 — PythonGenerator::function_has_unsupported_args has cognitive complexity 54 (threshold 15). Drivers by points: if/else 21 (39 pts), boolean chains 11, match/switch 1 (3 pts), loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • PythonGenerator::generate_callback_trampoline (cognitive 47) doc/src/codegen/v2/lang_python.rs:1075 — PythonGenerator::generate_callback_trampoline has cognitive complexity 47 (threshold 15). Drivers by points: if/else 31 (37 pts), boolean chains 4, loops 3, match/switch 2 (3 pts) (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.
  • PythonGenerator::generate_enum_pymethods (cognitive 33) doc/src/codegen/v2/lang_python.rs:2316 — PythonGenerator::generate_enum_pymethods has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 2, 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.
  • PythonGenerator::is_python_compatible_type (cognitive 24) doc/src/codegen/v2/lang_python.rs:4009 — PythonGenerator::is_python_compatible_type has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 6 (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.
  • PythonGenerator::generate_variant_accessors (cognitive 22) doc/src/codegen/v2/lang_python.rs:2246 — PythonGenerator::generate_variant_accessors has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • PythonGenerator::function_refs_excluded_type (cognitive 20) doc/src/codegen/v2/lang_python.rs:3946 — PythonGenerator::function_refs_excluded_type has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • PythonGenerator::enum_needs_unsendable (cognitive 19) doc/src/codegen/v2/lang_python.rs:3509 — PythonGenerator::enum_needs_unsendable has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (7 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.
  • PythonGenerator::generate_derive_dunders (cognitive 16) doc/src/codegen/v2/lang_python.rs:1903 — PythonGenerator::generate_derive_dunders has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D31 · IaC & Container Security · Medium IaC · ×10
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×10
  • Members sharing a duplicated core (6 members, 50+ identical tokens) doc/src/codegen/v2/lang_ada/types.rs:561 — doc/src/codegen/v2/lang_ada/types.rs:561-571 | doc/src/codegen/v2/lang_csharp/types.rs:799-809 | doc/src/codegen/v2/lang_java/types.rs:1047-1057 | doc/src/codegen/v2/lang_kotlin/mod.rs:1267-1277 | doc/src/codegen/v2/lang_ocaml/types.rs:963-973 | doc/src/codegen/v2/lang_smalltalk/types.rs:410-420 — 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) layout/src/cpurender/pixmap.rs:1310 — layout/src/cpurender/pixmap.rs:1310-1361 | layout/src/cpurender/pixmap.rs:1422-1480 | layout/src/cpurender/raster.rs:2889-2988 | layout/src/cpurender/raster.rs:3748-3900 | layout/src/cpurender/raster.rs:4025-4145 | layout/src/cpurender/raster.rs:4161-4355 — 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) layout/src/text3/cache.rs:10459 — layout/src/text3/cache.rs:10459-10509 | layout/src/text3/cache.rs:10529-10613 | layout/src/text3/dense.rs:689-703 | layout/src/text3/dense.rs:1197-1275 | layout/src/text3/dense.rs:1295-1426 | layout/src/text3/dense.rs:1454-1636 — 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) webrender/core/src/device/gl.rs:3661 — webrender/core/src/device/gl.rs:3661-3682 | webrender/core/src/device/gl.rs:3684-3705 | webrender/core/src/device/gl.rs:3707-3723 | webrender/core/src/device/gl.rs:3725-3741 | webrender/core/src/device/gl.rs:3743-3760 | webrender/core/src/device/gl.rs:3762-3784 — 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) webrender/swgl/src/shaders/brush_blend.rs:164 — webrender/swgl/src/shaders/brush_blend.rs:164-196 | webrender/swgl/src/shaders/brush_blend_alpha_pass.rs:195-224 | webrender/swgl/src/shaders/brush_opacity.rs:142-165 | webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs:152-174 | webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs:148-170 | webrender/swgl/src/shaders/brush_opacity_antialiasing.rs:144-167 — 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) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:464 — webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:464-492 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:466-494 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:455-483 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:394-418 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:346-361 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:332-347 — 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) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:226 — webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:226-242 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:230-246 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:236-252 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:230-246 | webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:176-192 | webrender/swgl/src/shaders/composite_texture_rect_yuv.rs:173-189 — 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) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:244 — webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:244-263 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:248-267 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:254-273 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:248-267 | webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:194-213 | webrender/swgl/src/shaders/composite_texture_rect_yuv.rs:191-210 — 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) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:296 — webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:296-308 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:300-312 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:306-318 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:300-312 | webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:260-272 | webrender/swgl/src/shaders/composite_texture_rect_yuv.rs:258-270 — 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) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:380 — webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:380-391 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:383-394 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:382-393 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:375-386 | webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:336-347 | webrender/swgl/src/shaders/composite_texture_rect_yuv.rs:334-345 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×10
  • Edited copy of a member (5 corresponding lines) dll/src/desktop/shell2/common/event.rs:180 — dll/src/desktop/shell2/common/event.rs:180-184 | layout/src/scroll_timer.rs:283-291 — 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) layout/src/overlay.rs:197 — layout/src/overlay.rs:197-201 | layout/src/widgets/node_graph.rs:1222-1226 — 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) layout/src/callbacks.rs:1478 — layout/src/callbacks.rs:1478-1485 | layout/src/managers/scroll_state.rs:196-200 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) layout/src/fluent.rs:411 — layout/src/fluent.rs:411-415 | layout/src/icu.rs:1348-1352 — 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) doc/src/codegen/v2/lang_lua/wrappers.rs:1009 — doc/src/codegen/v2/lang_lua/wrappers.rs:1009-1013 | doc/src/codegen/v2/lang_ruby/types.rs:936-941 — 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) dll/src/desktop/eyedropper/mod.rs:384 — dll/src/desktop/eyedropper/mod.rs:384-388 | layout/src/widgets/titlebar.rs:1044-1049 — 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) doc/src/codegen/v2/lang_csharp/managed.rs:334 — doc/src/codegen/v2/lang_csharp/managed.rs:334-338 | doc/src/codegen/v2/lang_java/managed.rs:692-696 — 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) dll/src/desktop/shell2/macos/mod.rs:4484 — dll/src/desktop/shell2/macos/mod.rs:4484-4492 | dll/src/desktop/shell2/windows/mod.rs:7495-7499 — 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) layout/src/fluent.rs:418 — layout/src/fluent.rs:418-422 | layout/src/icu.rs:1355-1359 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) scripts/check_dep_justifications.py:110 — scripts/check_dep_justifications.py:110-114 | scripts/supply-chain/sc_common.py:363-367 — 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 (24 lines × 2) · ×10
  • Duplicated block (24 lines × 2) core/src/compact.rs:655 — core/src/compact.rs:655-678 | core/src/compact.rs:1520-1543 — both copies are in the same file, so extract the block into 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) core/src/events.rs:1782 — core/src/events.rs:1782-1805 | core/src/events.rs:2071-2094 — both copies are in the same file, so extract the block into 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) dll/src/desktop/shell2/linux/x11/mod.rs:6208 — dll/src/desktop/shell2/linux/x11/mod.rs:6208-6231 | dll/src/desktop/shell2/windows/mod.rs:1853-1876 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 450 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 `dll/src/desktop/shell2/linux/x11/mod.rs:6208` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (24 lines × 2) doc/src/codegen/v2/lang_d/mod.rs:535 — doc/src/codegen/v2/lang_d/mod.rs:535-558 | doc/src/codegen/v2/lang_swift/mod.rs:478-501 — `doc/src/codegen/v2/lang_d/mod.rs` and `doc/src/codegen/v2/lang_swift/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 68 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (24 lines × 2) doc/src/codegen/v2/lang_rust.rs:2531 — doc/src/codegen/v2/lang_rust.rs:2531-2554 | doc/src/codegen/v2/lang_rust.rs:2606-2629 — both copies are in the same file, so extract the block into 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) layout/src/text3/cache.rs:5930 — layout/src/text3/cache.rs:5930-5953 | layout/src/text3/cache.rs:5965-5988 — both copies are in the same file, so extract the block into 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) webrender/core/src/quad.rs:516 — webrender/core/src/quad.rs:516-539 | webrender/core/src/quad.rs:681-704 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/core/src/quad.rs:516` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (24 lines × 2) webrender/core/src/scene_building.rs:2240 — webrender/core/src/scene_building.rs:2240-2263 | webrender/core/src/scene_building.rs:2282-2305 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/core/src/scene_building.rs:2240` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (24 lines × 2) webrender/core/src/surface.rs:497 — webrender/core/src/surface.rs:497-520 | webrender/core/src/surface.rs:545-568 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/core/src/surface.rs:497` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (24 lines × 2) doc/src/reftest/autoreview.rs:1192 — doc/src/reftest/autoreview.rs:1192-1215 | doc/src/reftest/autoreview.rs:1631-1654 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/reftest/autoreview.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.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×10
  • Duplicated block (22 lines × 2) dll/src/desktop/shell2/common/event.rs:8894 — dll/src/desktop/shell2/common/event.rs:8894-8915 | dll/src/desktop/shell2/common/event.rs:8924-8945 — both copies are in the same file, so extract the 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 (22 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:2767 — dll/src/desktop/shell2/linux/wayland/mod.rs:2767-2788 | dll/src/desktop/shell2/linux/x11/mod.rs:4127-4148 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:2767` it does not close everything it opens, so those exact lines 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) dll/src/desktop/shell2/linux/wayland/mod.rs:3087 — dll/src/desktop/shell2/linux/wayland/mod.rs:3087-3108 | dll/src/desktop/shell2/linux/x11/mod.rs:4600-4621 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `dll/src/desktop/shell2/linux/wayland/mod.rs:3122` calls `current_window_state` and `dll/src/desktop/shell2/linux/x11/mod.rs:4625` 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) dll/src/desktop/shell2/macos/events.rs:1525 — dll/src/desktop/shell2/macos/events.rs:1525-1546 | dll/src/desktop/shell2/windows/mod.rs:3490-3511 — before extracting anything, compare `dll/src/desktop/shell2/macos/events.rs` and `dll/src/desktop/shell2/windows/mod.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 79 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 `dll/src/desktop/shell2/macos/events.rs:1525` it does not close everything it opens, so those exact lines 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) layout/src/widgets/check_box.rs:356 — layout/src/widgets/check_box.rs:356-377 | layout/src/widgets/switch.rs:406-427 — before extracting anything, compare `layout/src/widgets/check_box.rs` and `layout/src/widgets/switch.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `layout/src/widgets/check_box.rs:356` 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 (22 lines × 2) layout/src/xml/mod.rs:622 — layout/src/xml/mod.rs:622-643 | layout/src/xml/mod.rs:734-755 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/xml/mod.rs:622` it does not close everything it opens, so those exact lines 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) webrender/core/src/picture.rs:4683 — webrender/core/src/picture.rs:4683-4704 | webrender/core/src/render_task.rs:2174-2195 — 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 `webrender/core/src/picture.rs:4683` it does not close everything it opens, so those exact lines 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) layout/src/text3/cache.rs:7148 — layout/src/text3/cache.rs:7148-7169 | layout/src/text3/dense.rs:424-445 — before extracting anything, compare `layout/src/text3/cache.rs` and `layout/src/text3/dense.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `layout/src/text3/cache.rs:7148` it begins part-way through the construct above it, so those exact lines 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) layout/src/widgets/themes/flat.rs:993 — layout/src/widgets/themes/flat.rs:993-1014 | layout/src/widgets/themes/flora.rs:1265-1286 — before extracting anything, compare `layout/src/widgets/themes/flat.rs` and `layout/src/widgets/themes/flora.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 927 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (22 lines × 2) dll/src/desktop/extra/audio/alsa.rs:82 — dll/src/desktop/extra/audio/alsa.rs:82-104 | dll/src/desktop/extra/audio/alsa.rs:176-197 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/extra/audio/alsa.rs:82` it begins part-way through the construct above it, so those 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) · ×10
  • Duplicated block (14–15 lines × 2) dll/src/desktop/display.rs:834 — dll/src/desktop/display.rs:834-848 | dll/src/desktop/display.rs:1030-1043 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/display.rs:834` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14–15 lines × 2) dll/src/desktop/shell2/windows/mod.rs:1460 — dll/src/desktop/shell2/windows/mod.rs:1460-1474 | dll/src/desktop/shell2/windows/mod.rs:7927-7940 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14–15 lines × 2) doc/src/autofix/type_index.rs:1656 — doc/src/autofix/type_index.rs:1656-1670 | doc/src/autofix/type_index.rs:1721-1734 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/type_index.rs:1656` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14–15 lines × 2) doc/src/codegen/v2/lang_rust.rs:2914 — doc/src/codegen/v2/lang_rust.rs:2914-2927 | doc/src/codegen/v2/lang_rust.rs:3247-3261 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_rust.rs:2914` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14–15 lines × 2) doc/src/codegen/v2/lang_rust.rs:3536 — doc/src/codegen/v2/lang_rust.rs:3536-3549 | doc/src/codegen/v2/lang_rust.rs:3741-3755 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_rust.rs:3536` it begins part-way through the construct above it, so those 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, `doc/src/codegen/v2/lang_rust.rs:3740` calls `sym` and `doc/src/codegen/v2/lang_rust.rs:3534` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14–15 lines × 2) doc/src/reftest/apply_midlevel.rs:560 — doc/src/reftest/apply_midlevel.rs:560-574 | doc/src/reftest/apply_midlevel.rs:613-626 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/reftest/apply_midlevel.rs:560` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (14–15 lines × 2) layout/src/solver3/fc.rs:7551 — layout/src/solver3/fc.rs:7551-7565 | layout/src/solver3/fc.rs:7590-7603 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14–15 lines × 2) layout/src/text3/dense.rs:1303 — layout/src/text3/dense.rs:1303-1317 | layout/src/text3/dense.rs:1463-1476 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/text3/dense.rs:1303` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14–15 lines × 2) webrender/core/src/render_target.rs:986 — webrender/core/src/render_target.rs:986-999 | webrender/core/src/render_target.rs:1306-1320 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/core/src/render_target.rs:986` 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–15 lines × 2) webrender/core/src/renderer/mod.rs:3857 — webrender/core/src/renderer/mod.rs:3857-3870 | webrender/core/src/renderer/mod.rs:3997-4011 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/core/src/renderer/mod.rs:3857` 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) · ×10
  • Duplicated block (10 lines × 4) dll/src/desktop/shell2/linux/wayland/mod.rs:5043 — dll/src/desktop/shell2/linux/wayland/mod.rs:5043-5052 | dll/src/desktop/shell2/linux/x11/events.rs:981-990 | dll/src/desktop/shell2/macos/events.rs:684-693 | dll/src/desktop/shell2/windows/mod.rs:5641-5650 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/events.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 263 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 4) doc/src/autofix/type_index.rs:254 — doc/src/autofix/type_index.rs:254-263 | doc/src/autofix/type_index.rs:421-430 | doc/src/autofix/type_index.rs:494-503 | doc/src/autofix/type_index.rs:530-539 — 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 `doc/src/autofix/type_index.rs:254` 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) doc/src/codegen/v2/lang_rust.rs:3793 — doc/src/codegen/v2/lang_rust.rs:3793-3802 | doc/src/codegen/v2/lang_rust.rs:3881-3890 | doc/src/codegen/v2/rust/dynamic_binding.rs:170-179 | doc/src/codegen/v2/rust/dynamic_binding.rs:298-307 — 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 `doc/src/codegen/v2/lang_rust.rs:3793` it begins part-way through the construct above it, so those exact lines 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) layout/src/cpurender/raster.rs:2965 — layout/src/cpurender/raster.rs:2965-2974 | layout/src/cpurender/raster.rs:3839-3848 | layout/src/cpurender/raster.rs:4118-4127 | layout/src/cpurender/raster.rs:4250-4259 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (10 lines × 4) layout/src/font.rs:2505 — layout/src/font.rs:2505-2514 | layout/src/font.rs:2517-2526 | layout/src/text3/default.rs:382-391 | layout/src/text3/default.rs:395-404 — 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. 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 × 4) layout/src/widgets/ribbon.rs:1016 — layout/src/widgets/ribbon.rs:1016-1025 | layout/src/widgets/ribbon.rs:1134-1143 | layout/src/widgets/ribbon.rs:1299-1308 | layout/src/widgets/ribbon.rs:1348-1357 — 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 (10 lines × 4) layout/src/window.rs:2820 — layout/src/window.rs:2820-2829 | layout/src/window.rs:3610-3619 | layout/src/window.rs:3933-3942 | layout/src/window.rs:4122-4131 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (10 lines × 4) doc/src/codegen/v2/lang_go/mod.rs:97 — doc/src/codegen/v2/lang_go/mod.rs:97-106 | doc/src/codegen/v2/lang_haskell/mod.rs:370-379 | doc/src/codegen/v2/lang_node/mod.rs:409-418 | doc/src/codegen/v2/lang_vb6/mod.rs:167-176 — `doc/src/codegen/v2/lang_go/mod.rs` and `doc/src/codegen/v2/lang_vb6/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 35 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `doc/src/codegen/v2/lang_haskell/mod.rs:366` calls `push_section` and `doc/src/codegen/v2/lang_go/mod.rs:93` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 4) doc/src/codegen/v2/lang_cpp/cpp03.rs:134 — doc/src/codegen/v2/lang_cpp/cpp03.rs:134-144 | doc/src/codegen/v2/lang_cpp/cpp11.rs:652-661 | doc/src/codegen/v2/lang_cpp/cpp17.rs:148-158 | doc/src/codegen/v2/lang_cpp/cpp20.rs:625-634 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/codegen/v2/lang_cpp/cpp03.rs:134` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 4) doc/src/autofix/type_index.rs:259 — doc/src/autofix/type_index.rs:259-268 | doc/src/autofix/type_index.rs:310-319 | doc/src/autofix/type_index.rs:499-508 | doc/src/autofix/type_index.rs:535-544 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×10
  • Duplicated block (8–9 lines × 2) dll/src/desktop/extra/screencap/macos.rs:504 — dll/src/desktop/extra/screencap/macos.rs:504-511 | dll/src/desktop/extra/screencap/macos.rs:594-602 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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–9 lines × 2) doc/src/codegen/v2/lang_ada/types.rs:424 — doc/src/codegen/v2/lang_ada/types.rs:424-431 | doc/src/codegen/v2/lang_ada/types.rs:504-512 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_ada/types.rs:424` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8–9 lines × 2) doc/src/codegen/v2/lang_fortran/types.rs:628 — doc/src/codegen/v2/lang_fortran/types.rs:628-636 | doc/src/codegen/v2/lang_fortran/types.rs:789-796 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_fortran/types.rs:628` it begins part-way through the construct above it, so those 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, `doc/src/codegen/v2/lang_fortran/types.rs:626` calls `line` and `doc/src/codegen/v2/lang_fortran/types.rs:787` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8–9 lines × 2) doc/src/reftest/mod.rs:782 — doc/src/reftest/mod.rs:782-789 | doc/src/reftest/mod.rs:827-835 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/reftest/mod.rs:782` it begins part-way through the construct above it, so those 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 (8–9 lines × 2) doc/src/reftest/regression.rs:721 — doc/src/reftest/regression.rs:721-728 | doc/src/reftest/regression.rs:2365-2373 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/reftest/regression.rs:2365` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8–9 lines × 2) layout/src/font.rs:1172 — layout/src/font.rs:1172-1180 | layout/src/font.rs:1191-1198 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8–9 lines × 2) layout/src/solver3/taffy_bridge.rs:295 — layout/src/solver3/taffy_bridge.rs:295-303 | layout/src/solver3/taffy_bridge.rs:1264-1271 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/taffy_bridge.rs:295` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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–9 lines × 2) layout/src/xml/mod.rs:389 — layout/src/xml/mod.rs:389-396 | layout/src/xml/mod.rs:943-951 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/xml/mod.rs:389` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8–9 lines × 2) webrender/swgl/src/shaders/brush_mix_blend.rs:443 — webrender/swgl/src/shaders/brush_mix_blend.rs:443-450 | webrender/swgl/src/shaders/brush_mix_blend_alpha_pass.rs:353-361 — before extracting anything, compare `webrender/swgl/src/shaders/brush_mix_blend.rs` and `webrender/swgl/src/shaders/brush_mix_blend_alpha_pass.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 132 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8–9 lines × 2) layout/src/solver3/fc.rs:3586 — layout/src/solver3/fc.rs:3586-3593 | layout/src/solver3/fc.rs:8682-8690 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/fc.rs:3586` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
AXH1 · Runtime security headers · Runtime security header not set · ×9
  • Runtime security header not set: content-security-policy — The live app's responses did not include content-security-policy (restricts the sources a page may load — mitigates XSS/injection). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: cross-origin-embedder-policy — The live app's responses did not include cross-origin-embedder-policy (recommended by the OWASP Secure Headers Project (value: require-corp)). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: cross-origin-opener-policy — The live app's responses did not include cross-origin-opener-policy (recommended by the OWASP Secure Headers Project (value: same-origin)). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: cross-origin-resource-policy — The live app's responses did not include cross-origin-resource-policy (recommended by the OWASP Secure Headers Project (value: same-origin)). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: permissions-policy — The live app's responses did not include permissions-policy (restricts powerful browser features (camera, geolocation, …)). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: referrer-policy — The live app's responses did not include referrer-policy (limits referrer leakage to third parties). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: strict-transport-security — The live app's responses did not include strict-transport-security (forces HTTPS on subsequent requests — mitigates downgrade/MITM). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: x-dns-prefetch-control — The live app's responses did not include x-dns-prefetch-control (recommended by the OWASP Secure Headers Project (value: off)). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
  • Runtime security header not set: x-permitted-cross-domain-policies — The live app's responses did not include x-permitted-cross-domain-policies (recommended by the OWASP Secure Headers Project (value: none)). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
D1 · Cyclomatic Complexity · X11Window · ×9
  • X11Window::handle_event (cyclomatic 72) dll/src/desktop/shell2/linux/x11/mod.rs:4836 — X11Window::handle_event has cyclomatic complexity 72 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • X11Window::render_and_present (cyclomatic 60) dll/src/desktop/shell2/linux/x11/mod.rs:6380 — X11Window::render_and_present 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.
  • X11Window::new_with_resources (cyclomatic 44) dll/src/desktop/shell2/linux/x11/mod.rs:3227 — X11Window::new_with_resources has cyclomatic complexity 44 (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.
  • X11Window::handle_mouse_button (cyclomatic 43) dll/src/desktop/shell2/linux/x11/events.rs:476 — X11Window::handle_mouse_button has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: azul_dll::desktop::shell2::linux::x11::events::keysym_to_virtual_keycode (cyclomatic 131) 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.
  • X11Window::wait_for_events (cyclomatic 30) dll/src/desktop/shell2/linux/x11/mod.rs:4486 — X11Window::wait_for_events 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. This is NOT this file's highest cyclomatic complexity: X11Window::set_cursor (cyclomatic 34) 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.
  • X11Window::sync_window_state (cyclomatic 24) dll/src/desktop/shell2/linux/x11/mod.rs:7443 — X11Window::sync_window_state has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: X11Window::set_cursor (cyclomatic 34) 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.
  • X11Window::handle_keyboard (cyclomatic 20) dll/src/desktop/shell2/linux/x11/events.rs:1002 — X11Window::handle_keyboard has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: azul_dll::desktop::shell2::linux::x11::events::keysym_to_virtual_keycode (cyclomatic 131) 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.
  • X11Window::set_prevent_system_sleep (cyclomatic 18) dll/src/desktop/shell2/linux/x11/mod.rs:8606 — X11Window::set_prevent_system_sleep 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: X11Window::set_cursor (cyclomatic 34) 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.
  • X11Window::process_pending_menu_callbacks (cyclomatic 16) dll/src/desktop/shell2/linux/x11/mod.rs:4340 — X11Window::process_pending_menu_callbacks has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: X11Window::set_cursor (cyclomatic 34) 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 · DisplayListGenerator · ×9
  • DisplayListGenerator::paint_inline_content (cyclomatic 50) layout/src/solver3/display_list.rs:7603 — DisplayListGenerator::paint_inline_content has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • DisplayListGenerator::generate_for_stacking_context (cyclomatic 32) layout/src/solver3/display_list.rs:4690 — DisplayListGenerator::generate_for_stacking_context 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. This is NOT this file's highest cyclomatic complexity: azul_layout::solver3::display_list::offset_display_item_y (cyclomatic 41) 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.
  • DisplayListGenerator::paint_in_flow_descendants (cyclomatic 27) layout/src/solver3/display_list.rs:4993 — DisplayListGenerator::paint_in_flow_descendants has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: azul_layout::solver3::display_list::offset_display_item_y (cyclomatic 41) 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.
  • DisplayListGenerator::paint_cursor (cyclomatic 26) layout/src/solver3/display_list.rs:4375 — DisplayListGenerator::paint_cursor 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. This is NOT this file's highest cyclomatic complexity: azul_layout::solver3::display_list::offset_display_item_y (cyclomatic 41) 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.
  • DisplayListGenerator::maybe_paint_placeholder_prompt (cyclomatic 26) layout/src/solver3/display_list.rs:6892 — DisplayListGenerator::maybe_paint_placeholder_prompt 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. This is NOT this file's highest cyclomatic complexity: azul_layout::solver3::display_list::offset_display_item_y (cyclomatic 41) 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.
  • DisplayListGenerator::paint_collapsed_table_borders (cyclomatic 25) layout/src/solver3/display_list.rs:6372 — DisplayListGenerator::paint_collapsed_table_borders has cyclomatic complexity 25 (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: azul_layout::solver3::display_list::offset_display_item_y (cyclomatic 41) 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.
  • DisplayListGenerator::paint_node_background_and_border_inner (cyclomatic 24) layout/src/solver3/display_list.rs:5889 — DisplayListGenerator::paint_node_background_and_border_inner has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: azul_layout::solver3::display_list::offset_display_item_y (cyclomatic 41) 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.
  • DisplayListGenerator::paint_node_content_inner (cyclomatic 24) layout/src/solver3/display_list.rs:6665 — DisplayListGenerator::paint_node_content_inner has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: azul_layout::solver3::display_list::offset_display_item_y (cyclomatic 41) 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.
  • DisplayListGenerator::paint_scrollbars (cyclomatic 21) layout/src/solver3/display_list.rs:7128 — DisplayListGenerator::paint_scrollbars has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: azul_layout::solver3::display_list::offset_display_item_y (cyclomatic 41) 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 (36 corresponding lines) · ×9
  • Edited copy of a member (36 corresponding lines) doc/src/codegen/v2/lang_java/wrappers.rs:1086 — doc/src/codegen/v2/lang_java/wrappers.rs:1086-1124 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:1414-1449 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) doc/src/codegen/v2/lang_freebasic/types.rs:354 — doc/src/codegen/v2/lang_freebasic/types.rs:354-389 | doc/src/codegen/v2/lang_vb6/types.rs:336-372 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) layout/src/cpurender/pixmap.rs:794 — layout/src/cpurender/pixmap.rs:794-829 | layout/src/cpurender/pixmap.rs:841-876 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) doc/src/reftest/autodebug.rs:2086 — doc/src/reftest/autodebug.rs:2086-2142 | doc/src/reftest/autoreview.rs:2179-2214 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) doc/src/autofix/analysis/extractor.rs:176 — doc/src/autofix/analysis/extractor.rs:176-211 | doc/src/autofix/analysis/reachability.rs:63-101 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) dll/src/desktop/extra/pdf/mod.rs:187 — dll/src/desktop/extra/pdf/mod.rs:187-222 | dll/src/desktop/extra/pdf/mod.rs:237-278 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) doc/src/codegen/v2/lang_node/managed.rs:628 — doc/src/codegen/v2/lang_node/managed.rs:628-663 | doc/src/codegen/v2/lang_php_ext.rs:506-542 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) doc/src/codegen/v2/lang_rust.rs:203 — doc/src/codegen/v2/lang_rust.rs:203-239 | doc/src/codegen/v2/rust/shared.rs:255-290 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) doc/src/codegen/v2/lang_fortran/managed.rs:185 — doc/src/codegen/v2/lang_fortran/managed.rs:185-222 | doc/src/codegen/v2/lang_fortran/managed.rs:228-263 — 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 · Duplicated block (15 lines × 3) · ×9
  • Duplicated block (15 lines × 3) dll/src/desktop/shell2/linux/wayland/mod.rs:5043 — dll/src/desktop/shell2/linux/wayland/mod.rs:5043-5057 | dll/src/desktop/shell2/linux/x11/events.rs:981-995 | dll/src/desktop/shell2/macos/events.rs:684-698 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/events.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 263 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 `dll/src/desktop/shell2/linux/wayland/mod.rs:5043` 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 × 3) dll/src/desktop/shell2/linux/x11/mod.rs:4225 — dll/src/desktop/shell2/linux/x11/mod.rs:4225-4239 | dll/src/desktop/shell2/macos/mod.rs:9190-9204 | dll/src/desktop/shell2/windows/mod.rs:7644-7658 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/mod.rs` and `dll/src/desktop/shell2/macos/mod.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `dll/src/desktop/shell2/linux/x11/mod.rs:4225` it begins part-way through the construct above it, so those exact lines 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 × 3) doc/src/codegen/v2/lang_ada/types.rs:169 — doc/src/codegen/v2/lang_ada/types.rs:169-183 | doc/src/codegen/v2/lang_cobol/types.rs:180-194 | doc/src/codegen/v2/lang_pascal/types.rs:114-128 — `doc/src/codegen/v2/lang_ada/types.rs` and `doc/src/codegen/v2/lang_cobol/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 48 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_ada/types.rs:169` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 3) doc/src/codegen/v2/lang_crystal/mod.rs:548 — doc/src/codegen/v2/lang_crystal/mod.rs:548-562 | doc/src/codegen/v2/lang_d/mod.rs:730-744 | doc/src/codegen/v2/lang_swift/mod.rs:596-610 — `doc/src/codegen/v2/lang_d/mod.rs` and `doc/src/codegen/v2/lang_swift/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 68 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (15 lines × 3) doc/src/codegen/v2/lang_node/wrappers.rs:615 — doc/src/codegen/v2/lang_node/wrappers.rs:615-629 | doc/src/codegen/v2/lang_node/wrappers.rs:772-786 | doc/src/codegen/v2/lang_node/wrappers.rs:1253-1267 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_node/wrappers.rs:615` 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 × 3) layout/src/solver3/fc.rs:5938 — layout/src/solver3/fc.rs:5938-5952 | layout/src/solver3/fc.rs:5968-5982 | layout/src/solver3/fc.rs:5998-6012 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/fc.rs:5938` it begins part-way through the construct above it, so those exact lines 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 × 3) layout/src/widgets/themes/flora.rs:924 — layout/src/widgets/themes/flora.rs:924-938 | layout/src/widgets/themes/flora.rs:1090-1104 | layout/src/widgets/themes/flora.rs:1915-1929 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (15 lines × 3) doc/src/codegen/v2/lang_crystal/functions.rs:89 — doc/src/codegen/v2/lang_crystal/functions.rs:89-103 | doc/src/codegen/v2/lang_odin/functions.rs:61-75 | doc/src/codegen/v2/lang_v/functions.rs:80-94 — `doc/src/codegen/v2/lang_crystal/functions.rs` and `doc/src/codegen/v2/lang_v/functions.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 31 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (15 lines × 3) dll/src/desktop/shell2/linux/wayland/mod.rs:3717 — dll/src/desktop/shell2/linux/wayland/mod.rs:3717-3731 | dll/src/desktop/shell2/linux/wayland/mod.rs:9853-9867 | dll/src/desktop/shell2/windows/mod.rs:2014-2029 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 319 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 `dll/src/desktop/shell2/linux/wayland/mod.rs:3717` it does not close everything it opens, so those 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 `result` to `ProcessEventResult` in one and `azul_core::events::ProcessEventResult` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×9
  • Duplicated block (11 lines × 4) dll/src/desktop/shell2/linux/wayland/mod.rs:6541 — dll/src/desktop/shell2/linux/wayland/mod.rs:6541-6551 | dll/src/desktop/shell2/linux/x11/mod.rs:6281-6291 | dll/src/desktop/shell2/macos/mod.rs:6085-6095 | dll/src/desktop/shell2/windows/mod.rs:2234-2244 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 4) doc/src/codegen/v2/lang_ada/types.rs:176 — doc/src/codegen/v2/lang_ada/types.rs:176-186 | doc/src/codegen/v2/lang_cobol/types.rs:187-197 | doc/src/codegen/v2/lang_fortran/types.rs:138-148 | doc/src/codegen/v2/lang_pascal/types.rs:121-131 — `doc/src/codegen/v2/lang_ada/types.rs` and `doc/src/codegen/v2/lang_cobol/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 48 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_ada/types.rs:176` it begins part-way through the construct above it, so those exact lines 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) doc/src/codegen/v2/lang_algol68/wrappers.rs:121 — doc/src/codegen/v2/lang_algol68/wrappers.rs:121-131 | doc/src/codegen/v2/lang_freebasic/wrappers.rs:87-97 | doc/src/codegen/v2/lang_pascal/wrappers.rs:129-139 | doc/src/codegen/v2/lang_vb6/wrappers.rs:64-74 — `doc/src/codegen/v2/lang_algol68/wrappers.rs` and `doc/src/codegen/v2/lang_freebasic/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 35 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_algol68/wrappers.rs:121` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 4) layout/src/text3/cache.rs:6288 — layout/src/text3/cache.rs:6288-6298 | layout/src/text3/cache.rs:6378-6388 | layout/src/text3/cache.rs:6466-6476 | layout/src/text3/cache.rs:6536-6546 — 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 `layout/src/text3/cache.rs:6288` 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) layout/src/widgets/text_area.rs:655 — layout/src/widgets/text_area.rs:655-665 | layout/src/widgets/text_area.rs:681-691 | layout/src/widgets/text_input.rs:1028-1042 | layout/src/widgets/text_input.rs:1059-1069 — before extracting anything, compare `layout/src/widgets/text_area.rs` and `layout/src/widgets/text_input.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `layout/src/widgets/text_area.rs:655` 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) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:472 — webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:472-482 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:457-467 | webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:428-438 | webrender/swgl/src/shaders/composite_texture_rect_yuv.rs:408-418 — before extracting anything, compare `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs` and `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 334 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 4) css/src/system.rs:2216 — css/src/system.rs:2216-2226 | css/src/system.rs:2268-2278 | css/src/system.rs:2320-2330 | css/src/system.rs:2372-2382 — 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 `css/src/system.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.
  • Duplicated block (11 lines × 4) doc/src/codegen/v2/lang_node/wrappers.rs:355 — doc/src/codegen/v2/lang_node/wrappers.rs:355-368 | doc/src/codegen/v2/lang_php/wrappers.rs:75-85 | doc/src/codegen/v2/lang_php/wrappers.rs:87-97 | doc/src/codegen/v2/lang_zig/wrappers.rs:274-287 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (11 lines × 4) doc/src/codegen/v2/lang_rust.rs:1321 — doc/src/codegen/v2/lang_rust.rs:1321-1333 | doc/src/codegen/v2/lang_rust.rs:1345-1355 | doc/src/codegen/v2/lang_rust.rs:1674-1685 | doc/src/codegen/v2/lang_rust.rs:1989-2001 — 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 `doc/src/codegen/v2/lang_rust.rs:1321` it does not close everything it opens, so those 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–11 lines × 2) · ×9
  • Duplicated block (10–11 lines × 2) core/src/callbacks.rs:619 — core/src/callbacks.rs:619-629 | core/src/callbacks.rs:649-658 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/callbacks.rs:619` it does not close everything it opens, so those exact lines 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) dll/src/desktop/shell2/linux/x11/mod.rs:1924 — dll/src/desktop/shell2/linux/x11/mod.rs:1924-1934 | dll/src/desktop/shell2/linux/x11/mod.rs:1977-1986 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/x11/mod.rs:1924` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10–11 lines × 2) doc/src/codegen/v2/lang_d/model.rs:313 — doc/src/codegen/v2/lang_d/model.rs:313-322 | doc/src/codegen/v2/lang_swift/model.rs:319-329 — `doc/src/codegen/v2/lang_d/model.rs` and `doc/src/codegen/v2/lang_swift/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 21 separate duplicated blocks between them, totalling at least 240 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_d/model.rs:313` it begins part-way through the construct above it, so those exact lines 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) doc/src/codegen/v2/lang_pascal/types.rs:498 — doc/src/codegen/v2/lang_pascal/types.rs:498-508 | doc/src/codegen/v2/lang_pascal/types.rs:619-628 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_pascal/types.rs:498` it begins part-way through the construct above it, so those exact lines 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) layout/src/managers/a11y.rs:658 — layout/src/managers/a11y.rs:658-668 | layout/src/window.rs:12435-12444 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `layout/src/managers/a11y.rs:670` calls `byte_to_char_idx` and `layout/src/window.rs:12446` 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–11 lines × 2) layout/src/solver3/fc.rs:1128 — layout/src/solver3/fc.rs:1128-1137 | layout/src/solver3/fc.rs:2630-2640 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/fc.rs:1128` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10–11 lines × 2) layout/src/window.rs:9983 — layout/src/window.rs:9983-9992 | layout/src/window.rs:15933-15943 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/window.rs:15933` it begins part-way through the construct above it, so those exact lines 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) webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:344 — webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:344-353 | webrender/swgl/src/shaders/brush_image_texture_rect.rs:274-284 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs` and `webrender/swgl/src/shaders/brush_image_texture_rect.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 250 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:344` 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–11 lines × 2) core/src/xml.rs:8451 — core/src/xml.rs:8451-8461 | core/src/xml.rs:8515-8524 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/xml.rs:8451` it begins part-way through the construct above it, so those 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, `core/src/xml.rs:8448` calls `consumes_text` and `core/src/xml.rs:8514` 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 (6 lines × 4) · ×9
  • Duplicated block (6 lines × 4) dll/src/desktop/compositor2.rs:670 — dll/src/desktop/compositor2.rs:670-675 | dll/src/desktop/compositor2.rs:1417-1422 | dll/src/desktop/wr_translate2.rs:1829-1834 | dll/src/desktop/wr_translate2.rs:1870-1875 — 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 `dll/src/desktop/compositor2.rs:670` it does not close everything it opens, so those exact lines 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) dll/src/desktop/compositor2.rs:682 — dll/src/desktop/compositor2.rs:682-687 | dll/src/desktop/compositor2.rs:1429-1434 | dll/src/desktop/wr_translate2.rs:1841-1846 | dll/src/desktop/wr_translate2.rs:1882-1887 — 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 `dll/src/desktop/compositor2.rs:682` 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 × 4) doc/src/codegen/v2/lang_crystal/types.rs:328 — doc/src/codegen/v2/lang_crystal/types.rs:328-333 | doc/src/codegen/v2/lang_julia/types.rs:315-320 | doc/src/codegen/v2/lang_odin/types.rs:274-279 | doc/src/codegen/v2/lang_v/types.rs:282-287 — `doc/src/codegen/v2/lang_crystal/types.rs` and `doc/src/codegen/v2/lang_julia/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 35 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_crystal/types.rs:328` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 4) doc/src/codegen/v2/lang_java/managed.rs:85 — doc/src/codegen/v2/lang_java/managed.rs:85-90 | doc/src/codegen/v2/lang_kotlin/managed.rs:61-66 | doc/src/codegen/v2/lang_kotlin/managed.rs:343-348 | doc/src/codegen/v2/lang_lisp/managed.rs:135-140 — `doc/src/codegen/v2/lang_java/managed.rs` and `doc/src/codegen/v2/lang_kotlin/managed.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 34 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_java/managed.rs:85` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `cb` to `&CallbackTypedefDef` in one and `&super::super::ir::CallbackTypedefDef` 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 × 4) layout/src/solver3/layout_tree.rs:504 — layout/src/solver3/layout_tree.rs:504-509 | layout/src/text3/dense.rs:1202-1207 | layout/src/text3/dense.rs:1302-1307 | layout/src/text3/dense.rs:1462-1467 — 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 `layout/src/solver3/layout_tree.rs:504` it does not close everything it opens, so those 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 `dense` to `&crate::text3::dense::DenseText` in one and `&DenseText` 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 × 4) doc/src/codegen/v2/lang_crystal/functions.rs:91 — doc/src/codegen/v2/lang_crystal/functions.rs:91-96 | doc/src/codegen/v2/lang_d/functions.rs:53-58 | doc/src/codegen/v2/lang_odin/functions.rs:63-68 | doc/src/codegen/v2/lang_v/functions.rs:82-87 — `doc/src/codegen/v2/lang_crystal/functions.rs` and `doc/src/codegen/v2/lang_v/functions.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 31 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_crystal/functions.rs:91` it does not close everything it opens, so those exact lines 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) layout/src/widgets/capture_common.rs:111 — layout/src/widgets/capture_common.rs:111-116 | layout/src/widgets/map.rs:1318-1323 | layout/src/widgets/map.rs:1357-1362 | layout/src/widgets/microphone.rs:75-80 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/widgets/capture_common.rs:111` it begins part-way through the construct above it, so those 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 `hook` to `&OptionOnConsumerFrame` in one and `&OptionMapViewportChanged` 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 × 4) layout/src/widgets/quick_access.rs:379 — layout/src/widgets/quick_access.rs:379-384 | layout/src/widgets/quick_access.rs:422-427 | layout/src/widgets/statusbar.rs:404-409 | layout/src/widgets/statusbar.rs:452-457 — before extracting anything, compare `layout/src/widgets/quick_access.rs` and `layout/src/widgets/statusbar.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 106 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `t` to `&QuickAccessTheme` in one and `&StatusBarTheme` 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 × 4) core/src/xml.rs:3194 — core/src/xml.rs:3194-3201 | core/src/xml.rs:3249-3256 | core/src/xml.rs:3285-3290 | core/src/xml.rs:3315-3320 — 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 `core/src/xml.rs:3194` it does not close everything it opens, so those 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 · CssPropertyCache · ×8
  • CssPropertyCache::restyle (cognitive 279) core/src/prop_cache.rs:1570 — CssPropertyCache::restyle has cognitive complexity 279 (threshold 15). Drivers by points: if/else 49 (159 pts), loops 26 (100 pts), match/switch 3 (12 pts), boolean chains 8 (nesting depth added 193). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • CssPropertyCache::build_compact_cache_with_inheritance_debug (cognitive 240) core/src/compact.rs:503 — CssPropertyCache::build_compact_cache_with_inheritance_debug has cognitive complexity 240 (threshold 15). Drivers by points: if/else 73 (216 pts), loops 8 (16 pts), match/switch 2 (6 pts), boolean chains 2 (nesting depth added 155). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • CssPropertyCache::build_compact_cache (cognitive 125) core/src/compact.rs:57 — CssPropertyCache::build_compact_cache has cognitive complexity 125 (threshold 15). Drivers by points: if/else 61 (117 pts), match/switch 1 (4 pts), boolean chains 2, loops 2 (nesting depth added 59). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • CssPropertyCache::get_computed_css_style_string (cognitive 84) core/src/prop_cache.rs:2149 — CssPropertyCache::get_computed_css_style_string has cognitive complexity 84 (threshold 15). Drivers by points: if/else 84. 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.
  • CssPropertyCache::get_property_slow (cognitive 80) core/src/prop_cache.rs:2783 — CssPropertyCache::get_property_slow has cognitive complexity 80 (threshold 15). Drivers by points: if/else 54 (70 pts), boolean chains 8, match/switch 1 (2 pts) (nesting depth added 17). 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.
  • CssPropertyCache::generate_tag_ids (cognitive 29) core/src/prop_cache.rs:1960 — CssPropertyCache::generate_tag_ids has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • CssPropertyCache::prune_compact_normal_props (cognitive 26) core/src/prop_cache.rs:1215 — CssPropertyCache::prune_compact_normal_props has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 4 (10 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • CssPropertyCache::normal_props_present (cognitive 20) core/src/prop_cache.rs:5013 — CssPropertyCache::normal_props_present has cognitive complexity 20 (threshold 15). Drivers by points: loops 8 (13 pts), if/else 3 (7 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.
D2 · Cognitive Complexity · SceneBuilder · ×8
  • SceneBuilder::wrap_prim_with_filters (cognitive 113) webrender/core/src/scene_building.rs:3599 — SceneBuilder::wrap_prim_with_filters has cognitive complexity 113 (threshold 15). Drivers by points: if/else 25 (71 pts), loops 10 (27 pts), match/switch 4 (14 pts), boolean chains 1 (nesting depth added 73). Of this number, 106 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • SceneBuilder::add_box_shadow (cognitive 35) webrender/core/src/box_shadow.rs:291 — SceneBuilder::add_box_shadow has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (26 pts), match/switch 3 (6 pts), boolean chains 3 (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.
  • SceneBuilder::finalize_picture (cognitive 30) webrender/core/src/scene_building.rs:670 — SceneBuilder::finalize_picture has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 5 (7 pts), match/switch 3 (5 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SceneBuilder::build_all (cognitive 28) webrender/core/src/scene_building.rs:856 — SceneBuilder::build_all has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 4 (12 pts), if/else 3 (9 pts), loops 3 (6 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.
  • SceneBuilder::push_stacking_context (cognitive 27) webrender/core/src/scene_building.rs:1972 — SceneBuilder::push_stacking_context has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (17 pts), match/switch 5 (7 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • SceneBuilder::build_item (cognitive 23) webrender/core/src/scene_building.rs:1332 — SceneBuilder::build_item has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (19 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • SceneBuilder::pop_stacking_context (cognitive 23) webrender/core/src/scene_building.rs:2192 — SceneBuilder::pop_stacking_context has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 2 (5 pts), match/switch 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.
  • SceneBuilder::pop_all_shadows (cognitive 18) webrender/core/src/scene_building.rs:2721 — SceneBuilder::pop_all_shadows has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (8 pts), match/switch 2 (6 pts), loops 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Edited copy of a member (25 corresponding lines) · ×8
  • Edited copy of a member (25 corresponding lines) webrender/swgl/src/shaders/cs_border_segment.rs:236 — webrender/swgl/src/shaders/cs_border_segment.rs:236-263 | webrender/swgl/src/shaders/cs_border_solid.rs:166-190 — 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) layout/src/cpurender/pixmap.rs:1610 — layout/src/cpurender/pixmap.rs:1610-1637 | layout/src/cpurender/pixmap.rs:1647-1671 — 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) core/src/prop_cache.rs:675 — core/src/prop_cache.rs:675-700 | core/src/prop_cache.rs:733-757 — 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) layout/src/callbacks.rs:7414 — layout/src/callbacks.rs:7414-7441 | layout/src/telemetry/crash_mail.rs:306-330 — 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) layout/src/text3/dense.rs:1020 — layout/src/text3/dense.rs:1020-1044 | layout/src/text3/dense.rs:1052-1076 — 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) doc/src/codegen/v2/lang_d/model.rs:661 — doc/src/codegen/v2/lang_d/model.rs:661-685 | doc/src/codegen/v2/lang_swift/model.rs:677-702 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:5151 — dll/src/desktop/shell2/linux/wayland/mod.rs:5151-5175 | dll/src/desktop/shell2/linux/wayland/mod.rs:5224-5256 — 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) doc/src/autofix/types/borrow.rs:114 — doc/src/autofix/types/borrow.rs:114-138 | doc/src/autofix/types/ref_kind.rs:153-181 — 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 · Duplicated block (21 lines × 2) · ×8
  • Duplicated block (21 lines × 2) dll/src/desktop/shell2/linux/system_style.rs:3182 — dll/src/desktop/shell2/linux/system_style.rs:3182-3202 | dll/src/desktop/shell2/macos/system_style.rs:956-976 — `dll/src/desktop/shell2/linux/system_style.rs` and `dll/src/desktop/shell2/macos/system_style.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 50 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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 (21 lines × 2) doc/src/autofix/workspace.rs:1734 — doc/src/autofix/workspace.rs:1734-1754 | doc/src/autofix/workspace.rs:1786-1806 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/workspace.rs:1734` 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) doc/src/codegen/v2/lang_csharp/wrappers.rs:238 — doc/src/codegen/v2/lang_csharp/wrappers.rs:238-258 | doc/src/codegen/v2/lang_csharp/wrappers.rs:306-326 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_csharp/wrappers.rs:238` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 2) doc/src/main.rs:645 — doc/src/main.rs:645-665 | doc/src/main.rs:682-702 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/main.rs:645` 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) webrender/core/src/batch.rs:2451 — webrender/core/src/batch.rs:2451-2471 | webrender/core/src/batch.rs:2583-2603 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/core/src/batch.rs:2451` 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) webrender/core/src/scene_building.rs:3851 — webrender/core/src/scene_building.rs:3851-3871 | webrender/core/src/scene_building.rs:3903-3923 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/core/src/scene_building.rs:3851` 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) dll/src/desktop/shell2/macos/mod.rs:6284 — dll/src/desktop/shell2/macos/mod.rs:6284-6305 | dll/src/desktop/shell2/windows/mod.rs:2304-2324 — `dll/src/desktop/shell2/macos/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 13 separate duplicated blocks between them, totalling at least 196 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/macos/mod.rs:6284` 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) doc/src/autofix/workspace.rs:2109 — doc/src/autofix/workspace.rs:2109-2129 | doc/src/autofix/workspace.rs:2160-2180 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/workspace.rs:2109` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (19–20 lines × 2) · ×8
  • Duplicated block (19–20 lines × 2) css/src/parser2.rs:903 — css/src/parser2.rs:903-921 | css/src/parser2.rs:1890-1909 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `css/src/parser2.rs:903` it begins part-way through the construct above it, so those 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 (19–20 lines × 2) dll/src/desktop/extra/biometric/mod.rs:61 — dll/src/desktop/extra/biometric/mod.rs:61-80 | dll/src/desktop/extra/keyring/mod.rs:50-68 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/extra/biometric/mod.rs:61` it begins part-way through the construct above it, so those exact lines 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–20 lines × 2) dll/src/desktop/shell2/linux/x11/mod.rs:7390 — dll/src/desktop/shell2/linux/x11/mod.rs:7390-7408 | dll/src/desktop/shell2/linux/x11/mod.rs:8448-8467 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/x11/mod.rs:7390` it begins part-way through the construct above it, so those exact lines 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–20 lines × 2) doc/src/api.rs:2197 — doc/src/api.rs:2197-2216 | doc/src/api.rs:2464-2482 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/api.rs:2197` it begins part-way through the construct above it, so those exact lines 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–20 lines × 2) doc/src/autofix/type_index.rs:220 — doc/src/autofix/type_index.rs:220-239 | doc/src/autofix/type_index.rs:337-355 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (19–20 lines × 2) doc/src/autofix/type_index.rs:1162 — doc/src/autofix/type_index.rs:1162-1180 | doc/src/autofix/type_index.rs:1335-1354 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/type_index.rs:1162` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. 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 (19–20 lines × 2) doc/src/patch/mod.rs:842 — doc/src/patch/mod.rs:842-861 | doc/src/patch/mod.rs:865-883 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/patch/mod.rs:842` it begins part-way through the construct above it, so those exact lines 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–20 lines × 2) layout/src/solver3/fc.rs:10933 — layout/src/solver3/fc.rs:10933-10951 | layout/src/solver3/fc.rs:11016-11035 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/fc.rs:10933` 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 lines × 4) · ×8
  • Duplicated block (9 lines × 4) dll/src/desktop/shell2/linux/wayland/mod.rs:6260 — dll/src/desktop/shell2/linux/wayland/mod.rs:6260-6268 | dll/src/desktop/shell2/linux/x11/events.rs:1401-1409 | dll/src/desktop/shell2/macos/events.rs:1154-1162 | dll/src/desktop/shell2/windows/mod.rs:2159-2167 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/events.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 263 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `dll/src/desktop/shell2/linux/wayland/mod.rs:6259` calls `mouse_state_mut`, `InWindow` and `dll/src/desktop/shell2/macos/events.rs:1151` 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 × 4) dll/src/desktop/shell2/linux/wayland/mod.rs:6297 — dll/src/desktop/shell2/linux/wayland/mod.rs:6297-6305 | dll/src/desktop/shell2/linux/x11/events.rs:1438-1446 | dll/src/desktop/shell2/macos/events.rs:1118-1126 | dll/src/desktop/shell2/windows/mod.rs:2202-2210 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/events.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 263 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 × 4) doc/src/codegen/v2/lang_java/types.rs:742 — doc/src/codegen/v2/lang_java/types.rs:742-750 | doc/src/codegen/v2/lang_java/types.rs:925-933 | doc/src/codegen/v2/lang_java/wrappers.rs:134-142 | doc/src/codegen/v2/lang_java/wrappers.rs:1939-1947 — before extracting anything, compare `doc/src/codegen/v2/lang_java/types.rs` and `doc/src/codegen/v2/lang_java/wrappers.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 4) doc/src/reftest/mod.rs:1458 — doc/src/reftest/mod.rs:1458-1466 | doc/src/reftest/mod.rs:1469-1477 | doc/src/reftest/mod.rs:1480-1488 | doc/src/reftest/mod.rs:1491-1499 — 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) layout/src/cpurender/raster.rs:4913 — layout/src/cpurender/raster.rs:4913-4921 | layout/src/xml/svg.rs:1868-1876 | layout/src/xml/svg.rs:1885-1893 | layout/src/xml/svg.rs:1909-1917 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (9 lines × 4) doc/src/codegen/v2/lang_rust.rs:1689 — doc/src/codegen/v2/lang_rust.rs:1689-1697 | doc/src/codegen/v2/lang_rust.rs:1717-1728 | doc/src/codegen/v2/lang_rust.rs:1748-1759 | doc/src/codegen/v2/lang_rust.rs:1768-1779 — 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) core/src/xml.rs:3210 — core/src/xml.rs:3210-3220 | core/src/xml.rs:3258-3268 | core/src/xml.rs:3292-3300 | core/src/xml.rs:3326-3336 — 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 `core/src/xml.rs:3210` it does not close everything it opens, so those exact lines 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) doc/src/codegen/v2/lang_crystal/types.rs:138 — doc/src/codegen/v2/lang_crystal/types.rs:138-146 | doc/src/codegen/v2/lang_julia/types.rs:174-182 | doc/src/codegen/v2/lang_odin/types.rs:122-130 | doc/src/codegen/v2/lang_v/types.rs:127-135 — `doc/src/codegen/v2/lang_crystal/types.rs` and `doc/src/codegen/v2/lang_julia/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 35 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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) · ×8
  • Duplicated block (5 lines × 4) layout/src/callbacks.rs:3586 — layout/src/callbacks.rs:3586-3590 | layout/src/callbacks.rs:3637-3641 | layout/src/callbacks.rs:3656-3660 | layout/src/callbacks.rs:3788-3792 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (5 lines × 4) webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:99 — webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:99-103 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:99-103 | webrender/swgl/src/shaders/brush_image_texture_2d.rs:97-102 | webrender/swgl/src/shaders/brush_mix_blend.rs:246-251 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs` and `webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 285 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `context` to `&ShaderContext` in one and `&mut ShaderContext` 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, `webrender/swgl/src/shaders/brush_image_texture_2d.rs:105` calls `write_clip` and `webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:108` 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 × 4) webrender/swgl/src/shaders/brush_opacity.rs:161 — webrender/swgl/src/shaders/brush_opacity.rs:161-165 | webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs:170-174 | webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs:166-170 | webrender/swgl/src/shaders/brush_opacity_antialiasing.rs:163-167 — before extracting anything, compare `webrender/swgl/src/shaders/brush_opacity.rs` and `webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 149 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_opacity.rs:161` 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 × 4) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:337 — webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:337-341 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:340-344 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:346-350 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:339-343 — before extracting anything, compare `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs` and `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 334 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:337` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 4) dll/src/desktop/shell2/android/mod.rs:602 — dll/src/desktop/shell2/android/mod.rs:602-606 | dll/src/desktop/shell2/headless/mod.rs:3124-3130 | dll/src/desktop/shell2/ios/mod.rs:2050-2054 | dll/src/desktop/shell2/linux/wayland/mod.rs:10104-10108 — `dll/src/desktop/shell2/android/mod.rs` and `dll/src/desktop/shell2/headless/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 106 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `dll/src/desktop/shell2/headless/mod.rs:3121` calls `wake` and `dll/src/desktop/shell2/android/mod.rs:600` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 4) layout/src/widgets/breadcrumb.rs:216 — layout/src/widgets/breadcrumb.rs:216-220 | layout/src/widgets/radio_group.rs:402-406 | layout/src/widgets/segmented.rs:348-352 | layout/src/widgets/stepper.rs:425-429 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
  • Duplicated block (5 lines × 4) css/src/system.rs:809 — css/src/system.rs:809-813 | css/src/system.rs:836-840 | css/src/system.rs:863-867 | css/src/system.rs:926-930 — 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 `css/src/system.rs:809` it begins part-way through the construct above it, so those exact lines 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) webrender/swgl/src/shaders/composite_fast_path_texture_2d.rs:31 — webrender/swgl/src/shaders/composite_fast_path_texture_2d.rs:31-35 | webrender/swgl/src/shaders/composite_fast_path_texture_rect.rs:31-35 | webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:80-84 | webrender/swgl/src/shaders/composite_texture_rect_yuv.rs:80-84 — before extracting anything, compare `webrender/swgl/src/shaders/composite_fast_path_texture_2d.rs` and `webrender/swgl/src/shaders/composite_fast_path_texture_rect.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:86` calls `strcmp` and `webrender/swgl/src/shaders/composite_fast_path_texture_2d.rs:37` 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 · SceneBuilder · ×7
  • SceneBuilder::wrap_prim_with_filters (cyclomatic 49) webrender/core/src/scene_building.rs:3599 — SceneBuilder::wrap_prim_with_filters has cyclomatic complexity 49 (threshold 15). Of this number, 45 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • SceneBuilder::build_item (cyclomatic 34) webrender/core/src/scene_building.rs:1332 — SceneBuilder::build_item has cyclomatic complexity 34 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • SceneBuilder::push_stacking_context (cyclomatic 21) webrender/core/src/scene_building.rs:1972 — SceneBuilder::push_stacking_context has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • SceneBuilder::finalize_picture (cyclomatic 20) webrender/core/src/scene_building.rs:670 — SceneBuilder::finalize_picture 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.
  • SceneBuilder::build_all (cyclomatic 17) webrender/core/src/scene_building.rs:856 — SceneBuilder::build_all has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • SceneBuilder::add_box_shadow (cyclomatic 16) webrender/core/src/box_shadow.rs:291 — SceneBuilder::add_box_shadow 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.
  • SceneBuilder::pop_stacking_context (cyclomatic 16) webrender/core/src/scene_building.rs:2192 — SceneBuilder::pop_stacking_context 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 · Renderer · ×7
  • Renderer::render_impl (cyclomatic 34) webrender/core/src/renderer/mod.rs:1417 — Renderer::render_impl has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Renderer::update (cyclomatic 26) webrender/core/src/renderer/mod.rs:984 — Renderer::update 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.
  • Renderer::draw_alpha_batch_container (cyclomatic 25) webrender/core/src/renderer/mod.rs:2837 — Renderer::draw_alpha_batch_container 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.
  • Renderer::draw_frame (cyclomatic 25) webrender/core/src/renderer/mod.rs:4534 — Renderer::draw_frame 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.
  • Renderer::update_texture_cache (cyclomatic 21) webrender/core/src/renderer/mod.rs:1796 — Renderer::update_texture_cache 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.
  • Renderer::draw_color_target (cyclomatic 21) webrender/core/src/renderer/mod.rs:3568 — Renderer::draw_color_target has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • Renderer::draw_texture_cache_target (cyclomatic 18) webrender/core/src/renderer/mod.rs:3949 — Renderer::draw_texture_cache_target 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.
D2 · Cognitive Complexity · Win32Window · ×7
  • Win32Window::render_and_present (cognitive 242) dll/src/desktop/shell2/windows/mod.rs:1139 — Win32Window::render_and_present has cognitive complexity 242 (threshold 15). Drivers by points: if/else 58 (187 pts), loops 4 (32 pts), match/switch 3 (12 pts), boolean chains 11 (nesting depth added 166). 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.
  • Win32Window::sync_window_state (cognitive 50) dll/src/desktop/shell2/windows/mod.rs:2724 — Win32Window::sync_window_state has cognitive complexity 50 (threshold 15). Drivers by points: if/else 28 (41 pts), match/switch 4 (7 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Win32Window::new (cognitive 47) dll/src/desktop/shell2/windows/mod.rs:300 — Win32Window::new has cognitive complexity 47 (threshold 15). Drivers by points: if/else 29 (41 pts), loops 2 (3 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.
  • Win32Window::feed_pointer (cognitive 37) dll/src/desktop/shell2/windows/mod.rs:3591 — Win32Window::feed_pointer has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18 (30 pts), match/switch 3 (5 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Win32Window::try_show_context_menu (cognitive 27) dll/src/desktop/shell2/windows/mod.rs:3359 — Win32Window::try_show_context_menu has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Win32Window::regenerate_layout_inner (cognitive 17) dll/src/desktop/shell2/windows/mod.rs:1815 — Win32Window::regenerate_layout_inner has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Win32Window::route_main_window_result (cognitive 16) dll/src/desktop/shell2/windows/mod.rs:2008 — Win32Window::route_main_window_result has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 1 (3 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 · RemillTranspiler · ×7
  • RemillTranspiler::lift_with_transitive_deps_sequential (cognitive 242) dll/src/web/transpiler_remill.rs:2167 — RemillTranspiler::lift_with_transitive_deps_sequential has cognitive complexity 242 (threshold 15). Drivers by points: if/else 57 (171 pts), loops 20 (39 pts), match/switch 10 (25 pts), boolean chains 7 (nesting depth added 148). 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.
  • RemillTranspiler::produce_object_from_lifted_ir (cognitive 153) dll/src/web/transpiler_remill.rs:1272 — RemillTranspiler::produce_object_from_lifted_ir has cognitive complexity 153 (threshold 15). Drivers by points: if/else 46 (126 pts), boolean chains 25, loops 1, match/switch 1 (nesting depth added 80). 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.
  • RemillTranspiler::lift_with_transitive_deps_batched (cognitive 115) dll/src/web/transpiler_remill.rs:3387 — RemillTranspiler::lift_with_transitive_deps_batched has cognitive complexity 115 (threshold 15). Drivers by points: if/else 35 (75 pts), loops 18 (32 pts), boolean chains 6, match/switch 1 (2 pts) (nesting depth added 55). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • RemillTranspiler::lift_fn (cognitive 52) dll/src/web/transpiler_remill.rs:1013 — RemillTranspiler::lift_fn has cognitive complexity 52 (threshold 15). Drivers by points: if/else 20 (44 pts), loops 1 (6 pts), boolean chains 2 (nesting depth added 29). 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.
  • RemillTranspiler::emit_indirect_dispatcher_obj (cognitive 30) dll/src/web/transpiler_remill.rs:3039 — RemillTranspiler::emit_indirect_dispatcher_obj has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (18 pts), loops 7 (8 pts), match/switch 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • RemillTranspiler::link_objects_to_wasm (cognitive 18) dll/src/web/transpiler_remill.rs:1924 — RemillTranspiler::link_objects_to_wasm has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (11 pts), loops 4 (6 pts), match/switch 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • RemillTranspiler::dispatcher_csynths (cognitive 18) dll/src/web/transpiler_remill.rs:3306 — RemillTranspiler::dispatcher_csynths has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TileCacheInstance · ×7
  • TileCacheInstance::update_prim_dependencies (cognitive 161) webrender/core/src/picture.rs:3038 — TileCacheInstance::update_prim_dependencies has cognitive complexity 161 (threshold 15). Drivers by points: if/else 48 (112 pts), loops 12 (29 pts), boolean chains 10, match/switch 5 (10 pts) (nesting depth added 86). 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.
  • TileCacheInstance::pre_update (cognitive 106) webrender/core/src/picture.rs:2047 — TileCacheInstance::pre_update has cognitive complexity 106 (threshold 15). Drivers by points: if/else 23 (61 pts), loops 15 (31 pts), boolean chains 7, match/switch 4 (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.
  • TileCacheInstance::post_update (cognitive 50) webrender/core/src/picture.rs:3850 — TileCacheInstance::post_update has cognitive complexity 50 (threshold 15). Drivers by points: loops 15 (32 pts), if/else 8 (18 pts) (nesting depth added 27). 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.
  • TileCacheInstance::setup_compositor_surfaces_impl (cognitive 35) webrender/core/src/picture.rs:2710 — TileCacheInstance::setup_compositor_surfaces_impl has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (21 pts), match/switch 6 (10 pts), boolean chains 4 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TileCacheInstance::prepare_for_new_scene (cognitive 29) webrender/core/src/picture.rs:1942 — TileCacheInstance::prepare_for_new_scene has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 3 (10 pts) (nesting depth added 20). 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.
  • TileCacheInstance::can_promote_to_surface (cognitive 21) webrender/core/src/picture.rs:2508 — TileCacheInstance::can_promote_to_surface has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TileCacheInstance::push_surface (cognitive 20) webrender/core/src/picture.rs:2968 — TileCacheInstance::push_surface has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (7 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MacOSWindow · ×7
  • MacOSWindow::render_and_present_in_draw_rect (cognitive 128) dll/src/desktop/shell2/macos/mod.rs:7700 — MacOSWindow::render_and_present_in_draw_rect has cognitive complexity 128 (threshold 15). Drivers by points: if/else 46 (94 pts), match/switch 8 (28 pts), boolean chains 6 (nesting depth added 68). 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.
  • MacOSWindow::sync_window_state (cognitive 67) dll/src/desktop/shell2/macos/mod.rs:6307 — MacOSWindow::sync_window_state has cognitive complexity 67 (threshold 15). Drivers by points: if/else 31 (55 pts), match/switch 5 (10 pts), boolean chains 2 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • MacOSWindow::new_with_options_internal (cognitive 51) dll/src/desktop/shell2/macos/mod.rs:4965 — MacOSWindow::new_with_options_internal has cognitive complexity 51 (threshold 15). Drivers by points: if/else 31 (35 pts), match/switch 10 (13 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 8). 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.
  • MacOSWindow::apply_background_material (cognitive 38) dll/src/desktop/shell2/macos/mod.rs:6875 — MacOSWindow::apply_background_material has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (33 pts), match/switch 3 (5 pts) (nesting depth added 22). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • MacOSWindow::handle_scroll_wheel (cognitive 36) dll/src/desktop/shell2/macos/events.rs:459 — MacOSWindow::handle_scroll_wheel has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (29 pts), boolean chains 4, match/switch 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • MacOSWindow::initialize_display_link (cognitive 21) dll/src/desktop/shell2/macos/mod.rs:4724 — MacOSWindow::initialize_display_link has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 3, match/switch 1 (nesting depth added 4). Most of this is not in the body itself: 8 of the 21 points are its own statements and the rest belongs to 2 function items inside it that branch (mark_views_dirty_on_main, display_link_callback). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • MacOSWindow::update_keyboard_state (cognitive 16) dll/src/desktop/shell2/macos/events.rs:1205 — MacOSWindow::update_keyboard_state has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 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 · SwCompositor · ×7
  • SwCompositor::occlude_surfaces (cognitive 48) webrender/core/src/compositor/sw_compositor.rs:840 — SwCompositor::occlude_surfaces has cognitive complexity 48 (threshold 15). Drivers by points: if/else 11 (35 pts), boolean chains 7, loops 3 (4 pts), match/switch 1 (2 pts) (nesting depth added 26). Of this number, 41 points are the body's own statements and 7 belong to 3 function items inside it that branch. 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.
  • SwCompositor::flush_composites (cognitive 43) webrender/core/src/compositor/sw_compositor.rs:1130 — SwCompositor::flush_composites has cognitive complexity 43 (threshold 15). Drivers by points: if/else 9 (30 pts), loops 3 (8 pts), match/switch 4 (5 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SwCompositor::start_compositing (cognitive 40) webrender/core/src/compositor/sw_compositor.rs:1538 — SwCompositor::start_compositing has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 7 (18 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SwCompositor::queue_composite (cognitive 32) webrender/core/src/compositor/sw_compositor.rs:1017 — SwCompositor::queue_composite has cognitive complexity 32 (threshold 15). Drivers by points: match/switch 4 (21 pts), if/else 6 (11 pts) (nesting depth added 22). 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.
  • SwCompositor::init_overlaps (cognitive 23) webrender/core/src/compositor/sw_compositor.rs:958 — SwCompositor::init_overlaps has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SwCompositor::bind (cognitive 19) webrender/core/src/compositor/sw_compositor.rs:1391 — SwCompositor::bind has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • SwCompositor::end_frame (cognitive 16) webrender/core/src/compositor/sw_compositor.rs:1618 — SwCompositor::end_frame has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (8 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Edited copies of one member (3 members, 12+ corresponding lines) · ×7
  • Edited copies of one member (3 members, 12+ corresponding lines) doc/src/codegen/v2/lang_d/wrappers.rs:202 — doc/src/codegen/v2/lang_d/wrappers.rs:202-213 | doc/src/codegen/v2/lang_swift/wrappers.rs:158-169 | doc/src/codegen/v2/lang_swift/wrappers.rs:209-221 — 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) doc/src/codegen/v2/lang_crystal/wrappers.rs:197 — doc/src/codegen/v2/lang_crystal/wrappers.rs:197-209 | doc/src/codegen/v2/lang_crystal/wrappers.rs:212-223 | doc/src/codegen/v2/lang_crystal/wrappers.rs:226-237 — 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) doc/src/codegen/v2/lang_crystal/wrappers.rs:1433 — doc/src/codegen/v2/lang_crystal/wrappers.rs:1433-1447 | doc/src/codegen/v2/lang_d/wrappers.rs:2362-2373 | doc/src/codegen/v2/lang_swift/wrappers.rs:2339-2353 — 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) layout/src/widgets/ribbon.rs:816 — layout/src/widgets/ribbon.rs:816-827 | layout/src/widgets/ribbon.rs:829-843 | layout/src/widgets/ribbon.rs:944-957 — 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) dll/src/desktop/extra/file_picker/mod.rs:74 — dll/src/desktop/extra/file_picker/mod.rs:74-97 | dll/src/desktop/extra/file_picker/mod.rs:102-113 | dll/src/desktop/extra/file_picker/mod.rs:118-129 — 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) doc/src/codegen/v2/lang_crystal/mod.rs:426 — doc/src/codegen/v2/lang_crystal/mod.rs:426-439 | doc/src/codegen/v2/lang_ocaml/wrappers.rs:2022-2035 | doc/src/codegen/v2/lang_perl/types.rs:725-736 — 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) css/src/props/style/filter.rs:497 — css/src/props/style/filter.rs:497-508 | css/src/props/style/filter.rs:560-571 | css/src/props/style/filter.rs:634-646 — 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 (3 members, 14+ corresponding lines) · ×7
  • Edited copies of one member (3 members, 14+ corresponding lines) doc/src/api.rs:2578 — doc/src/api.rs:2578-2594 | doc/src/codegen/v2/lang_c.rs:1265-1281 | doc/src/codegen/v2/lang_zig/c_decls.rs:186-199 — 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) layout/src/widgets/ribbon.rs:1074 — layout/src/widgets/ribbon.rs:1074-1088 | layout/src/widgets/ribbon.rs:1118-1131 | layout/src/widgets/ribbon.rs:1205-1218 — 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) layout/src/icu_macos.rs:185 — layout/src/icu_macos.rs:185-198 | layout/src/icu_macos.rs:200-222 | layout/src/icu_macos.rs:224-244 — 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) core/src/gl.rs:3498 — core/src/gl.rs:3498-3514 | core/src/gl.rs:3708-3721 | core/src/gl.rs:3765-3782 — 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) layout/src/widgets/ribbon.rs:4075 — layout/src/widgets/ribbon.rs:4075-4088 | layout/src/widgets/ribbon.rs:4091-4105 | layout/src/widgets/ribbon.rs:4108-4122 — 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) layout/src/widgets/progressbar.rs:312 — layout/src/widgets/progressbar.rs:312-325 | layout/src/widgets/progressbar.rs:354-367 | layout/src/widgets/text_input.rs:914-928 — 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) layout/src/callbacks.rs:3838 — layout/src/callbacks.rs:3838-3855 | layout/src/callbacks.rs:6413-6426 | layout/src/callbacks.rs:6701-6718 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 15+ corresponding lines) · ×7
  • Edited copies of one member (3 members, 15+ corresponding lines) layout/src/widgets/ribbon.rs:1042 — layout/src/widgets/ribbon.rs:1042-1060 | layout/src/widgets/ribbon.rs:1090-1104 | layout/src/widgets/ribbon.rs:1220-1238 — 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) layout/src/callbacks.rs:1567 — layout/src/callbacks.rs:1567-1581 | layout/src/callbacks.rs:1591-1605 | layout/src/callbacks.rs:1615-1629 — 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) layout/src/solver3/fc.rs:6050 — layout/src/solver3/fc.rs:6050-6064 | layout/src/solver3/fc.rs:6070-6089 | layout/src/solver3/fc.rs:6136-6150 — 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) core/src/a11y.rs:511 — core/src/a11y.rs:511-528 | core/src/a11y.rs:704-718 | core/src/a11y.rs:793-807 — 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) webrender/swgl/src/shaders/cs_linear_gradient.rs:222 — webrender/swgl/src/shaders/cs_linear_gradient.rs:222-238 | webrender/swgl/src/shaders/cs_radial_gradient.rs:247-261 | webrender/swgl/src/shaders/ps_quad_radial_gradient.rs:304-327 — 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) css/src/codegen/format.rs:995 — css/src/codegen/format.rs:995-1009 | css/src/codegen/format.rs:1011-1028 | css/src/codegen/format.rs:1030-1049 — 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) doc/src/codegen/v2/lang_freebasic/functions.rs:31 — doc/src/codegen/v2/lang_freebasic/functions.rs:31-45 | doc/src/codegen/v2/lang_nim/functions.rs:33-47 | doc/src/codegen/v2/lang_vb6/functions.rs:46-60 — 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 · Duplicated block (25 lines × 2) · ×7
  • Duplicated block (25 lines × 2) core/src/gamepad.rs:203 — core/src/gamepad.rs:203-227 | core/src/gamepad.rs:236-260 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/gamepad.rs:203` 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 (25 lines × 2) dll/src/desktop/shell2/android/mod.rs:225 — dll/src/desktop/shell2/android/mod.rs:225-249 | dll/src/desktop/shell2/ios/mod.rs:1743-1767 — `dll/src/desktop/shell2/android/mod.rs` and `dll/src/desktop/shell2/ios/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 17 separate duplicated blocks between them, totalling at least 242 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/android/mod.rs:225` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (25 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:3306 — dll/src/desktop/shell2/linux/wayland/mod.rs:3306-3330 | dll/src/desktop/shell2/linux/x11/mod.rs:4309-4333 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (25 lines × 2) doc/src/codegen/v2/lang_d/wrappers.rs:619 — doc/src/codegen/v2/lang_d/wrappers.rs:619-643 | doc/src/codegen/v2/lang_swift/wrappers.rs:452-476 — `doc/src/codegen/v2/lang_d/wrappers.rs` and `doc/src/codegen/v2/lang_swift/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 27 separate duplicated blocks between them, totalling at least 281 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (25 lines × 2) layout/src/solver3/fc.rs:2406 — layout/src/solver3/fc.rs:2406-2430 | layout/src/solver3/fc.rs:2502-2526 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/fc.rs:2406` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (25 lines × 2) layout/src/window.rs:11375 — layout/src/window.rs:11375-11399 | layout/src/window.rs:11434-11458 — both copies are in the same file, so extract the 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, `layout/src/window.rs:11370` calls `Some`, `insert` and `layout/src/window.rs:11428` 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 (25 lines × 2) doc/src/codegen/v2/lang_d/wrappers.rs:646 — doc/src/codegen/v2/lang_d/wrappers.rs:646-670 | doc/src/codegen/v2/lang_swift/wrappers.rs:479-503 — `doc/src/codegen/v2/lang_d/wrappers.rs` and `doc/src/codegen/v2/lang_swift/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 27 separate duplicated blocks between them, totalling at least 281 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (17 lines × 3) · ×7
  • Duplicated block (17 lines × 3) dll/src/desktop/shell2/linux/wayland/mod.rs:2780 — dll/src/desktop/shell2/linux/wayland/mod.rs:2780-2796 | dll/src/desktop/shell2/linux/x11/mod.rs:4140-4156 | dll/src/desktop/shell2/windows/mod.rs:1031-1047 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:2780` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 3) dll/src/desktop/shell2/linux/wayland/mod.rs:3380 — dll/src/desktop/shell2/linux/wayland/mod.rs:3380-3396 | dll/src/desktop/shell2/linux/x11/mod.rs:4382-4398 | dll/src/desktop/shell2/windows/mod.rs:6285-6301 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:3380` it begins part-way through the construct above it, so those exact lines 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) dll/src/desktop/wr_translate2.rs:2405 — dll/src/desktop/wr_translate2.rs:2405-2421 | dll/src/desktop/wr_translate2.rs:2540-2556 | dll/src/desktop/wr_translate2.rs:2650-2666 — all 3 copies are in the same file, so extract the block into one function there and call 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 (17 lines × 3) doc/src/autofix/debug.rs:723 — doc/src/autofix/debug.rs:723-739 | doc/src/autofix/debug.rs:889-905 | doc/src/autofix/debug.rs:1020-1036 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (17 lines × 3) doc/src/autofix/type_index.rs:255 — doc/src/autofix/type_index.rs:255-271 | doc/src/autofix/type_index.rs:495-511 | doc/src/autofix/type_index.rs:531-547 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/type_index.rs:255` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 3) layout/src/text3/dense.rs:1219 — layout/src/text3/dense.rs:1219-1235 | layout/src/text3/dense.rs:1334-1350 | layout/src/text3/dense.rs:1501-1517 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (17 lines × 3) doc/src/codegen/v2/lang_crystal/model.rs:511 — doc/src/codegen/v2/lang_crystal/model.rs:511-527 | doc/src/codegen/v2/lang_d/model.rs:807-823 | doc/src/codegen/v2/lang_swift/model.rs:813-829 — `doc/src/codegen/v2/lang_crystal/model.rs` and `doc/src/codegen/v2/lang_d/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 88 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (14–16 lines × 2) · ×7
  • Duplicated block (14–16 lines × 2) dll/src/desktop/shell2/run.rs:962 — dll/src/desktop/shell2/run.rs:962-977 | dll/src/desktop/shell2/run.rs:1149-1162 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/run.rs:962` it does not close everything it opens, so those exact lines 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) doc/src/codegen/v2/lang_csharp/types.rs:732 — doc/src/codegen/v2/lang_csharp/types.rs:732-747 | doc/src/codegen/v2/lang_java/types.rs:957-970 — `doc/src/codegen/v2/lang_csharp/types.rs` and `doc/src/codegen/v2/lang_java/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 72 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_csharp/types.rs:732` it begins part-way through the construct above it, so those 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) doc/src/codegen/v2/lang_python.rs:3242 — doc/src/codegen/v2/lang_python.rs:3242-3255 | doc/src/codegen/v2/lang_python.rs:3259-3274 — both copies are in the same file, so extract the block into 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–16 lines × 2) doc/src/main.rs:2578 — doc/src/main.rs:2578-2593 | doc/src/main.rs:2597-2610 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/main.rs:2578` it begins part-way through the construct above it, so those exact lines 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) layout/src/solver3/fc.rs:8773 — layout/src/solver3/fc.rs:8773-8786 | layout/src/solver3/fc.rs:9269-9284 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/fc.rs:8773` it begins part-way through the construct above it, so those exact lines 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) layout/src/solver3/layout_tree.rs:2126 — layout/src/solver3/layout_tree.rs:2126-2141 | layout/src/solver3/layout_tree.rs:2840-2853 — both copies are in the same file, so extract the block into 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–16 lines × 2) layout/src/window.rs:15743 — layout/src/window.rs:15743-15758 | layout/src/window.rs:15781-15794 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/window.rs:15743` it begins part-way through the construct above it, so those 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–14 lines × 2) · ×7
  • Duplicated block (12–14 lines × 2) dll/src/desktop/compositor2.rs:2273 — dll/src/desktop/compositor2.rs:2273-2284 | dll/src/desktop/compositor2.rs:2326-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.
  • Duplicated block (12–14 lines × 2) doc/src/autofix/diff.rs:1814 — doc/src/autofix/diff.rs:1814-1827 | doc/src/autofix/diff.rs:1883-1894 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/diff.rs:1814` it begins part-way through the construct above it, so those 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–14 lines × 2) doc/src/codegen/v2/lang_d/model.rs:817 — doc/src/codegen/v2/lang_d/model.rs:817-828 | doc/src/codegen/v2/lang_swift/model.rs:823-836 — `doc/src/codegen/v2/lang_d/model.rs` and `doc/src/codegen/v2/lang_swift/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 21 separate duplicated blocks between them, totalling at least 240 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_d/model.rs:817` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–14 lines × 2) doc/src/codegen/v2/lang_ruby/types.rs:1020 — doc/src/codegen/v2/lang_ruby/types.rs:1020-1033 | doc/src/codegen/v2/lang_ruby/types.rs:1093-1104 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_ruby/types.rs:1020` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–14 lines × 2) layout/src/solver3/fc.rs:8934 — layout/src/solver3/fc.rs:8934-8945 | layout/src/solver3/fc.rs:9472-9485 — both copies are in the same file, so extract the 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–14 lines × 2) layout/src/solver3/getters.rs:4350 — layout/src/solver3/getters.rs:4350-4363 | layout/src/solver3/getters.rs:4389-4400 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/getters.rs:4350` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–14 lines × 2) dll/src/desktop/shell2/linux/x11/mod.rs:1650 — dll/src/desktop/shell2/linux/x11/mod.rs:1650-1661 | dll/src/desktop/shell2/linux/x11/mod.rs:1702-1715 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×7
  • Duplicated block (12 lines × 3) dll/src/desktop/shell2/common/event.rs:686 — dll/src/desktop/shell2/common/event.rs:686-697 | dll/src/desktop/shell2/common/event.rs:942-953 | dll/src/desktop/shell2/common/event.rs:996-1007 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/common/event.rs:686` 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) layout/src/callbacks.rs:1935 — layout/src/callbacks.rs:1935-1946 | layout/src/callbacks.rs:7264-7275 | layout/src/timer.rs:371-382 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 3) layout/src/window.rs:13952 — layout/src/window.rs:13952-13963 | layout/src/window.rs:14304-14315 | layout/src/window.rs:14706-14717 — all 3 copies are in the same file, so extract the block into one function there and call 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) doc/src/codegen/v2/lang_ada/types.rs:216 — doc/src/codegen/v2/lang_ada/types.rs:216-227 | doc/src/codegen/v2/lang_ocaml/types.rs:342-353 | doc/src/codegen/v2/lang_smalltalk/types.rs:99-110 — `doc/src/codegen/v2/lang_ada/types.rs` and `doc/src/codegen/v2/lang_ocaml/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 40 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (12 lines × 3) layout/src/text3/cache.rs:6390 — layout/src/text3/cache.rs:6390-6401 | layout/src/text3/cache.rs:6478-6492 | layout/src/text3/cache.rs:6548-6562 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/text3/cache.rs:6390` 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 (12 lines × 3) doc/src/autofix/workspace.rs:1070 — doc/src/autofix/workspace.rs:1070-1081 | doc/src/autofix/workspace.rs:1091-1103 | doc/src/autofix/workspace.rs:1271-1284 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/workspace.rs:1070` 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) doc/src/codegen/v2/lang_rust.rs:3155 — doc/src/codegen/v2/lang_rust.rs:3155-3166 | doc/src/codegen/v2/lang_rust.rs:3225-3237 | doc/src/codegen/v2/lang_rust.rs:3278-3289 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×7
  • Duplicated block (8 lines × 4) dll/src/desktop/shell2/common/debug_server/platform.rs:187 — dll/src/desktop/shell2/common/debug_server/platform.rs:187-194 | dll/src/desktop/shell2/common/debug_server/platform.rs:399-406 | dll/src/desktop/shell2/common/debug_server/platform.rs:432-439 | dll/src/desktop/shell2/common/debug_server/platform.rs:458-465 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 4) dll/src/desktop/shell2/common/layout.rs:68 — dll/src/desktop/shell2/common/layout.rs:68-75 | dll/src/desktop/wr_translate2.rs:2406-2413 | dll/src/desktop/wr_translate2.rs:2541-2548 | dll/src/desktop/wr_translate2.rs:2651-2658 — 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 `dll/src/desktop/shell2/common/layout.rs:68` it does not close everything it opens, so those exact lines 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) layout/src/widgets/themes/flat.rs:906 — layout/src/widgets/themes/flat.rs:906-913 | layout/src/widgets/themes/flat.rs:1581-1588 | layout/src/widgets/themes/flora.rs:1178-1185 | layout/src/widgets/themes/flora.rs:2000-2007 — before extracting anything, compare `layout/src/widgets/themes/flat.rs` and `layout/src/widgets/themes/flora.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 927 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `layout/src/widgets/themes/flat.rs:906` it begins part-way through the construct above it, so those exact lines 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) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:413 — webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:413-420 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:413-422 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:404-411 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:342-350 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs` and `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 439 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:413` 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 × 4) webrender/swgl/src/shaders/brush_linear_gradient.rs:227 — webrender/swgl/src/shaders/brush_linear_gradient.rs:227-234 | webrender/swgl/src/shaders/brush_linear_gradient_alpha_pass.rs:236-243 | webrender/swgl/src/shaders/cs_conic_gradient.rs:178-185 | webrender/swgl/src/shaders/cs_linear_gradient.rs:166-173 — before extracting anything, compare `webrender/swgl/src/shaders/brush_linear_gradient.rs` and `webrender/swgl/src/shaders/brush_linear_gradient_alpha_pass.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 218 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_linear_gradient.rs:227` 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 × 4) layout/src/widgets/backstage.rs:1059 — layout/src/widgets/backstage.rs:1059-1066 | layout/src/widgets/quick_access.rs:1036-1043 | layout/src/widgets/ribbon.rs:3601-3608 | layout/src/widgets/statusbar.rs:1483-1490 — before extracting anything, compare `layout/src/widgets/backstage.rs` and `layout/src/widgets/quick_access.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `layout/src/widgets/backstage.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 × 4) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:217 — webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:217-224 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:221-228 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:227-234 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:221-228 — before extracting anything, compare `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs` and `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 334 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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, `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:214` calls `extend`, `xyxy` and `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:218` 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 × 5) · ×7
  • Duplicated block (7 lines × 5) dll/src/desktop/shell2/common/event.rs:6581 — dll/src/desktop/shell2/common/event.rs:6581-6587 | dll/src/desktop/shell2/common/event.rs:11164-11170 | dll/src/desktop/shell2/common/event.rs:11842-11849 | dll/src/desktop/shell2/common/event.rs:11935-11942 | dll/src/desktop/shell2/common/event.rs:12146-12152 — 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 `dll/src/desktop/shell2/common/event.rs:6581` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 5) doc/src/codegen/v2/lang_python.rs:1122 — doc/src/codegen/v2/lang_python.rs:1122-1128 | doc/src/codegen/v2/lang_rust.rs:4662-4668 | doc/src/codegen/v2/lang_rust.rs:4698-4704 | doc/src/codegen/v2/lang_rust.rs:4730-4736 | doc/src/codegen/v2/lang_rust.rs:4766-4772 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (7 lines × 5) doc/src/main.rs:1636 — doc/src/main.rs:1636-1642 | doc/src/main.rs:1647-1653 | doc/src/main.rs:1674-1680 | doc/src/main.rs:1685-1691 | doc/src/main.rs:1696-1702 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 5) webrender/core/src/prim_store/picture.rs:785 — webrender/core/src/prim_store/picture.rs:785-791 | webrender/core/src/prim_store/picture.rs:812-818 | webrender/core/src/prim_store/picture.rs:901-907 | webrender/core/src/prim_store/picture.rs:920-926 | webrender/core/src/prim_store/picture.rs:949-955 — 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 `webrender/core/src/prim_store/picture.rs:785` 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, `webrender/core/src/prim_store/picture.rs:918` calls `from_f32_px` and `webrender/core/src/prim_store/picture.rs:783` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 5) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:268 — webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:268-275 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:255-262 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:261-268 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:176-182 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:264-271 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs` and `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 369 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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.
  • Duplicated block (7 lines × 5) webrender/swgl/src/shaders/brush_linear_gradient.rs:225 — webrender/swgl/src/shaders/brush_linear_gradient.rs:225-231 | webrender/swgl/src/shaders/brush_linear_gradient_alpha_pass.rs:234-240 | webrender/swgl/src/shaders/cs_conic_gradient.rs:176-182 | webrender/swgl/src/shaders/cs_linear_gradient.rs:164-170 | webrender/swgl/src/shaders/ps_quad_conic_gradient.rs:269-275 — before extracting anything, compare `webrender/swgl/src/shaders/brush_linear_gradient.rs` and `webrender/swgl/src/shaders/brush_linear_gradient_alpha_pass.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 218 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 5) webrender/swgl/src/shaders/ps_quad_conic_gradient.rs:379 — webrender/swgl/src/shaders/ps_quad_conic_gradient.rs:379-385 | webrender/swgl/src/shaders/ps_quad_mask.rs:556-562 | webrender/swgl/src/shaders/ps_quad_mask_fast_path.rs:487-493 | webrender/swgl/src/shaders/ps_quad_radial_gradient.rs:367-373 | webrender/swgl/src/shaders/ps_quad_textured.rs:474-480 — before extracting anything, compare `webrender/swgl/src/shaders/ps_quad_conic_gradient.rs` and `webrender/swgl/src/shaders/ps_quad_mask.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/swgl/src/shaders/ps_quad_textured.rs:474` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `webrender/swgl/src/shaders/ps_quad_textured.rs:473` calls `strcmp` and `webrender/swgl/src/shaders/ps_quad_conic_gradient.rs:378` 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.
R10 · Code Duplication · Duplicated block (9 lines × 2 locations) · ×7
  • Duplicated block (9 lines × 2 locations) dll/src/desktop/shell2/common/debugger/debugger.js:1923 — dll/src/desktop/shell2/common/debugger/debugger.js:1923 · dll/src/desktop/shell2/common/debugger/debugger.js:1935 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (9 lines × 2 locations) dll/src/desktop/shell2/common/debugger/debugger.js:2352 — dll/src/desktop/shell2/common/debugger/debugger.js:2352 · dll/src/desktop/shell2/common/debugger/debugger.js:2441 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (9 lines × 2 locations) dll/src/desktop/shell2/common/debugger/debugger.js:3137 — dll/src/desktop/shell2/common/debugger/debugger.js:3137 · dll/src/desktop/shell2/common/debugger/debugger.js:3167 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (9 lines × 2 locations) dll/src/desktop/shell2/common/debugger/debugger.js:3582 — dll/src/desktop/shell2/common/debugger/debugger.js:3582 · dll/src/desktop/shell2/common/debugger/debugger.js:3629 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (9 lines × 2 locations) dll/src/desktop/shell2/common/debugger/debugger.js:3828 — dll/src/desktop/shell2/common/debugger/debugger.js:3828 · dll/src/desktop/shell2/common/debugger/debugger.js:3950 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (9 lines × 2 locations) dll/src/desktop/shell2/common/debugger/debugger.js:3939 — dll/src/desktop/shell2/common/debugger/debugger.js:3939 · dll/src/desktop/shell2/common/debugger/debugger.js:4479 — both copies are in the same file, so extract the block into 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 locations) dll/src/desktop/shell2/common/debugger/debugger.js:4130 — dll/src/desktop/shell2/common/debugger/debugger.js:4130 · dll/src/desktop/shell2/common/debugger/debugger.js:4230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D1 · Cyclomatic Complexity · CssPropertyCache · ×6
  • CssPropertyCache::build_compact_cache_with_inheritance_debug (cyclomatic 98) core/src/compact.rs:503 — CssPropertyCache::build_compact_cache_with_inheritance_debug has cyclomatic complexity 98 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • CssPropertyCache::get_computed_css_style_string (cyclomatic 85) core/src/prop_cache.rs:2149 — CssPropertyCache::get_computed_css_style_string has cyclomatic complexity 85 (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.
  • CssPropertyCache::restyle (cyclomatic 77) core/src/prop_cache.rs:1570 — CssPropertyCache::restyle has cyclomatic complexity 77 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • CssPropertyCache::build_compact_cache (cyclomatic 63) core/src/compact.rs:57 — CssPropertyCache::build_compact_cache has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • CssPropertyCache::get_property_slow (cyclomatic 55) core/src/prop_cache.rs:2783 — CssPropertyCache::get_property_slow has cyclomatic complexity 55 (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.
  • CssPropertyCache::generate_tag_ids (cyclomatic 23) core/src/prop_cache.rs:1960 — CssPropertyCache::generate_tag_ids has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: CssPropertyCache::resolve_property_dependency (cyclomatic 45) 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 · PythonGenerator · ×6
  • PythonGenerator::generate_pymethod (cyclomatic 70) doc/src/codegen/v2/lang_python.rs:2467 — PythonGenerator::generate_pymethod has cyclomatic complexity 70 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • PythonGenerator::generate_callback_trampoline (cyclomatic 38) doc/src/codegen/v2/lang_python.rs:1075 — PythonGenerator::generate_callback_trampoline has cyclomatic complexity 38 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • PythonGenerator::field_type_needs_unsendable (cyclomatic 35) doc/src/codegen/v2/lang_python.rs:3564 — PythonGenerator::field_type_needs_unsendable has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • PythonGenerator::function_has_unsupported_args (cyclomatic 35) doc/src/codegen/v2/lang_python.rs:3771 — PythonGenerator::function_has_unsupported_args has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • PythonGenerator::is_python_compatible_type (cyclomatic 22) doc/src/codegen/v2/lang_python.rs:4009 — PythonGenerator::is_python_compatible_type has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • PythonGenerator::generate_enum_pymethods (cyclomatic 17) doc/src/codegen/v2/lang_python.rs:2316 — PythonGenerator::generate_enum_pymethods 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 · MacOSWindow · ×6
  • MacOSWindow::render_and_present_in_draw_rect (cyclomatic 56) dll/src/desktop/shell2/macos/mod.rs:7700 — MacOSWindow::render_and_present_in_draw_rect 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.
  • MacOSWindow::new_with_options_internal (cyclomatic 42) dll/src/desktop/shell2/macos/mod.rs:4965 — MacOSWindow::new_with_options_internal has cyclomatic complexity 42 (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.
  • MacOSWindow::sync_window_state (cyclomatic 40) dll/src/desktop/shell2/macos/mod.rs:6307 — MacOSWindow::sync_window_state 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.
  • MacOSWindow::apply_background_material (cyclomatic 21) dll/src/desktop/shell2/macos/mod.rs:6875 — MacOSWindow::apply_background_material has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: azul_dll::desktop::shell2::macos::macos_event_name (cyclomatic 24) 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.
  • MacOSWindow::handle_scroll_wheel (cyclomatic 20) dll/src/desktop/shell2/macos/events.rs:459 — MacOSWindow::handle_scroll_wheel 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.
  • MacOSWindow::initialize_display_link (cyclomatic 17) dll/src/desktop/shell2/macos/mod.rs:4724 — MacOSWindow::initialize_display_link has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 2 function items inside it that branch (mark_views_dirty_on_main, display_link_callback). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest. This is NOT this file's highest cyclomatic complexity: azul_dll::desktop::shell2::macos::macos_event_name (cyclomatic 24) 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 · RustGenerator · ×6
  • RustGenerator::generate_transmute_trait_impls_enum (cyclomatic 23) doc/src/codegen/v2/lang_rust.rs:2963 — RustGenerator::generate_transmute_trait_impls_enum has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • RustGenerator::generate_transmute_trait_impls (cyclomatic 21) doc/src/codegen/v2/lang_rust.rs:2733 — RustGenerator::generate_transmute_trait_impls has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • RustGenerator::generate_method (cyclomatic 20) doc/src/codegen/v2/lang_rust.rs:2116 — RustGenerator::generate_method 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.
  • RustGenerator::generate_trait_impls (cyclomatic 19) doc/src/codegen/v2/lang_rust.rs:302 — RustGenerator::generate_trait_impls 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.
  • RustGenerator::generate_abi_derived_trait_impls (cyclomatic 17) doc/src/codegen/v2/lang_rust.rs:3586 — RustGenerator::generate_abi_derived_trait_impls 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.
  • RustGenerator::generate_result_convenience_methods (cyclomatic 16) doc/src/codegen/v2/lang_rust.rs:1387 — RustGenerator::generate_result_convenience_methods 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 · CGenerator · ×6
  • CGenerator::generate_monomorphized_type (cognitive 22) doc/src/codegen/v2/lang_c.rs:513 — CGenerator::generate_monomorphized_type has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 5 (10 pts), match/switch 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • CGenerator::generate_tagged_union (cognitive 22) doc/src/codegen/v2/lang_c.rs:764 — CGenerator::generate_tagged_union has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 5 (9 pts), match/switch 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • CGenerator::generate_types (cognitive 20) doc/src/codegen/v2/lang_c.rs:203 — CGenerator::generate_types has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 5, 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.
  • CGenerator::generate_forward_declarations (cognitive 20) doc/src/codegen/v2/lang_c.rs:413 — CGenerator::generate_forward_declarations has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • CGenerator::generate_union_match_helpers (cognitive 19) doc/src/codegen/v2/lang_c.rs:1374 — CGenerator::generate_union_match_helpers has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • CGenerator::generate_function_declaration (cognitive 17) doc/src/codegen/v2/lang_c.rs:869 — CGenerator::generate_function_declaration has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 3 (4 pts), loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (34 corresponding lines) · ×6
  • Edited copy of a member (34 corresponding lines) webrender/swgl/src/shaders/cs_blur_alpha_target.rs:134 — webrender/swgl/src/shaders/cs_blur_alpha_target.rs:134-167 | webrender/swgl/src/shaders/cs_blur_color_target.rs:126-161 — 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) dll/src/desktop/extra/biometric/mod.rs:50 — dll/src/desktop/extra/biometric/mod.rs:50-85 | dll/src/desktop/extra/keyring/mod.rs:40-73 — 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) dll/src/desktop/extra/sqlite/mod.rs:534 — dll/src/desktop/extra/sqlite/mod.rs:534-567 | dll/src/desktop/extra/sqlite/mod.rs:571-604 — 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) webrender/core/src/util.rs:246 — webrender/core/src/util.rs:246-279 | webrender/core/src/util.rs:281-315 — 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) doc/src/codegen/v2/lang_csharp/types.rs:42 — doc/src/codegen/v2/lang_csharp/types.rs:42-84 | doc/src/codegen/v2/lang_smalltalk/types.rs:44-77 — 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) layout/src/managers/scroll_state.rs:1478 — layout/src/managers/scroll_state.rs:1478-1518 | layout/src/managers/scroll_state.rs:1528-1561 — 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 (39 corresponding lines) · ×6
  • Edited copy of a member (39 corresponding lines) doc/src/codegen/v2/lang_cobol/functions.rs:133 — doc/src/codegen/v2/lang_cobol/functions.rs:133-180 | doc/src/codegen/v2/lang_cobol/types.rs:434-472 — 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.
  • Edited copy of a member (39 corresponding lines) layout/src/widgets/camera.rs:444 — layout/src/widgets/camera.rs:444-485 | layout/src/widgets/screencap.rs:393-431 — 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.
  • Edited copy of a member (39 corresponding lines) layout/src/widgets/camera.rs:230 — layout/src/widgets/camera.rs:230-270 | layout/src/widgets/screencap.rs:200-238 — 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.
  • Edited copy of a member (39 corresponding lines) doc/src/codegen/v2/lang_java/derives.rs:430 — doc/src/codegen/v2/lang_java/derives.rs:430-468 | doc/src/codegen/v2/lang_java/derives.rs:573-612 — 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.
  • Edited copy of a member (39 corresponding lines) layout/src/cpurender/compositor.rs:2502 — layout/src/cpurender/compositor.rs:2502-2542 | layout/src/cpurender/raster.rs:1405-1443 — 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.
  • Edited copy of a member (39 corresponding lines) dll/src/desktop/shell2/linux/wayland/mod.rs:1087 — dll/src/desktop/shell2/linux/wayland/mod.rs:1087-1125 | dll/src/desktop/shell2/linux/x11/events.rs:1711-1751 — 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 (3 members, 10+ corresponding lines) · ×6
  • Edited copies of one member (3 members, 10+ corresponding lines) webrender/swgl/src/shaders/cs_conic_gradient.rs:49 — webrender/swgl/src/shaders/cs_conic_gradient.rs:49-60 | webrender/swgl/src/shaders/cs_linear_gradient.rs:45-54 | webrender/swgl/src/shaders/cs_radial_gradient.rs:49-60 — 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) layout/src/widgets/avatar.rs:300 — layout/src/widgets/avatar.rs:300-309 | layout/src/widgets/check_box.rs:312-321 | layout/src/widgets/switch.rs:355-364 — 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) layout/src/widgets/color_input.rs:1267 — layout/src/widgets/color_input.rs:1267-1279 | layout/src/widgets/color_input.rs:1281-1293 | layout/src/widgets/color_input.rs:1379-1388 — 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) webrender/swgl/src/shaders/ps_quad_conic_gradient.rs:87 — webrender/swgl/src/shaders/ps_quad_conic_gradient.rs:87-99 | webrender/swgl/src/shaders/ps_quad_radial_gradient.rs:73-84 | webrender/swgl/src/shaders/ps_quad_textured.rs:124-133 — 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) webrender/swgl/src/shaders/debug_color.rs:103 — webrender/swgl/src/shaders/debug_color.rs:103-112 | webrender/swgl/src/shaders/debug_font.rs:107-120 | webrender/swgl/src/shaders/ps_clear.rs:122-134 — 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) doc/src/codegen/v2/lang_crystal/wrappers.rs:128 — doc/src/codegen/v2/lang_crystal/wrappers.rs:128-142 | doc/src/codegen/v2/lang_fortran/mod.rs:947-960 | doc/src/codegen/v2/lang_php_ext.rs:1085-1094 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (31 corresponding lines) · ×6
  • Edited copy of a member (31 corresponding lines) doc/src/codegen/v2/lang_ada/functions.rs:241 — doc/src/codegen/v2/lang_ada/functions.rs:241-271 | doc/src/codegen/v2/lang_ada/mod.rs:282-313 — 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) layout/src/widgets/camera.rs:298 — layout/src/widgets/camera.rs:298-335 | layout/src/widgets/screencap.rs:272-302 — 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) layout/src/widgets/slider.rs:216 — layout/src/widgets/slider.rs:216-257 | layout/src/widgets/switch.rs:229-259 — 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) dll/src/web/transpiler_remill.rs:5676 — dll/src/web/transpiler_remill.rs:5676-5712 | dll/src/web/transpiler_remill.rs:5737-5767 — 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) doc/src/codegen/v2/lang_fortran/types.rs:609 — doc/src/codegen/v2/lang_fortran/types.rs:609-646 | doc/src/codegen/v2/lang_pascal/types.rs:487-517 — 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) css/src/props/layout/grid.rs:390 — css/src/props/layout/grid.rs:390-421 | doc/src/autofix/utils.rs:18-48 — 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 (30 corresponding lines) · ×6
  • Edited copy of a member (30 corresponding lines) layout/src/widgets/popover.rs:437 — layout/src/widgets/popover.rs:437-471 | layout/src/widgets/time_picker.rs:823-852 — 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) dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:146 — dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:146-175 | dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:309-339 — 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) doc/src/codegen/v2/lang_smalltalk/types.rs:116 — doc/src/codegen/v2/lang_smalltalk/types.rs:116-145 | doc/src/codegen/v2/lang_smalltalk/types.rs:262-298 — 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) dll/src/desktop/shell2/linux/system_icons.rs:510 — dll/src/desktop/shell2/linux/system_icons.rs:510-539 | dll/src/desktop/shell2/linux/system_icons.rs:554-586 — 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) doc/src/patch/fallback.rs:115 — doc/src/patch/fallback.rs:115-146 | doc/src/patch/index.rs:1094-1123 — 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) dll/src/desktop/menu.rs:357 — dll/src/desktop/menu.rs:357-386 | dll/src/desktop/shell2/linux/wayland/menu.rs:44-77 — 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 (4 corresponding lines) · ×6
  • Edited copy of a member (4 corresponding lines) webrender/swgl/src/shaders/cs_scale_texture_2d.rs:158 — webrender/swgl/src/shaders/cs_scale_texture_2d.rs:158-161 | webrender/swgl/src/shaders/cs_scale_texture_rect.rs:170-173 — 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) core/src/task.rs:1332 — core/src/task.rs:1332-1337 | layout/src/thread.rs:250-253 — 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) webrender/swgl/src/shaders/cs_clip_rectangle_fast_path.rs:360 — webrender/swgl/src/shaders/cs_clip_rectangle_fast_path.rs:360-363 | webrender/swgl/src/shaders/ps_quad_mask_fast_path.rs:404-407 — 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) dll/src/desktop/extra/gamepad/mod.rs:271 — dll/src/desktop/extra/gamepad/mod.rs:271-274 | dll/src/desktop/extra/sensors/mod.rs:54-57 — 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) doc/src/codegen/v2/lang_node/mod.rs:866 — doc/src/codegen/v2/lang_node/mod.rs:866-869 | doc/src/codegen/v2/managed_lang_helpers.rs:129-132 — 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) layout/src/telemetry/config.rs:606 — layout/src/telemetry/config.rs:606-609 | layout/src/telemetry/sharedconfig.rs:61-64 — 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 × 3) · ×6
  • Duplicated block (21 lines × 3) core/src/transform.rs:520 — core/src/transform.rs:520-540 | core/src/transform.rs:542-562 | core/src/transform.rs:564-584 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. 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 (21 lines × 3) layout/src/solver3/fc.rs:1663 — layout/src/solver3/fc.rs:1663-1683 | layout/src/solver3/fc.rs:2409-2429 | layout/src/solver3/fc.rs:2505-2525 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/fc.rs:1663` it begins part-way through the construct above it, so those exact lines 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 × 3) layout/src/widgets/node_graph.rs:3174 — layout/src/widgets/node_graph.rs:3174-3194 | layout/src/widgets/node_graph.rs:3236-3256 | layout/src/widgets/node_graph.rs:3329-3349 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/widgets/node_graph.rs:3174` it begins part-way through the construct above it, so those exact lines 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 × 3) layout/src/solver3/display_list.rs:5154 — layout/src/solver3/display_list.rs:5154-5176 | layout/src/solver3/display_list.rs:5242-5262 | layout/src/solver3/display_list.rs:5288-5342 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/display_list.rs:5154` it begins part-way through the construct above it, so those 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 (21 lines × 3) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:343 — webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:343-363 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:352-372 | webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:306-326 — before extracting anything, compare `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs` and `webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 326 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.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 (21 lines × 3) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:346 — webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:346-366 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:345-365 | webrender/swgl/src/shaders/composite_texture_rect_yuv.rs:304-324 — before extracting anything, compare `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs` and `webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs` as WHOLE FILES: this scan already matched 25 separate duplicated blocks between them, totalling at least 288 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:346` 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 (16–18 lines × 2) · ×6
  • Duplicated block (16–18 lines × 2) doc/src/autofix/diff.rs:630 — doc/src/autofix/diff.rs:630-647 | doc/src/autofix/diff.rs:2251-2266 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/diff.rs:630` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16–18 lines × 2) doc/src/autofix/discovery/parallel.rs:218 — doc/src/autofix/discovery/parallel.rs:218-233 | doc/src/autofix/discovery/workspace.rs:246-263 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `doc/src/autofix/discovery/parallel.rs:236` calls `is_reserved` and `doc/src/autofix/discovery/workspace.rs:265` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (16–18 lines × 2) doc/src/codegen/v2/lang_crystal/wrappers.rs:522 — doc/src/codegen/v2/lang_crystal/wrappers.rs:522-539 | doc/src/codegen/v2/lang_crystal/wrappers.rs:551-566 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_crystal/wrappers.rs:522` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (16–18 lines × 2) doc/src/codegen/v2/lang_lua/wrappers.rs:1316 — doc/src/codegen/v2/lang_lua/wrappers.rs:1316-1331 | doc/src/codegen/v2/lang_lua/wrappers.rs:1453-1470 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_lua/wrappers.rs:1453` 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–18 lines × 2) doc/src/codegen/v2/transmute_helpers.rs:259 — doc/src/codegen/v2/transmute_helpers.rs:259-276 | doc/src/codegen/v2/transmute_helpers.rs:289-304 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/transmute_helpers.rs:259` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16–18 lines × 2) layout/src/cpurender/pixmap.rs:1315 — layout/src/cpurender/pixmap.rs:1315-1332 | layout/src/cpurender/pixmap.rs:1427-1442 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×6
  • Duplicated block (13 lines × 3) doc/src/codegen/v2/lang_haskell/functions.rs:300 — doc/src/codegen/v2/lang_haskell/functions.rs:300-312 | doc/src/codegen/v2/lang_haskell/functions.rs:650-662 | doc/src/codegen/v2/lang_haskell/functions.rs:741-753 — all 3 copies are in the same file, so extract the block into one function there and call 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, `doc/src/codegen/v2/lang_haskell/functions.rs:665` calls `line`, `indent` and `doc/src/codegen/v2/lang_haskell/functions.rs:316` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 3) doc/src/codegen/v2/lang_perl/types.rs:741 — doc/src/codegen/v2/lang_perl/types.rs:741-753 | doc/src/codegen/v2/lang_red/mod.rs:747-759 | doc/src/codegen/v2/managed_host_invoker.rs:562-574 — 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 (13 lines × 3) layout/src/solver3/display_list.rs:2078 — layout/src/solver3/display_list.rs:2078-2090 | layout/src/solver3/display_list.rs:2097-2109 | layout/src/solver3/display_list.rs:2116-2128 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/display_list.rs:2078` it begins part-way through the construct above it, so those exact lines 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) webrender/core/src/render_task.rs:1782 — webrender/core/src/render_task.rs:1782-1794 | webrender/core/src/render_task.rs:1807-1819 | webrender/core/src/render_task.rs:1832-1844 — all 3 copies are in the same file, so extract the block into one function there and call 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 (13 lines × 3) webrender/core/src/renderer/mod.rs:4125 — webrender/core/src/renderer/mod.rs:4125-4137 | webrender/core/src/renderer/mod.rs:4152-4164 | webrender/core/src/renderer/mod.rs:4179-4191 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/core/src/renderer/mod.rs:4125` it begins part-way through the construct above it, so those exact lines 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) dll/src/desktop/shell2/android/mod.rs:982 — dll/src/desktop/shell2/android/mod.rs:982-994 | dll/src/desktop/shell2/android/mod.rs:1746-1758 | dll/src/desktop/shell2/android/mod.rs:1942-1954 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/android/mod.rs:982` 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–13 lines × 2) · ×6
  • Duplicated block (9–13 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:2679 — dll/src/desktop/shell2/linux/wayland/mod.rs:2679-2687 | dll/src/desktop/shell2/linux/x11/mod.rs:4067-4079 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:2679` it does not close everything it opens, so those exact lines 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–13 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:4485 — dll/src/desktop/shell2/linux/wayland/mod.rs:4485-4497 | dll/src/desktop/shell2/linux/x11/events.rs:575-583 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/events.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 263 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 `dll/src/desktop/shell2/linux/wayland/mod.rs:4485` it does not close everything it opens, so those exact lines 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–13 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:7689 — dll/src/desktop/shell2/linux/wayland/mod.rs:7689-7697 | dll/src/desktop/shell2/linux/wayland/mod.rs:7924-7936 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:7924` it begins part-way through the construct above it, so those exact lines 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–13 lines × 2) dll/src/desktop/shell2/linux/x11/events.rs:1542 — dll/src/desktop/shell2/linux/x11/events.rs:1542-1550 | dll/src/desktop/shell2/linux/x11/mod.rs:8029-8041 — 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 `dll/src/desktop/shell2/linux/x11/events.rs:1542` 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–13 lines × 2) layout/src/solver3/display_list.rs:10923 — layout/src/solver3/display_list.rs:10923-10931 | layout/src/solver3/display_list.rs:11110-11122 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/display_list.rs:10923` it begins part-way through the construct above it, so those exact lines 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–13 lines × 2) layout/src/text3/dense.rs:1592 — layout/src/text3/dense.rs:1592-1600 | layout/src/text3/glyphs.rs:546-558 — 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 `layout/src/text3/dense.rs:1592` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 5) · ×6
  • Duplicated block (10 lines × 5) css/src/system.rs:815 — css/src/system.rs:815-824 | css/src/system.rs:842-851 | css/src/system.rs:869-878 | css/src/system.rs:905-914 | css/src/system.rs:932-941 — 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 `css/src/system.rs:815` 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 × 5) dll/src/desktop/shell2/linux/wayland/defines.rs:2067 — dll/src/desktop/shell2/linux/wayland/defines.rs:2067-2076 | dll/src/desktop/shell2/linux/wayland/defines.rs:2199-2208 | dll/src/desktop/shell2/linux/wayland/defines.rs:2381-2390 | dll/src/desktop/shell2/linux/wayland/defines.rs:2891-2900 | dll/src/desktop/shell2/linux/wayland/defines.rs:3058-3067 — 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 `dll/src/desktop/shell2/linux/wayland/defines.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.
  • Duplicated block (10 lines × 5) dll/src/desktop/shell2/linux/wayland/mod.rs:7189 — dll/src/desktop/shell2/linux/wayland/mod.rs:7189-7198 | dll/src/desktop/shell2/linux/x11/mod.rs:6238-6247 | dll/src/desktop/shell2/linux/x11/mod.rs:6469-6478 | dll/src/desktop/shell2/windows/mod.rs:1897-1906 | dll/src/desktop/shell2/windows/mod.rs:1964-1973 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:7189` it begins part-way through the construct above it, so those 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, `dll/src/desktop/shell2/linux/x11/mod.rs:6234` calls `Gpu`, `make_current` and `dll/src/desktop/shell2/windows/mod.rs:1894` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 5) doc/src/codegen/v2/lang_csharp/wrappers.rs:552 — doc/src/codegen/v2/lang_csharp/wrappers.rs:552-561 | doc/src/codegen/v2/lang_haskell/types.rs:482-491 | doc/src/codegen/v2/lang_java/wrappers.rs:968-977 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:381-390 | doc/src/codegen/v2/lang_ruby/wrappers.rs:644-653 — `doc/src/codegen/v2/lang_csharp/wrappers.rs` and `doc/src/codegen/v2/lang_java/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 167 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_csharp/wrappers.rs:552` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 5) layout/src/callbacks.rs:3468 — layout/src/callbacks.rs:3468-3477 | layout/src/callbacks.rs:3493-3502 | layout/src/callbacks.rs:3518-3527 | layout/src/callbacks.rs:3543-3552 | layout/src/callbacks.rs:3568-3577 — 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 `layout/src/callbacks.rs:3468` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 5) layout/src/dialogs/crash_reporter.rs:295 — layout/src/dialogs/crash_reporter.rs:295-304 | layout/src/dialogs/gpu_check.rs:384-393 | layout/src/dialogs/report_problem.rs:698-707 | layout/src/dialogs/telemetry_consent.rs:297-306 | layout/src/dialogs/update_version.rs:424-433 — before extracting anything, compare `layout/src/dialogs/crash_reporter.rs` and `layout/src/dialogs/report_problem.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (6 lines × 5) · ×6
  • Duplicated block (6 lines × 5) dll/src/desktop/shell2/linux/x11/mod.rs:4423 — dll/src/desktop/shell2/linux/x11/mod.rs:4423-4428 | dll/src/desktop/shell2/linux/x11/mod.rs:4785-4790 | dll/src/desktop/shell2/linux/x11/mod.rs:5600-5605 | dll/src/desktop/shell2/linux/x11/mod.rs:5640-5645 | dll/src/desktop/shell2/linux/x11/mod.rs:7930-7935 — 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 `dll/src/desktop/shell2/linux/x11/mod.rs:4423` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 5) dll/src/web/transpiler_remill.rs:1641 — dll/src/web/transpiler_remill.rs:1641-1646 | dll/src/web/transpiler_remill.rs:1665-1670 | dll/src/web/transpiler_remill.rs:1691-1696 | dll/src/web/transpiler_remill.rs:1722-1727 | dll/src/web/transpiler_remill.rs:1794-1799 — 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 `dll/src/web/transpiler_remill.rs:1641` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 5) doc/src/codegen/v2/lang_cpp/cpp11.rs:38 — doc/src/codegen/v2/lang_cpp/cpp11.rs:38-49 | doc/src/codegen/v2/lang_cpp/cpp14.rs:32-37 | doc/src/codegen/v2/lang_cpp/cpp17.rs:37-47 | doc/src/codegen/v2/lang_cpp/cpp20.rs:47-57 | doc/src/codegen/v2/lang_cpp/cpp20.rs:443-448 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp11.rs` and `doc/src/codegen/v2/lang_cpp/cpp14.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 164 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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, `doc/src/codegen/v2/lang_cpp/cpp17.rs:32` calls `push_str`, `generate_feature_docs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs:33` 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 × 5) doc/src/codegen/v2/lang_crystal/types.rs:172 — doc/src/codegen/v2/lang_crystal/types.rs:172-177 | doc/src/codegen/v2/lang_d/types.rs:138-143 | doc/src/codegen/v2/lang_julia/types.rs:217-222 | doc/src/codegen/v2/lang_odin/types.rs:156-161 | doc/src/codegen/v2/lang_v/types.rs:162-167 — `doc/src/codegen/v2/lang_crystal/types.rs` and `doc/src/codegen/v2/lang_d/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 67 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_crystal/types.rs:172` it does not close everything it opens, so those 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, `doc/src/codegen/v2/lang_v/types.rs:160` calls `line` and `doc/src/codegen/v2/lang_julia/types.rs:215` 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 × 5) doc/src/codegen/v2/lang_crystal/mod.rs:289 — doc/src/codegen/v2/lang_crystal/mod.rs:289-294 | doc/src/codegen/v2/lang_d/mod.rs:417-422 | doc/src/codegen/v2/lang_julia/mod.rs:183-188 | doc/src/codegen/v2/lang_odin/mod.rs:118-123 | doc/src/codegen/v2/lang_v/mod.rs:141-146 — `doc/src/codegen/v2/lang_crystal/mod.rs` and `doc/src/codegen/v2/lang_julia/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 51 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (6 lines × 5) doc/src/codegen/v2/lang_csharp/types.rs:349 — doc/src/codegen/v2/lang_csharp/types.rs:349-355 | doc/src/codegen/v2/lang_lisp/types.rs:251-258 | doc/src/codegen/v2/lang_node/types.rs:390-397 | doc/src/codegen/v2/lang_racket/types.rs:204-213 | doc/src/codegen/v2/lang_smalltalk/types.rs:195-200 — `doc/src/codegen/v2/lang_lisp/types.rs` and `doc/src/codegen/v2/lang_racket/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 84 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_csharp/types.rs:349` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D1 · Cyclomatic Complexity · RemillTranspiler · ×5
  • RemillTranspiler::lift_with_transitive_deps_sequential (cyclomatic 86) dll/src/web/transpiler_remill.rs:2167 — RemillTranspiler::lift_with_transitive_deps_sequential has cyclomatic complexity 86 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • RemillTranspiler::produce_object_from_lifted_ir (cyclomatic 70) dll/src/web/transpiler_remill.rs:1272 — RemillTranspiler::produce_object_from_lifted_ir has cyclomatic complexity 70 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • RemillTranspiler::lift_with_transitive_deps_batched (cyclomatic 55) dll/src/web/transpiler_remill.rs:3387 — RemillTranspiler::lift_with_transitive_deps_batched has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • RemillTranspiler::lift_fn (cyclomatic 21) dll/src/web/transpiler_remill.rs:1013 — RemillTranspiler::lift_fn has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: azul_dll::web::transpiler_remill::signature_for_eventloop_fn (cyclomatic 24) 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.
  • RemillTranspiler::emit_indirect_dispatcher_obj (cyclomatic 21) dll/src/web/transpiler_remill.rs:3039 — RemillTranspiler::emit_indirect_dispatcher_obj has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: azul_dll::web::transpiler_remill::signature_for_eventloop_fn (cyclomatic 24) 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 · IRBuilder · ×5
  • IRBuilder::validate_api_json (cognitive 199) doc/src/codegen/v2/ir_builder.rs:100 — IRBuilder::validate_api_json has cognitive complexity 199 (threshold 15). Drivers by points: if/else 34 (135 pts), loops 16 (59 pts), boolean chains 5 (nesting depth added 144). Of this number, 187 points are the body's own statements and 12 belong to one function item inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • IRBuilder::sort_types_by_dependencies (cognitive 96) doc/src/codegen/v2/ir_builder.rs:528 — IRBuilder::sort_types_by_dependencies has cognitive complexity 96 (threshold 15). Drivers by points: if/else 17 (57 pts), loops 14 (21 pts), boolean chains 13, match/switch 2 (5 pts) (nesting depth added 50). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • IRBuilder::build_type_aliases (cognitive 21) doc/src/codegen/v2/ir_builder.rs:1319 — IRBuilder::build_type_aliases has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 1 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • IRBuilder::build_api_functions (cognitive 21) doc/src/codegen/v2/ir_builder.rs:1598 — IRBuilder::build_api_functions has cognitive complexity 21 (threshold 15). Drivers by points: loops 4 (11 pts), if/else 3 (9 pts), boolean chains 1 (nesting depth added 13). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • IRBuilder::determine_method_kind (cognitive 18) doc/src/codegen/v2/ir_builder.rs:1752 — IRBuilder::determine_method_kind has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (18 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · UnifiedLayout · ×5
  • UnifiedLayout::get_selection_rects (cognitive 76) layout/src/text3/cache.rs:5767 — UnifiedLayout::get_selection_rects has cognitive complexity 76 (threshold 15). Drivers by points: if/else 25 (54 pts), loops 5 (11 pts), boolean chains 10, match/switch 1 (nesting depth added 35). 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.
  • UnifiedLayout::move_cursor_to_prev_word (cognitive 33) layout/src/text3/cache.rs:6604 — UnifiedLayout::move_cursor_to_prev_word has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (31 pts), loops 2 (nesting depth added 17). 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.
  • UnifiedLayout::get_cursor_rect (cognitive 29) layout/src/text3/cache.rs:5996 — UnifiedLayout::get_cursor_rect has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (21 pts), match/switch 2 (5 pts), loops 2, 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.
  • UnifiedLayout::move_cursor_to_next_word (cognitive 18) layout/src/text3/cache.rs:6688 — UnifiedLayout::move_cursor_to_next_word has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • UnifiedLayout::hittest_cursor (cognitive 16) layout/src/text3/cache.rs:5687 — UnifiedLayout::hittest_cursor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 1, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LayoutTreeBuilder · ×5
  • LayoutTreeBuilder::process_node (cognitive 73) layout/src/solver3/layout_tree.rs:2062 — LayoutTreeBuilder::process_node has cognitive complexity 73 (threshold 15). Drivers by points: if/else 28 (55 pts), loops 4 (9 pts), match/switch 2 (5 pts), boolean chains 4 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LayoutTreeBuilder::apply_split_previews (cognitive 27) layout/src/solver3/layout_tree.rs:2976 — LayoutTreeBuilder::apply_split_previews has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LayoutTreeBuilder::apply_range_suppression_preview (cognitive 19) layout/src/solver3/layout_tree.rs:3278 — LayoutTreeBuilder::apply_range_suppression_preview has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LayoutTreeBuilder::process_block_children (cognitive 18) layout/src/solver3/layout_tree.rs:2408 — LayoutTreeBuilder::process_block_children has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • LayoutTreeBuilder::process_table_level_children (cognitive 16) layout/src/solver3/layout_tree.rs:2505 — LayoutTreeBuilder::process_table_level_children 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 · SymbolCollector · ×5
  • SymbolCollector::visit_item_fn (cognitive 58) doc/src/patch/parser.rs:279 — SymbolCollector::visit_item_fn has cognitive complexity 58 (threshold 15). Drivers by points: if/else 19 (49 pts), match/switch 3 (8 pts), loops 1 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SymbolCollector::visit_impl_item_fn (cognitive 56) doc/src/patch/parser.rs:401 — SymbolCollector::visit_impl_item_fn has cognitive complexity 56 (threshold 15). Drivers by points: if/else 17 (47 pts), match/switch 3 (8 pts), loops 1 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SymbolCollector::extract_doc (cognitive 34) doc/src/patch/parser.rs:154 — SymbolCollector::extract_doc has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (33 pts), loops 1 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • SymbolCollector::current_module_path (cognitive 19) doc/src/patch/parser.rs:38 — SymbolCollector::current_module_path has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2, loops 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SymbolCollector::visit_item_struct (cognitive 19) doc/src/patch/parser.rs:191 — SymbolCollector::visit_item_struct has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 2 (6 pts) (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Model · ×5
  • Model::new (cognitive 37) doc/src/codegen/v2/lang_d/model.rs:245 — Model::new has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (19 pts), match/switch 5 (10 pts), loops 5, boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Model::new (cognitive 29) doc/src/codegen/v2/lang_swift/model.rs:254 — Model::new has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 3 (7 pts), loops 4, boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Model::new (cognitive 27) doc/src/codegen/v2/lang_crystal/model.rs:211 — Model::new has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 3 (7 pts), loops 4, boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Model::classify (cognitive 23) doc/src/codegen/v2/lang_swift/model.rs:476 — Model::classify has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (4 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Model::classify (cognitive 16) doc/src/codegen/v2/lang_d/model.rs:497 — Model::classify has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ResourceCache · ×5
  • ResourceCache::update_texture_cache (cognitive 31) webrender/core/src/resource_cache.rs:1387 — ResourceCache::update_texture_cache has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 3 (8 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ResourceCache::save_capture (cognitive 30) webrender/core/src/resource_cache.rs:1931 — ResourceCache::save_capture has cognitive complexity 30 (threshold 15). Drivers by points: match/switch 8 (16 pts), if/else 6 (10 pts), loops 4 (nesting depth added 12). 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.
  • ResourceCache::post_scene_building_update (cognitive 26) webrender/core/src/resource_cache.rs:613 — ResourceCache::post_scene_building_update has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (19 pts), match/switch 3 (6 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ResourceCache::request_image (cognitive 23) webrender/core/src/resource_cache.rs:954 — ResourceCache::request_image has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (13 pts), match/switch 6 (9 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.
  • ResourceCache::load_capture (cognitive 22) webrender/core/src/resource_cache.rs:2146 — ResourceCache::load_capture has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 5 (11 pts), if/else 4 (8 pts), loops 3 (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 · StyledDom · ×5
  • StyledDom::restyle_on_state_change (cognitive 29) core/src/styled_dom.rs:2153 — StyledDom::restyle_on_state_change has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (26 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • StyledDom::create_from_compact_dom (cognitive 21) core/src/styled_dom.rs:1301 — StyledDom::create_from_compact_dom has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • StyledDom::restyle_user_property (cognitive 18) core/src/styled_dom.rs:2269 — StyledDom::restyle_user_property has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • StyledDom::append_child_with_index (cognitive 16) core/src/styled_dom.rs:1553 — StyledDom::append_child_with_index has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 5 (6 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • StyledDom::get_html_string (cognitive 16) core/src/styled_dom.rs:2661 — StyledDom::get_html_string has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 5 (8 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.
D30 · Dependency Vulnerabilities · Medium vulnerability · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Medium CVE · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (32 corresponding lines) · ×5
  • Edited copy of a member (32 corresponding lines) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:177 — webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:177-208 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:187-218 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:183 — webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:183-214 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:183-214 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) webrender/swgl/src/shaders/cs_blur_alpha_target.rs:236 — webrender/swgl/src/shaders/cs_blur_alpha_target.rs:236-267 | webrender/swgl/src/shaders/cs_blur_color_target.rs:226-259 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) doc/src/codegen/v2/lang_d/model.rs:600 — doc/src/codegen/v2/lang_d/model.rs:600-631 | doc/src/codegen/v2/lang_swift/model.rs:616-648 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) dll/src/desktop/shell2/linux/x11/accessibility.rs:46 — dll/src/desktop/shell2/linux/x11/accessibility.rs:46-78 | dll/src/desktop/shell2/windows/accessibility.rs:56-87 — 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 (35 corresponding lines) · ×5
  • Edited copy of a member (35 corresponding lines) layout/src/xml/svg.rs:149 — layout/src/xml/svg.rs:149-189 | layout/src/xml/svg.rs:192-273 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) dll/src/desktop/shell2/macos/mod.rs:4242 — dll/src/desktop/shell2/macos/mod.rs:4242-4307 | dll/src/desktop/shell2/macos/mod.rs:4327-4386 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) layout/src/solver3/cache.rs:2662 — layout/src/solver3/cache.rs:2662-2696 | layout/src/solver3/cache.rs:2706-2747 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) dll/src/desktop/shell2/windows/mod.rs:3427 — dll/src/desktop/shell2/windows/mod.rs:3427-3461 | dll/src/desktop/shell2/windows/mod.rs:7538-7572 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) layout/src/solver3/getters.rs:6766 — layout/src/solver3/getters.rs:6766-6801 | layout/src/solver3/getters.rs:6888-6922 — 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 · Members sharing a duplicated core (8 members, 50+ identical tokens) · ×5
  • Members sharing a duplicated core (8 members, 50+ identical tokens) doc/src/codegen/v2/config.rs:357 — doc/src/codegen/v2/config.rs:357-431 | doc/src/codegen/v2/lang_crystal/mod.rs:302-364 | doc/src/codegen/v2/lang_freebasic/mod.rs:117-186 | doc/src/codegen/v2/lang_julia/mod.rs:197-255 | doc/src/codegen/v2/lang_nim/mod.rs:146-213 | doc/src/codegen/v2/lang_odin/mod.rs:131-190 | doc/src/codegen/v2/lang_pascal/mod.rs:228-307 | doc/src/codegen/v2/lang_v/mod.rs:155-215 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
  • Members sharing a duplicated core (8 members, 50+ identical tokens) doc/src/codegen/v2/lang_cpp/cpp03.rs:242 — doc/src/codegen/v2/lang_cpp/cpp03.rs:242-400 | doc/src/codegen/v2/lang_cpp/cpp03.rs:678-715 | doc/src/codegen/v2/lang_cpp/cpp11.rs:152-300 | doc/src/codegen/v2/lang_cpp/cpp11.rs:600-637 | doc/src/codegen/v2/lang_cpp/cpp17.rs:283-480 | doc/src/codegen/v2/lang_cpp/cpp17.rs:810-856 | doc/src/codegen/v2/lang_cpp/cpp20.rs:928-987 | doc/src/codegen/v2/lang_cpp/cpp20.rs:996-1158 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
  • Members sharing a duplicated core (8 members, 50+ identical tokens) layout/src/cpurender/compositor.rs:1940 — layout/src/cpurender/compositor.rs:1940-2100 | layout/src/cpurender/compositor.rs:2698-2796 | layout/src/cpurender/compositor.rs:3314-3326 | layout/src/cpurender/pixmap.rs:1674-1686 | layout/src/solver3/display_list.rs:1005-1044 | layout/src/solver3/display_list.rs:1068-1116 | layout/src/solver3/display_list.rs:1118-1152 | layout/src/solver3/display_list.rs:3588-3784 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
  • Members sharing a duplicated core (8 members, 50+ identical tokens) layout/src/xml/svg.rs:878 — layout/src/xml/svg.rs:878-902 | layout/src/xml/svg.rs:917-941 | layout/src/xml/svg.rs:985-1009 | layout/src/xml/svg.rs:1050-1075 | layout/src/xml/svg.rs:1128-1152 | layout/src/xml/svg.rs:1179-1208 | layout/src/xml/svg.rs:1223-1256 | layout/src/xml/svg.rs:1271-1306 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
  • Members sharing a duplicated core (8 members, 50+ identical tokens) webrender/swgl/src/shaders/composite_texture_2d.rs:110 — webrender/swgl/src/shaders/composite_texture_2d.rs:110-141 | webrender/swgl/src/shaders/composite_texture_rect.rs:115-146 | webrender/swgl/src/shaders/cs_clip_box_shadow_texture_2d.rs:265-276 | webrender/swgl/src/shaders/cs_scale_texture_2d.rs:107-123 | webrender/swgl/src/shaders/cs_scale_texture_rect.rs:113-132 | webrender/swgl/src/shaders/debug_color.rs:87-101 | webrender/swgl/src/shaders/debug_font.rs:90-105 | webrender/swgl/src/shaders/ps_clear.rs:100-120 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication · Edited copy of a member (45 corresponding lines) · ×5
  • Edited copy of a member (45 corresponding lines) layout/src/cpurender/svg.rs:57 — layout/src/cpurender/svg.rs:57-106 | layout/src/cpurender/svg.rs:123-167 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (45 corresponding lines) layout/src/solver3/layout_tree.rs:2679 — layout/src/solver3/layout_tree.rs:2679-2723 | layout/src/solver3/layout_tree.rs:2738-2789 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (45 corresponding lines) doc/src/codegen/v2/lang_python.rs:1469 — doc/src/codegen/v2/lang_python.rs:1469-1531 | doc/src/codegen/v2/lang_python.rs:1824-1868 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (45 corresponding lines) dll/src/desktop/shell2/common/clipboard.rs:54 — dll/src/desktop/shell2/common/clipboard.rs:54-98 | dll/src/desktop/shell2/common/clipboard.rs:105-158 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (45 corresponding lines) dll/src/desktop/extra/audio/alsa.rs:64 — dll/src/desktop/extra/audio/alsa.rs:64-109 | dll/src/desktop/extra/audio/alsa.rs:158-202 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (33 corresponding lines) · ×5
  • Edited copy of a member (33 corresponding lines) doc/src/codegen/v2/lang_d/wrappers.rs:645 — doc/src/codegen/v2/lang_d/wrappers.rs:645-677 | doc/src/codegen/v2/lang_swift/wrappers.rs:478-510 — 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) doc/src/codegen/v2/lang_java/types.rs:426 — doc/src/codegen/v2/lang_java/types.rs:426-469 | doc/src/codegen/v2/lang_kotlin/mod.rs:349-381 — 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) doc/src/codegen/v2/config.rs:476 — doc/src/codegen/v2/config.rs:476-508 | doc/src/codegen/v2/config.rs:696-736 — 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) layout/src/solver3/getters.rs:1929 — layout/src/solver3/getters.rs:1929-1964 | layout/src/solver3/getters.rs:1971-2003 — 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) doc/src/autofix/type_index.rs:1857 — doc/src/autofix/type_index.rs:1857-1890 | doc/src/patch/index.rs:1686-1718 — 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 copy of a member (29 corresponding lines) · ×5
  • Edited copy of a member (29 corresponding lines) webrender/swgl/src/shaders/brush_blend.rs:352 — webrender/swgl/src/shaders/brush_blend.rs:352-380 | webrender/swgl/src/shaders/brush_blend_alpha_pass.rs:361-389 — 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) dll/src/desktop/extra/gamepad/playstation.rs:302 — dll/src/desktop/extra/gamepad/playstation.rs:302-330 | dll/src/desktop/extra/gamepad/playstation.rs:334-369 — 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) css/src/props/basic/angle.rs:301 — css/src/props/basic/angle.rs:301-334 | css/src/props/basic/pixel.rs:879-907 — 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) doc/src/codegen/v2/lang_go/functions.rs:342 — doc/src/codegen/v2/lang_go/functions.rs:342-371 | doc/src/codegen/v2/lang_go/wrappers.rs:122-150 — 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) doc/src/codegen/v2/lang_rust.rs:4973 — doc/src/codegen/v2/lang_rust.rs:4973-5001 | doc/src/codegen/v2/rust/shared.rs:297-325 — 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 (23 corresponding lines) · ×5
  • Edited copy of a member (23 corresponding lines) layout/src/text3/dense.rs:563 — layout/src/text3/dense.rs:563-585 | layout/src/text3/dense.rs:592-614 — 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) webrender/swgl/src/shaders/cs_blur_alpha_target.rs:109 — webrender/swgl/src/shaders/cs_blur_alpha_target.rs:109-131 | webrender/swgl/src/shaders/cs_blur_color_target.rs:94-123 — 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) layout/src/icu_windows.rs:459 — layout/src/icu_windows.rs:459-492 | layout/src/icu_windows.rs:494-516 — 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) dll/src/desktop/shell2/android/mod.rs:413 — dll/src/desktop/shell2/android/mod.rs:413-437 | dll/src/desktop/shell2/ios/mod.rs:1812-1834 — 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) dll/src/desktop/shell2/linux/x11/accessibility.rs:87 — dll/src/desktop/shell2/linux/x11/accessibility.rs:87-109 | dll/src/desktop/shell2/windows/accessibility.rs:96-123 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 8+ corresponding lines) · ×5
  • Edited copies of one member (3 members, 8+ corresponding lines) doc/src/codegen/v2/lang_freebasic/types.rs:327 — doc/src/codegen/v2/lang_freebasic/types.rs:327-334 | doc/src/codegen/v2/lang_nim/types.rs:413-420 | doc/src/codegen/v2/lang_vb6/types.rs:319-326 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 8+ corresponding lines) layout/src/glyph_cache.rs:744 — layout/src/glyph_cache.rs:744-751 | layout/src/glyph_cache.rs:756-763 | layout/src/glyph_cache.rs:775-782 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 8+ corresponding lines) layout/src/widgets/quick_access.rs:1051 — layout/src/widgets/quick_access.rs:1051-1058 | layout/src/widgets/quick_access.rs:1066-1074 | layout/src/widgets/statusbar.rs:1471-1478 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 8+ corresponding lines) doc/src/codegen/v2/lang_crystal/model.rs:156 — doc/src/codegen/v2/lang_crystal/model.rs:156-163 | doc/src/codegen/v2/lang_d/model.rs:153-161 | doc/src/codegen/v2/lang_swift/model.rs:153-161 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 8+ corresponding lines) doc/src/codegen/v2/lang_java/derives.rs:126 — doc/src/codegen/v2/lang_java/derives.rs:126-133 | doc/src/codegen/v2/lang_perl/wrappers.rs:352-359 | doc/src/codegen/v2/lang_ruby/wrappers.rs:1474-1481 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (29 lines × 2) · ×5
  • Duplicated block (29 lines × 2) doc/src/patch/index.rs:1244 — doc/src/patch/index.rs:1244-1272 | doc/src/patch/index.rs:1325-1353 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/patch/index.rs:1244` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (29 lines × 2) layout/src/widgets/themes/flat.rs:1719 — layout/src/widgets/themes/flat.rs:1719-1747 | layout/src/widgets/themes/flora.rs:2137-2165 — before extracting anything, compare `layout/src/widgets/themes/flat.rs` and `layout/src/widgets/themes/flora.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 927 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `layout/src/widgets/themes/flat.rs:1719` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (29 lines × 2) layout/src/window.rs:13293 — layout/src/window.rs:13293-13321 | layout/src/window.rs:13326-13354 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/window.rs:13326` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (29 lines × 2) webrender/core/src/prepare.rs:1050 — webrender/core/src/prepare.rs:1050-1078 | webrender/core/src/prepare.rs:1119-1147 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (29 lines × 2) webrender/swgl/src/shaders/composite_texture_2d.rs:113 — webrender/swgl/src/shaders/composite_texture_2d.rs:113-141 | webrender/swgl/src/shaders/composite_texture_rect.rs:118-146 — before extracting anything, compare `webrender/swgl/src/shaders/composite_texture_2d.rs` and `webrender/swgl/src/shaders/composite_texture_rect.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/composite_texture_2d.rs:113` 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 (28 lines × 2) · ×5
  • Duplicated block (28 lines × 2) dll/src/desktop/compositor2.rs:2036 — dll/src/desktop/compositor2.rs:2036-2063 | dll/src/desktop/compositor2.rs:2508-2535 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (28 lines × 2) doc/src/codegen/v2/lang_cpp/cpp03.rs:176 — doc/src/codegen/v2/lang_cpp/cpp03.rs:176-203 | doc/src/codegen/v2/lang_cpp/cpp17.rs:197-224 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp17.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 367 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/codegen/v2/lang_cpp/cpp03.rs:176` 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 (28 lines × 2) layout/src/window.rs:12503 — layout/src/window.rs:12503-12530 | layout/src/window.rs:18992-19019 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (28 lines × 2) core/src/compact.rs:976 — core/src/compact.rs:976-1003 | core/src/compact.rs:1018-1045 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/compact.rs:976` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (28 lines × 2) dll/src/web/transpiler_remill.rs:505 — dll/src/web/transpiler_remill.rs:505-532 | dll/src/web/transpiler_remill.rs:542-571 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (18–19 lines × 2) · ×5
  • Duplicated block (18–19 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:1453 — dll/src/desktop/shell2/linux/wayland/mod.rs:1453-1470 | dll/src/desktop/shell2/windows/mod.rs:7007-7025 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` as WHOLE FILES: this scan already matched 23 separate duplicated blocks between them, totalling at least 319 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 (18–19 lines × 2) dll/src/desktop/shell2/linux/x11/mod.rs:5923 — dll/src/desktop/shell2/linux/x11/mod.rs:5923-5941 | dll/src/desktop/shell2/linux/x11/mod.rs:7383-7400 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (18–19 lines × 2) dll/src/desktop/wr_translate2.rs:1537 — dll/src/desktop/wr_translate2.rs:1537-1554 | dll/src/desktop/wr_translate2.rs:2920-2938 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/wr_translate2.rs:1537` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18–19 lines × 2) doc/src/codegen/v2/lang_java/types.rs:246 — doc/src/codegen/v2/lang_java/types.rs:246-263 | doc/src/codegen/v2/lang_java/types.rs:507-525 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_java/types.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 (18–19 lines × 2) layout/src/solver3/layout_tree.rs:3956 — layout/src/solver3/layout_tree.rs:3956-3973 | layout/src/solver3/layout_tree.rs:3986-4004 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/layout_tree.rs:3986` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (15–17 lines × 2) · ×5
  • Duplicated block (15–17 lines × 2) dll/src/desktop/shell2/linux/wayland/events.rs:846 — dll/src/desktop/shell2/linux/wayland/events.rs:846-862 | dll/src/desktop/shell2/linux/wayland/events.rs:1259-1273 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/events.rs:846` it begins part-way through the construct above it, so those exact lines 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–17 lines × 2) dll/src/web/server.rs:695 — dll/src/web/server.rs:695-711 | dll/src/web/server.rs:808-822 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/web/server.rs:695` 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–17 lines × 2) layout/src/cpurender/pixmap.rs:1554 — layout/src/cpurender/pixmap.rs:1554-1570 | layout/src/cpurender/pixmap.rs:1648-1662 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/cpurender/pixmap.rs:1554` it does not close everything it opens, so those exact lines 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–17 lines × 2) layout/src/managers/a11y.rs:626 — layout/src/managers/a11y.rs:626-640 | layout/src/managers/a11y_snapshot.rs:479-495 — 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 `layout/src/managers/a11y.rs:626` 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 (15–17 lines × 2) layout/src/text3/cache.rs:10465 — layout/src/text3/cache.rs:10465-10479 | layout/src/text3/cache.rs:10566-10582 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/text3/cache.rs:10465` it does not close everything it opens, so those 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 × 3) · ×5
  • Duplicated block (14 lines × 3) dll/src/desktop/shell2/linux/x11/mod.rs:7030 — dll/src/desktop/shell2/linux/x11/mod.rs:7030-7043 | dll/src/desktop/shell2/macos/mod.rs:8329-8342 | dll/src/desktop/shell2/windows/mod.rs:1737-1750 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/mod.rs` and `dll/src/desktop/shell2/macos/mod.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 3) doc/src/autofix/mod.rs:3167 — doc/src/autofix/mod.rs:3167-3180 | doc/src/autofix/mod.rs:3197-3210 | doc/src/autofix/mod.rs:3226-3239 — all 3 copies are in the same file, so extract the block into one function there and call 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) doc/src/codegen/v2/generator.rs:70 — doc/src/codegen/v2/generator.rs:70-83 | doc/src/codegen/v2/generator.rs:626-639 | doc/src/codegen/v2/generator.rs:646-659 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/generator.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 × 3) layout/src/solver3/fc.rs:8778 — layout/src/solver3/fc.rs:8778-8791 | layout/src/solver3/fc.rs:9185-9198 | layout/src/solver3/fc.rs:9276-9289 — all 3 copies are in the same file, so extract the block into one function there and call 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) doc/src/codegen/v2/lang_cpp/cpp11.rs:516 — doc/src/codegen/v2/lang_cpp/cpp11.rs:516-529 | doc/src/codegen/v2/lang_cpp/cpp17.rs:708-721 | doc/src/codegen/v2/lang_cpp/cpp20.rs:407-420 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp11.rs` and `doc/src/codegen/v2/lang_cpp/cpp17.rs` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 669 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/codegen/v2/lang_cpp/cpp11.rs:516` it begins part-way through the construct above it, so those 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) · ×5
  • Duplicated block (12–13 lines × 4) css/src/system.rs:2609 — css/src/system.rs:2609-2621 | css/src/system.rs:2659-2671 | css/src/system.rs:2787-2798 | css/src/system.rs:2864-2876 — 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 `css/src/system.rs:2609` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–13 lines × 4) layout/src/cpurender/raster.rs:4258 — layout/src/cpurender/raster.rs:4258-4269 | layout/src/cpurender/raster.rs:4275-4287 | layout/src/cpurender/raster.rs:4293-4305 | layout/src/cpurender/raster.rs:4311-4323 — 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 `layout/src/cpurender/raster.rs:4258` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–13 lines × 4) webrender/swgl/src/shaders/brush_opacity.rs:221 — webrender/swgl/src/shaders/brush_opacity.rs:221-232 | webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs:249-260 | webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs:235-247 | webrender/swgl/src/shaders/brush_opacity_antialiasing.rs:236-248 — before extracting anything, compare `webrender/swgl/src/shaders/brush_opacity.rs` and `webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 149 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12–13 lines × 4) layout/src/widgets/node_graph.rs:2019 — layout/src/widgets/node_graph.rs:2019-2031 | layout/src/widgets/node_graph.rs:2042-2054 | layout/src/widgets/node_graph.rs:2065-2077 | layout/src/widgets/node_graph.rs:2088-2099 — 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 `layout/src/widgets/node_graph.rs:2019` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12–13 lines × 4) layout/src/widgets/node_graph.rs:2143 — layout/src/widgets/node_graph.rs:2143-2155 | layout/src/widgets/node_graph.rs:2166-2178 | layout/src/widgets/node_graph.rs:2189-2201 | layout/src/widgets/node_graph.rs:2212-2223 — 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 `layout/src/widgets/node_graph.rs:2143` 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) · ×5
  • Duplicated block (12 lines × 4) dll/src/desktop/shell2/linux/x11/mod.rs:6238 — dll/src/desktop/shell2/linux/x11/mod.rs:6238-6249 | dll/src/desktop/shell2/linux/x11/mod.rs:6469-6480 | dll/src/desktop/shell2/windows/mod.rs:1897-1908 | dll/src/desktop/shell2/windows/mod.rs:1964-1975 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 450 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 `dll/src/desktop/shell2/linux/x11/mod.rs:6238` it begins part-way through the construct above it, so those 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, `dll/src/desktop/shell2/linux/x11/mod.rs:6234` calls `Gpu`, `make_current` and `dll/src/desktop/shell2/windows/mod.rs:1894` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 4) doc/src/autofix/type_index.rs:2295 — doc/src/autofix/type_index.rs:2295-2306 | doc/src/autofix/type_index.rs:2342-2353 | doc/src/autofix/type_index.rs:2396-2407 | doc/src/autofix/type_index.rs:2443-2454 — 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 `doc/src/autofix/type_index.rs:2295` it begins part-way through the construct above it, so those exact lines 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) layout/src/widgets/backstage.rs:277 — layout/src/widgets/backstage.rs:277-288 | layout/src/widgets/quick_access.rs:322-333 | layout/src/widgets/ribbon.rs:622-633 | layout/src/widgets/statusbar.rs:345-356 — before extracting anything, compare `layout/src/widgets/backstage.rs` and `layout/src/widgets/quick_access.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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, `layout/src/widgets/ribbon.rs:621` calls `push_border_colors` and `layout/src/widgets/backstage.rs:276` 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) doc/src/reftest/autodoc.rs:1009 — doc/src/reftest/autodoc.rs:1009-1020 | doc/src/reftest/autoreview.rs:629-640 | doc/src/reftest/autoreview.rs:859-871 | doc/src/reftest/autoreview.rs:1782-1793 — before extracting anything, compare `doc/src/reftest/autodoc.rs` and `doc/src/reftest/autoreview.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 212 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/reftest/autodoc.rs:1009` it begins part-way through the construct above it, so those exact lines 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) dll/src/web/transpiler_remill.rs:7006 — dll/src/web/transpiler_remill.rs:7006-7018 | dll/src/web/transpiler_remill.rs:7037-7048 | dll/src/web/transpiler_remill.rs:7067-7078 | dll/src/web/transpiler_remill.rs:7097-7108 — 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 `dll/src/web/transpiler_remill.rs:7006` it begins part-way through the construct above it, so those 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) · ×5
  • Duplicated block (10–11 lines × 3) dll/src/desktop/compositor2.rs:1633 — dll/src/desktop/compositor2.rs:1633-1642 | dll/src/desktop/compositor2.rs:1825-1834 | dll/src/desktop/compositor2.rs:1941-1951 — all 3 copies are in the same file, so extract the block into one function there and call 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) dll/src/desktop/shell2/linux/wayland/mod.rs:7526 — dll/src/desktop/shell2/linux/wayland/mod.rs:7526-7535 | dll/src/desktop/shell2/linux/x11/mod.rs:6582-6592 | dll/src/desktop/shell2/windows/mod.rs:1198-1208 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:7526` it does not close everything it opens, so those 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, `dll/src/desktop/shell2/linux/x11/mod.rs:6580` calls `elapsed`, `as_secs_f64` and `dll/src/desktop/shell2/windows/mod.rs:1196` 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–11 lines × 3) doc/src/codegen/v2/lang_java/types.rs:139 — doc/src/codegen/v2/lang_java/types.rs:139-148 | doc/src/codegen/v2/lang_java/types.rs:181-191 | doc/src/codegen/v2/lang_java/types.rs:277-287 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_java/types.rs:139` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10–11 lines × 3) doc/src/codegen/v2/lang_kotlin/mod.rs:582 — doc/src/codegen/v2/lang_kotlin/mod.rs:582-592 | doc/src/codegen/v2/lang_kotlin/mod.rs:648-657 | doc/src/codegen/v2/lang_kotlin/mod.rs:721-730 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_kotlin/mod.rs:582` 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, `doc/src/codegen/v2/lang_kotlin/mod.rs:647` calls `emit_kotlin_field_order_override` and `doc/src/codegen/v2/lang_kotlin/mod.rs:577` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10–11 lines × 3) layout/src/window.rs:2820 — layout/src/window.rs:2820-2829 | layout/src/window.rs:3933-3943 | layout/src/window.rs:4122-4131 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8–10 lines × 2) · ×5
  • Duplicated block (8–10 lines × 2) doc/src/codegen/v2/lang_c.rs:246 — doc/src/codegen/v2/lang_c.rs:246-255 | doc/src/codegen/v2/lang_julia/types.rs:95-102 — 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 `doc/src/codegen/v2/lang_c.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `doc/src/codegen/v2/lang_c.rs:256` calls `Callback` and `doc/src/codegen/v2/lang_julia/types.rs:103` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8–10 lines × 2) doc/src/codegen/v2/lang_d/model.rs:363 — doc/src/codegen/v2/lang_d/model.rs:363-372 | doc/src/codegen/v2/lang_swift/model.rs:371-378 — `doc/src/codegen/v2/lang_d/model.rs` and `doc/src/codegen/v2/lang_swift/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 21 separate duplicated blocks between them, totalling at least 240 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_d/model.rs:363` it does not close everything it opens, so those exact lines 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–10 lines × 2) doc/src/codegen/v2/lang_haskell/types.rs:630 — doc/src/codegen/v2/lang_haskell/types.rs:630-637 | doc/src/codegen/v2/lang_haskell/types.rs:777-786 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_haskell/types.rs:630` it begins part-way through the construct above it, so those exact lines 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–10 lines × 2) doc/src/codegen/v2/lang_racket/types.rs:200 — doc/src/codegen/v2/lang_racket/types.rs:200-209 | doc/src/codegen/v2/lang_racket/types.rs:339-346 — both copies are in the same file, so extract the block into 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–10 lines × 2) doc/src/codegen/v2/lang_smalltalk/functions.rs:226 — doc/src/codegen/v2/lang_smalltalk/functions.rs:226-235 | doc/src/codegen/v2/lang_smalltalk/wrappers.rs:260-267 — 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.
D1 · Cyclomatic Complexity · TileCacheInstance · ×4
  • TileCacheInstance::update_prim_dependencies (cyclomatic 80) webrender/core/src/picture.rs:3038 — TileCacheInstance::update_prim_dependencies has cyclomatic complexity 80 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • TileCacheInstance::pre_update (cyclomatic 47) webrender/core/src/picture.rs:2047 — TileCacheInstance::pre_update has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • TileCacheInstance::post_update (cyclomatic 24) webrender/core/src/picture.rs:3850 — TileCacheInstance::post_update has cyclomatic complexity 24 (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.
  • TileCacheInstance::setup_compositor_surfaces_impl (cyclomatic 21) webrender/core/src/picture.rs:2710 — TileCacheInstance::setup_compositor_surfaces_impl has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: PictureCompositeMode::kind (cyclomatic 24) 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 · Win32Window · ×4
  • Win32Window::render_and_present (cyclomatic 74) dll/src/desktop/shell2/windows/mod.rs:1139 — Win32Window::render_and_present has cyclomatic complexity 74 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Win32Window::sync_window_state (cyclomatic 35) dll/src/desktop/shell2/windows/mod.rs:2724 — Win32Window::sync_window_state has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Win32Window::new (cyclomatic 29) dll/src/desktop/shell2/windows/mod.rs:300 — Win32Window::new has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: azul_dll::desktop::shell2::windows::win32_msg_name (cyclomatic 30) 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.
  • Win32Window::feed_pointer (cyclomatic 19) dll/src/desktop/shell2/windows/mod.rs:3591 — Win32Window::feed_pointer has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: azul_dll::desktop::shell2::windows::win32_msg_name (cyclomatic 30) 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 · PicturePrimitive · ×4
  • PicturePrimitive::take_context (cognitive 294) webrender/core/src/picture.rs:5302 — PicturePrimitive::take_context has cognitive complexity 294 (threshold 15). Drivers by points: if/else 50 (211 pts), loops 8 (39 pts), match/switch 14 (39 pts), boolean chains 5 (nesting depth added 217). 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.
  • PicturePrimitive::prepare_for_render (cognitive 30) webrender/core/src/picture.rs:7265 — PicturePrimitive::prepare_for_render has cognitive complexity 30 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 3 (8 pts), match/switch 4 (7 pts) (nesting depth added 18). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • PicturePrimitive::assign_surface (cognitive 25) webrender/core/src/picture.rs:6945 — PicturePrimitive::assign_surface has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 4 (9 pts), boolean chains 2 (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.
  • PicturePrimitive::propagate_bounding_rect (cognitive 20) webrender/core/src/picture.rs:7185 — PicturePrimitive::propagate_bounding_rect has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CssPropertyWithConditionsVec · ×4
  • CssPropertyWithConditionsVec::parse_at_rule (cognitive 67) css/src/dynamic_selector.rs:2260 — CssPropertyWithConditionsVec::parse_at_rule has cognitive complexity 67 (threshold 15). Drivers by points: if/else 28 (58 pts), match/switch 2 (6 pts), boolean chains 3 (nesting depth added 34). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • CssPropertyWithConditionsVec::parse_media_query (cognitive 28) css/src/dynamic_selector.rs:2419 — CssPropertyWithConditionsVec::parse_media_query has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (23 pts), match/switch 2 (4 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.
  • CssPropertyWithConditionsVec::parse_with_conditions (cognitive 22) css/src/dynamic_selector.rs:2075 — CssPropertyWithConditionsVec::parse_with_conditions has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (18 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • CssPropertyWithConditionsVec::parse_media_feature_inline (cognitive 19) css/src/dynamic_selector.rs:2490 — CssPropertyWithConditionsVec::parse_media_feature_inline has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 2, match/switch 1 (nesting depth added 4). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · DenseText · ×4
  • DenseText::from_unified_with_content (cognitive 46) layout/src/text3/dense.rs:223 — DenseText::from_unified_with_content has cognitive complexity 46 (threshold 15). Drivers by points: if/else 16 (34 pts), boolean chains 4, loops 2 (4 pts), match/switch 2 (4 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DenseText::move_cursor_to_prev_word (cognitive 24) layout/src/text3/dense.rs:638 — DenseText::move_cursor_to_prev_word has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (22 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.
  • DenseText::to_unified_items (cognitive 21) layout/src/text3/dense.rs:748 — DenseText::to_unified_items has cognitive complexity 21 (threshold 15). Drivers by points: loops 4 (9 pts), match/switch 2 (6 pts), if/else 2 (4 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DenseText::hittest_cursor (cognitive 19) layout/src/text3/dense.rs:930 — DenseText::hittest_cursor has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RenderBackend · ×4
  • RenderBackend::update_document (cognitive 33) webrender/core/src/render_backend.rs:1327 — RenderBackend::update_document has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (25 pts), boolean chains 4, loops 2, match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • RenderBackend::process_api_msg (cognitive 30) webrender/core/src/render_backend.rs:953 — RenderBackend::process_api_msg has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 4 (11 pts), match/switch 2 (3 pts) (nesting depth added 18). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • RenderBackend::process_transaction (cognitive 25) webrender/core/src/render_backend.rs:842 — RenderBackend::process_transaction has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • RenderBackend::process_scene_builder_result (cognitive 18) webrender/core/src/render_backend.rs:1139 — RenderBackend::process_scene_builder_result has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (5 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.
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (43 corresponding lines) · ×4
  • Edited copy of a member (43 corresponding lines) doc/src/reftest/regression.rs:1217 — doc/src/reftest/regression.rs:1217-1292 | doc/src/reftest/regression.rs:1312-1411 — 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) webrender/swgl/src/shaders/brush_mix_blend.rs:337 — webrender/swgl/src/shaders/brush_mix_blend.rs:337-379 | webrender/swgl/src/shaders/brush_mix_blend_alpha_pass.rs:238-293 — 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) doc/src/codegen/v2/lang_java/wrappers.rs:907 — doc/src/codegen/v2/lang_java/wrappers.rs:907-949 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:1361-1409 — 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) css/src/shape.rs:337 — css/src/shape.rs:337-379 | css/src/shape.rs:382-438 — 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 · Members sharing a duplicated core (7 members, 50+ identical tokens) · ×4
  • Members sharing a duplicated core (7 members, 50+ identical tokens) core/src/events.rs:1741 — core/src/events.rs:1741-1879 | core/src/events.rs:1888-1974 | core/src/events.rs:2042-2173 | core/src/window.rs:2580-2633 | css/src/props/property.rs:1572-1613 | css/src/props/property.rs:1782-1904 | layout/src/text3/default.rs:652-750 — 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) dll/src/desktop/shell2/linux/wayland/screencopy.rs:66 — dll/src/desktop/shell2/linux/wayland/screencopy.rs:66-89 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:94-123 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:132-166 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:172-233 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:244-310 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:315-365 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:374-418 — 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) doc/src/autofix/patch_format.rs:13 — doc/src/autofix/patch_format.rs:13-26 | doc/src/autofix/workspace.rs:2237-2250 | doc/src/codegen/v2/ir.rs:503-516 | doc/src/codegen/v2/ir_builder.rs:2679-2692 | doc/src/codegen/v2/lang_python.rs:4555-4568 | doc/src/codegen/v2/lang_rust.rs:5003-5016 | doc/src/codegen/v2/transmute_helpers.rs:506-519 — 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) layout/src/widgets/node_graph.rs:3500 — layout/src/widgets/node_graph.rs:3500-3570 | layout/src/widgets/node_graph.rs:3572-3616 | layout/src/widgets/node_graph.rs:3622-3665 | layout/src/widgets/node_graph.rs:3671-3714 | layout/src/widgets/node_graph.rs:3720-3763 | layout/src/widgets/node_graph.rs:3769-3811 | layout/src/widgets/node_graph.rs:3817-3860 — 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 (70 corresponding lines) · ×4
  • Edited copy of a member (70 corresponding lines) doc/src/codegen/v2/lang_crystal/types.rs:41 — doc/src/codegen/v2/lang_crystal/types.rs:41-117 | doc/src/codegen/v2/lang_d/types.rs:39-108 — 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.
  • Edited copy of a member (70 corresponding lines) webrender/core/src/prim_store/gradient/conic.rs:241 — webrender/core/src/prim_store/gradient/conic.rs:241-310 | webrender/core/src/prim_store/gradient/radial.rs:206-276 — 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.
  • Edited copy of a member (70 corresponding lines) layout/src/widgets/node_graph.rs:839 — layout/src/widgets/node_graph.rs:839-911 | layout/src/widgets/node_graph.rs:931-1000 — 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.
  • Edited copy of a member (70 corresponding lines) layout/src/widgets/badge.rs:55 — layout/src/widgets/badge.rs:55-124 | layout/src/widgets/chip.rs:134-205 — 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) · ×4
  • Edited copy of a member (54 corresponding lines) dll/src/desktop/extra/audio/mod.rs:244 — dll/src/desktop/extra/audio/mod.rs:244-297 | dll/src/desktop/extra/camera/mod.rs:32-98 — 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.
  • Edited copy of a member (54 corresponding lines) layout/src/widgets/alert.rs:477 — layout/src/widgets/alert.rs:477-531 | layout/src/widgets/toast.rs:506-559 — 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.
  • Edited copy of a member (54 corresponding lines) layout/src/font.rs:2558 — layout/src/font.rs:2558-2613 | webrender/glyph/src/font.rs:236-289 — 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.
  • Edited copy of a member (54 corresponding lines) doc/src/codegen/v2/lang_c.rs:136 — doc/src/codegen/v2/lang_c.rs:136-201 | doc/src/codegen/v2/rust/dynamic_binding.rs:28-81 — 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 (47 corresponding lines) · ×4
  • Edited copy of a member (47 corresponding lines) doc/src/codegen/v2/lang_java/wrappers.rs:841 — doc/src/codegen/v2/lang_java/wrappers.rs:841-901 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:1230-1276 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:6351 — dll/src/desktop/shell2/linux/wayland/mod.rs:6351-6403 | dll/src/desktop/shell2/linux/x11/events.rs:1485-1531 — 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) doc/src/codegen/v2/lang_java/types.rs:741 — doc/src/codegen/v2/lang_java/types.rs:741-800 | doc/src/codegen/v2/lang_kotlin/mod.rs:795-841 — 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) doc/src/docgen/mod.rs:847 — doc/src/docgen/mod.rs:847-893 | doc/src/docgen/mod.rs:1081-1130 — 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 copies of one member (3 members, 28+ corresponding lines) · ×4
  • Edited copies of one member (3 members, 28+ corresponding lines) doc/src/codegen/v2/lang_crystal/functions.rs:81 — doc/src/codegen/v2/lang_crystal/functions.rs:81-114 | doc/src/codegen/v2/lang_odin/functions.rs:53-85 | doc/src/codegen/v2/lang_v/functions.rs:72-99 — 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.
  • Edited copies of one member (3 members, 28+ corresponding lines) dll/src/web/transpiler_remill.rs:8980 — dll/src/web/transpiler_remill.rs:8980-9009 | dll/src/web/transpiler_remill.rs:9040-9067 | dll/src/web/transpiler_remill.rs:9095-9128 — 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.
  • Edited copies of one member (3 members, 28+ corresponding lines) doc/src/codegen/v2/lang_lisp/mod.rs:241 — doc/src/codegen/v2/lang_lisp/mod.rs:241-268 | doc/src/codegen/v2/lang_lisp/wrappers.rs:472-502 | doc/src/codegen/v2/lang_racket/mod.rs:193-223 — 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.
  • Edited copies of one member (3 members, 28+ corresponding lines) doc/src/codegen/v2/lang_crystal/types.rs:268 — doc/src/codegen/v2/lang_crystal/types.rs:268-313 | doc/src/codegen/v2/lang_odin/types.rs:232-259 | doc/src/codegen/v2/lang_v/types.rs:240-267 — 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 (3 members, 22+ corresponding lines) · ×4
  • Edited copies of one member (3 members, 22+ corresponding lines) layout/src/image.rs:640 — layout/src/image.rs:640-680 | layout/src/image.rs:688-720 | layout/src/image.rs:730-751 — 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) webrender/swgl/src/shaders/ps_quad_mask.rs:196 — webrender/swgl/src/shaders/ps_quad_mask.rs:196-217 | webrender/swgl/src/shaders/ps_quad_mask_fast_path.rs:299-324 | webrender/swgl/src/shaders/ps_quad_textured.rs:179-200 — 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) doc/src/codegen/v2/lang_ada/types.rs:521 — doc/src/codegen/v2/lang_ada/types.rs:521-542 | doc/src/codegen/v2/lang_java/types.rs:890-918 | doc/src/codegen/v2/lang_ocaml/types.rs:388-414 — 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) dll/src/desktop/shell2/macos/mod.rs:554 — dll/src/desktop/shell2/macos/mod.rs:554-587 | dll/src/desktop/shell2/macos/mod.rs:592-617 | dll/src/desktop/shell2/macos/mod.rs:634-655 — 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 (4 members, 9+ corresponding lines) · ×4
  • Edited copies of one member (4 members, 9+ corresponding lines) webrender/swgl/src/shaders/composite_fast_path_texture_rect.rs:39 — webrender/swgl/src/shaders/composite_fast_path_texture_rect.rs:39-47 | webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:90-100 | webrender/swgl/src/shaders/composite_texture_rect.rs:44-53 | webrender/swgl/src/shaders/composite_texture_rect_yuv.rs:90-100 — 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.
  • Edited copies of one member (4 members, 9+ corresponding lines) doc/src/codegen/v2/lang_fortran/wrappers.rs:547 — doc/src/codegen/v2/lang_fortran/wrappers.rs:547-561 | doc/src/codegen/v2/lang_go/wrappers.rs:311-321 | doc/src/codegen/v2/lang_node/wrappers.rs:1633-1642 | doc/src/codegen/v2/lang_node/wrappers.rs:1649-1657 — 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.
  • Edited copies of one member (4 members, 9+ corresponding lines) layout/src/dialogs/crash_reporter.rs:175 — layout/src/dialogs/crash_reporter.rs:175-183 | layout/src/dialogs/gpu_check.rs:153-161 | layout/src/dialogs/report_problem.rs:444-452 | layout/src/dialogs/update_version.rs:197-207 — 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.
  • Edited copies of one member (4 members, 9+ corresponding lines) dll/src/desktop/extra/audio/mod.rs:223 — dll/src/desktop/extra/audio/mod.rs:223-231 | dll/src/desktop/extra/video_codec/mod.rs:324-332 | dll/src/desktop/extra/webtransport/mod.rs:379-387 | layout/src/resource_handles.rs:333-341 — 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, 9+ corresponding lines) · ×4
  • Edited copies of one member (3 members, 9+ corresponding lines) webrender/swgl/src/shaders/cs_conic_gradient.rs:37 — webrender/swgl/src/shaders/cs_conic_gradient.rs:37-47 | webrender/swgl/src/shaders/cs_linear_gradient.rs:35-43 | webrender/swgl/src/shaders/cs_radial_gradient.rs:37-47 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 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) doc/src/codegen/v2/lang_crystal/model.rs:577 — doc/src/codegen/v2/lang_crystal/model.rs:577-585 | doc/src/codegen/v2/lang_d/model.rs:892-900 | doc/src/codegen/v2/lang_swift/model.rs:893-901 — 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) layout/src/callbacks.rs:3282 — layout/src/callbacks.rs:3282-3304 | layout/src/window.rs:8265-8273 | layout/src/window.rs:8276-8286 — 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) doc/src/codegen/v2/lang_lua/wrappers.rs:141 — doc/src/codegen/v2/lang_lua/wrappers.rs:141-149 | doc/src/codegen/v2/lang_nim/wrappers.rs:89-100 | doc/src/codegen/v2/lang_node/wrappers.rs:302-325 — 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, 17+ corresponding lines) · ×4
  • Edited copies of one member (3 members, 17+ corresponding lines) doc/src/codegen/v2/lang_ocaml/mod.rs:421 — doc/src/codegen/v2/lang_ocaml/mod.rs:421-439 | doc/src/codegen/v2/lang_ocaml/mod.rs:447-467 | doc/src/codegen/v2/lang_ocaml/mod.rs:492-508 — 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.
  • Edited copies of one member (3 members, 17+ corresponding lines) layout/src/window.rs:8744 — layout/src/window.rs:8744-8766 | layout/src/window.rs:8773-8793 | layout/src/window.rs:8800-8816 — 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.
  • Edited copies of one member (3 members, 17+ corresponding lines) dll/src/desktop/shell2/linux/wayland/dlopen.rs:875 — dll/src/desktop/shell2/linux/wayland/dlopen.rs:875-893 | dll/src/desktop/shell2/linux/wayland/dlopen.rs:907-923 | dll/src/desktop/shell2/linux/wayland/dlopen.rs:1080-1102 — 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.
  • Edited copies of one member (3 members, 17+ corresponding lines) doc/src/codegen/v2/generator.rs:66 — doc/src/codegen/v2/generator.rs:66-83 | doc/src/codegen/v2/generator.rs:623-639 | doc/src/codegen/v2/generator.rs:642-659 — 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 (3 members, 11+ corresponding lines) · ×4
  • Edited copies of one member (3 members, 11+ corresponding lines) layout/src/widgets/drop_down.rs:194 — layout/src/widgets/drop_down.rs:194-204 | layout/src/widgets/slider.rs:405-415 | layout/src/widgets/text_area.rs:571-581 — 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) layout/src/fluent.rs:391 — layout/src/fluent.rs:391-401 | layout/src/icu.rs:1306-1316 | layout/src/icu.rs:1322-1332 — 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) css/src/props/layout/flex.rs:98 — css/src/props/layout/flex.rs:98-110 | css/src/props/layout/flex.rs:209-221 | css/src/props/style/effects.rs:246-256 — 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) doc/src/codegen/v2/ir.rs:568 — doc/src/codegen/v2/ir.rs:568-578 | doc/src/codegen/v2/lang_perl/wrappers.rs:158-169 | doc/src/codegen/v2/lang_ruby/wrappers.rs:935-945 — 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 · Duplicated block (19–21 lines × 2) · ×4
  • Duplicated block (19–21 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:11002 — dll/src/desktop/shell2/linux/wayland/mod.rs:11002-11022 | dll/src/desktop/shell2/linux/x11/mod.rs:8756-8774 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:11002` 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 (19–21 lines × 2) doc/src/patch/locatesource.rs:216 — doc/src/patch/locatesource.rs:216-236 | doc/src/patch/locatesource.rs:398-416 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/patch/locatesource.rs:216` it begins part-way through the construct above it, so those exact lines 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–21 lines × 2) webrender/core/src/renderer/mod.rs:3088 — webrender/core/src/renderer/mod.rs:3088-3106 | webrender/core/src/renderer/mod.rs:3268-3288 — both copies are in the same file, so extract the block into 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–21 lines × 2) css/src/system.rs:2760 — css/src/system.rs:2760-2780 | css/src/system.rs:2835-2853 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `css/src/system.rs:2760` it begins part-way through the construct above it, so those 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) · ×4
  • Duplicated block (15–19 lines × 2) css/src/system.rs:2653 — css/src/system.rs:2653-2667 | css/src/system.rs:2854-2872 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `css/src/system.rs:2653` it begins part-way through the construct above it, so those exact lines 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–19 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:3672 — dll/src/desktop/shell2/linux/wayland/mod.rs:3672-3690 | dll/src/desktop/shell2/linux/wayland/mod.rs:5377-5391 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:3672` it does not close everything it opens, so those exact lines 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–19 lines × 2) dll/src/desktop/shell2/windows/tooltip.rs:217 — dll/src/desktop/shell2/windows/tooltip.rs:217-235 | dll/src/desktop/shell2/windows/tooltip.rs:249-263 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/windows/tooltip.rs:217` it begins part-way through the construct above it, so those exact lines 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–19 lines × 2) dll/src/web/symbol_table.rs:1440 — dll/src/web/symbol_table.rs:1440-1454 | dll/src/web/symbol_table.rs:1839-1857 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/web/symbol_table.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.
D4 · Code Duplication · Duplicated block (14–18 lines × 2) · ×4
  • Duplicated block (14–18 lines × 2) doc/src/codegen/v2/lang_lua/wrappers.rs:264 — doc/src/codegen/v2/lang_lua/wrappers.rs:264-281 | doc/src/codegen/v2/lang_lua/wrappers.rs:458-471 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `doc/src/codegen/v2/lang_lua/wrappers.rs:256` calls `is_empty` and `doc/src/codegen/v2/lang_lua/wrappers.rs:455` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14–18 lines × 2) doc/src/codegen/v2/lang_lua/wrappers.rs:1109 — doc/src/codegen/v2/lang_lua/wrappers.rs:1109-1126 | doc/src/codegen/v2/lang_lua/wrappers.rs:1175-1188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_lua/wrappers.rs:1109` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14–18 lines × 2) doc/src/utils/analyze.rs:285 — doc/src/utils/analyze.rs:285-298 | doc/src/utils/analyze.rs:314-331 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/utils/analyze.rs:285` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (14–18 lines × 2) layout/src/managers/gesture.rs:1053 — layout/src/managers/gesture.rs:1053-1070 | layout/src/managers/gesture.rs:1181-1194 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/managers/gesture.rs:1053` 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 (16 lines × 3) · ×4
  • Duplicated block (16 lines × 3) dll/src/desktop/display.rs:1112 — dll/src/desktop/display.rs:1112-1127 | dll/src/desktop/display.rs:1184-1199 | dll/src/desktop/display.rs:1270-1285 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/display.rs:1112` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 3) doc/src/reftest/autoreview.rs:797 — doc/src/reftest/autoreview.rs:797-812 | doc/src/reftest/autoreview.rs:1030-1045 | doc/src/reftest/autoreview.rs:1934-1949 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/reftest/autoreview.rs:797` it begins part-way through the construct above it, so those 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 (16 lines × 3) webrender/core/src/prim_store/picture.rs:671 — webrender/core/src/prim_store/picture.rs:671-686 | webrender/core/src/prim_store/picture.rs:701-716 | webrender/core/src/prim_store/picture.rs:731-746 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/core/src/prim_store/picture.rs:671` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 3) dll/src/desktop/shell2/linux/wayland/mod.rs:1591 — dll/src/desktop/shell2/linux/wayland/mod.rs:1591-1606 | dll/src/desktop/shell2/linux/x11/mod.rs:7852-7867 | dll/src/desktop/shell2/windows/mod.rs:7341-7356 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (14–16 lines × 3) · ×4
  • Duplicated block (14–16 lines × 3) dll/src/desktop/shell2/linux/wayland/mod.rs:6479 — dll/src/desktop/shell2/linux/wayland/mod.rs:6479-6494 | dll/src/desktop/shell2/linux/x11/mod.rs:6207-6220 | dll/src/desktop/shell2/windows/mod.rs:1852-1865 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:6479` it begins part-way through the construct above it, so those exact lines 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 × 3) webrender/core/src/batch.rs:1564 — webrender/core/src/batch.rs:1564-1579 | webrender/core/src/batch.rs:2219-2232 | webrender/core/src/batch.rs:2262-2275 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/core/src/batch.rs:1564` it does not close everything it opens, so those 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 × 3) webrender/core/src/device/gl.rs:3663 — webrender/core/src/device/gl.rs:3663-3678 | webrender/core/src/device/gl.rs:3686-3701 | webrender/core/src/device/gl.rs:3745-3758 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/core/src/device/gl.rs:3663` it does not close everything it opens, so those 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 × 3) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:276 — webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:276-291 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:269-283 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:246-259 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs` and `webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs` as WHOLE FILES: this scan already matched 32 separate duplicated blocks between them, totalling at least 439 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:276` it does not close everything it opens, so those 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–16 lines × 2) · ×4
  • Duplicated block (15–16 lines × 2) dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:147 — dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:147-162 | dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:310-324 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15–16 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:10081 — dll/src/desktop/shell2/linux/wayland/mod.rs:10081-10095 | dll/src/desktop/shell2/macos/mod.rs:4158-4173 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/macos/mod.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 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 (15–16 lines × 2) doc/src/codegen/v2/lang_cpp/cpp17.rs:757 — doc/src/codegen/v2/lang_cpp/cpp17.rs:757-772 | doc/src/codegen/v2/lang_cpp/cpp17.rs:788-802 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_cpp/cpp17.rs:757` it begins part-way through the construct above it, so those exact lines 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) doc/src/codegen/v2/lang_java/types.rs:265 — doc/src/codegen/v2/lang_java/types.rs:265-279 | doc/src/codegen/v2/lang_java/types.rs:552-567 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_java/types.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.
D4 · Code Duplication · Duplicated block (12–15 lines × 2) · ×4
  • Duplicated block (12–15 lines × 2) dll/src/desktop/shell2/linux/x11/accessibility.rs:88 — dll/src/desktop/shell2/linux/x11/accessibility.rs:88-102 | dll/src/desktop/shell2/windows/accessibility.rs:97-108 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/accessibility.rs` and `dll/src/desktop/shell2/windows/accessibility.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 63 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 `dll/src/desktop/shell2/linux/x11/accessibility.rs:88` it does not close everything it opens, so those exact lines 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–15 lines × 2) doc/src/autofix/workspace.rs:776 — doc/src/autofix/workspace.rs:776-790 | doc/src/autofix/workspace.rs:794-805 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12–15 lines × 2) doc/src/codegen/v2/lang_rust.rs:679 — doc/src/codegen/v2/lang_rust.rs:679-693 | doc/src/codegen/v2/lang_rust.rs:699-710 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_rust.rs:679` it does not close everything it opens, so those 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–15 lines × 2) layout/src/solver3/mod.rs:633 — layout/src/solver3/mod.rs:633-644 | layout/src/solver3/mod.rs:1038-1052 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (14 lines × 4) · ×4
  • Duplicated block (14 lines × 4) core/src/xml.rs:8389 — core/src/xml.rs:8389-8402 | core/src/xml.rs:8475-8488 | core/src/xml.rs:8680-8693 | core/src/xml.rs:8776-8789 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (14 lines × 4) doc/src/codegen/v2/lang_cpp/cpp03.rs:652 — doc/src/codegen/v2/lang_cpp/cpp03.rs:652-665 | doc/src/codegen/v2/lang_cpp/cpp11.rs:574-587 | doc/src/codegen/v2/lang_cpp/cpp17.rs:775-788 | doc/src/codegen/v2/lang_cpp/cpp20.rs:880-893 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/codegen/v2/lang_cpp/cpp03.rs:652` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 4) doc/src/codegen/v2/lang_csharp/wrappers.rs:520 — doc/src/codegen/v2/lang_csharp/wrappers.rs:520-533 | doc/src/codegen/v2/lang_java/wrappers.rs:106-119 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:353-366 | doc/src/codegen/v2/lang_smalltalk/wrappers.rs:95-108 — `doc/src/codegen/v2/lang_csharp/wrappers.rs` and `doc/src/codegen/v2/lang_java/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 167 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 4) doc/src/codegen/v2/lang_python.rs:1470 — doc/src/codegen/v2/lang_python.rs:1470-1483 | doc/src/codegen/v2/lang_python.rs:1663-1676 | doc/src/codegen/v2/lang_python.rs:1744-1757 | doc/src/codegen/v2/lang_python.rs:1825-1838 — 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 `doc/src/codegen/v2/lang_python.rs:1470` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (10–13 lines × 2) · ×4
  • Duplicated block (10–13 lines × 2) dll/src/desktop/extra/file_picker/ios.rs:286 — dll/src/desktop/extra/file_picker/ios.rs:286-295 | dll/src/desktop/shell2/ios/mod.rs:2577-2589 — 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 `dll/src/desktop/extra/file_picker/ios.rs:286` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10–13 lines × 2) doc/src/codegen/v2/lang_perl/types.rs:130 — doc/src/codegen/v2/lang_perl/types.rs:130-142 | doc/src/codegen/v2/lang_ruby/types.rs:183-192 — `doc/src/codegen/v2/lang_perl/types.rs` and `doc/src/codegen/v2/lang_ruby/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 49 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_perl/types.rs:130` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10–13 lines × 2) layout/src/managers/gpu_state.rs:270 — layout/src/managers/gpu_state.rs:270-282 | layout/src/window.rs:11900-11909 — 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 `layout/src/managers/gpu_state.rs:270` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10–13 lines × 2) webrender/core/src/scene_building.rs:716 — webrender/core/src/scene_building.rs:716-725 | webrender/core/src/tile_cache.rs:262-274 — 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 `webrender/core/src/scene_building.rs:716` it does not close everything it opens, so those 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, `webrender/core/src/scene_building.rs:725` calls `Some` and `webrender/core/src/tile_cache.rs:274` 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–13 lines × 2) · ×4
  • Duplicated block (11–13 lines × 2) dll/src/desktop/extra/hid/macos.rs:285 — dll/src/desktop/extra/hid/macos.rs:285-297 | dll/src/desktop/extra/hid/windows.rs:220-230 — 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 `dll/src/desktop/extra/hid/macos.rs:285` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11–13 lines × 2) doc/src/codegen/v2/lang_go/wrappers.rs:591 — doc/src/codegen/v2/lang_go/wrappers.rs:591-603 | doc/src/codegen/v2/lang_go/wrappers.rs:620-630 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_go/wrappers.rs:591` it does not close everything it opens, so those 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–13 lines × 2) webrender/core/src/picture.rs:1919 — webrender/core/src/picture.rs:1919-1931 | webrender/core/src/picture.rs:1964-1974 — both copies are in the same file, so extract the block into 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–13 lines × 2) webrender/swgl/src/shaders/cs_blur_alpha_target.rs:112 — webrender/swgl/src/shaders/cs_blur_alpha_target.rs:112-122 | webrender/swgl/src/shaders/cs_blur_color_target.rs:97-109 — before extracting anything, compare `webrender/swgl/src/shaders/cs_blur_alpha_target.rs` and `webrender/swgl/src/shaders/cs_blur_color_target.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/cs_blur_alpha_target.rs:112` 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–12 lines × 2) · ×4
  • Duplicated block (10–12 lines × 2) dll/src/web/symbol_table.rs:562 — dll/src/web/symbol_table.rs:562-573 | dll/src/web/transpiler_remill.rs:5256-5265 — 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 `dll/src/web/symbol_table.rs:562` 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, `dll/src/web/transpiler_remill.rs:5255` calls `wrapping_add` and `dll/src/web/symbol_table.rs:558` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10–12 lines × 2) doc/src/codegen/v2/lang_crystal/functions.rs:64 — doc/src/codegen/v2/lang_crystal/functions.rs:64-73 | doc/src/codegen/v2/lang_crystal/functions.rs:97-108 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_crystal/functions.rs:64` 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–12 lines × 2) doc/src/codegen/v2/lang_csharp/managed.rs:752 — doc/src/codegen/v2/lang_csharp/managed.rs:752-763 | doc/src/codegen/v2/lang_csharp/managed.rs:959-968 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10–12 lines × 2) layout/src/solver3/sizing.rs:1385 — layout/src/solver3/sizing.rs:1385-1394 | layout/src/solver3/sizing.rs:1418-1429 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/sizing.rs:1418` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8–11 lines × 2) · ×4
  • Duplicated block (8–11 lines × 2) dll/src/desktop/tray/linux.rs:518 — dll/src/desktop/tray/linux.rs:518-528 | dll/src/desktop/tray/linux.rs:946-953 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/tray/linux.rs:518` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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–11 lines × 2) dll/src/web/transpiler_remill.rs:1466 — dll/src/web/transpiler_remill.rs:1466-1473 | dll/src/web/transpiler_remill.rs:6754-6764 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/web/transpiler_remill.rs:1466` it does not close everything it opens, so those 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, `dll/src/web/transpiler_remill.rs:1466` calls `parse_extern_sub_declares` and `dll/src/web/transpiler_remill.rs:6754` 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–11 lines × 2) doc/src/main.rs:986 — doc/src/main.rs:986-996 | doc/src/main.rs:1231-1238 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/main.rs:986` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8–11 lines × 2) layout/src/glyph_cache.rs:509 — layout/src/glyph_cache.rs:509-519 | layout/src/glyph_cache.rs:1786-1793 — both copies are in the same file, so extract the 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, `layout/src/glyph_cache.rs:522` calls `contains` and `layout/src/glyph_cache.rs:1794` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9–11 lines × 2) · ×4
  • Duplicated block (9–11 lines × 2) doc/src/codegen/v2/lang_haskell/functions.rs:288 — doc/src/codegen/v2/lang_haskell/functions.rs:288-296 | doc/src/codegen/v2/lang_haskell/functions.rs:728-738 — both copies are in the same file, so extract the 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, `doc/src/codegen/v2/lang_haskell/functions.rs:298` calls `is_haskell_ffi_primitive` and `doc/src/codegen/v2/lang_haskell/functions.rs:741` 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–11 lines × 2) doc/src/codegen/v2/lang_swift/wrappers.rs:2929 — doc/src/codegen/v2/lang_swift/wrappers.rs:2929-2937 | doc/src/codegen/v2/lang_swift/wrappers.rs:2952-2962 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_swift/wrappers.rs:2929` it begins part-way through the construct above it, so those exact lines 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–11 lines × 2) layout/src/cpurender/pixmap.rs:228 — layout/src/cpurender/pixmap.rs:228-238 | layout/src/cpurender/pixmap.rs:432-440 — both copies are in the same file, so extract the block into 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–11 lines × 2) layout/src/solver3/fc.rs:7524 — layout/src/solver3/fc.rs:7524-7534 | layout/src/solver3/fc.rs:7633-7641 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (9 lines × 5) · ×4
  • Duplicated block (9 lines × 5) dll/src/desktop/shell2/linux/wayland/mod.rs:7211 — dll/src/desktop/shell2/linux/wayland/mod.rs:7211-7219 | dll/src/desktop/shell2/linux/x11/mod.rs:6548-6556 | dll/src/desktop/shell2/linux/x11/mod.rs:6946-6954 | dll/src/desktop/shell2/windows/mod.rs:1168-1176 | dll/src/desktop/shell2/windows/mod.rs:1658-1666 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:7211` 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 × 5) doc/src/codegen/v2/lang_algol68/wrappers.rs:120 — doc/src/codegen/v2/lang_algol68/wrappers.rs:120-128 | doc/src/codegen/v2/lang_cobol/wrappers.rs:88-96 | doc/src/codegen/v2/lang_freebasic/wrappers.rs:86-94 | doc/src/codegen/v2/lang_pascal/wrappers.rs:128-136 | doc/src/codegen/v2/lang_vb6/wrappers.rs:63-71 — `doc/src/codegen/v2/lang_algol68/wrappers.rs` and `doc/src/codegen/v2/lang_freebasic/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 35 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (9 lines × 5) doc/src/dllgen/deploy.rs:1651 — doc/src/dllgen/deploy.rs:1651-1659 | doc/src/dllgen/deploy.rs:1663-1671 | doc/src/dllgen/deploy.rs:1675-1683 | doc/src/dllgen/deploy.rs:1698-1706 | doc/src/dllgen/deploy.rs:1715-1723 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (9 lines × 5) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:179 — webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:179-187 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:139-147 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:138-146 | webrender/swgl/src/shaders/brush_image_texture_2d.rs:132-140 | webrender/swgl/src/shaders/brush_image_texture_rect.rs:167-175 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs` and `webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 226 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:179` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:178` calls `rect_size` and `webrender/swgl/src/shaders/brush_image_texture_2d.rs:131` 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 × 5) · ×4
  • Duplicated block (8 lines × 5) core/src/resources.rs:2649 — core/src/resources.rs:2649-2656 | core/src/resources.rs:2710-2717 | core/src/resources.rs:2762-2769 | core/src/resources.rs:2841-2848 | core/src/resources.rs:2909-2916 — 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 `core/src/resources.rs:2649` 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 × 5) doc/src/codegen/v2/lang_rust.rs:2895 — doc/src/codegen/v2/lang_rust.rs:2895-2902 | doc/src/codegen/v2/lang_rust.rs:2917-2927 | doc/src/codegen/v2/lang_rust.rs:2935-2942 | doc/src/codegen/v2/rust/static_binding.rs:375-385 | doc/src/codegen/v2/rust/static_binding.rs:418-428 — before extracting anything, compare `doc/src/codegen/v2/lang_rust.rs` and `doc/src/codegen/v2/rust/static_binding.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 100 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 `doc/src/codegen/v2/lang_rust.rs:2895` it begins part-way through the construct above it, so those exact lines 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 × 5) dll/src/desktop/shell2/linux/wayland/mod.rs:10903 — dll/src/desktop/shell2/linux/wayland/mod.rs:10903-10912 | dll/src/desktop/shell2/linux/wayland/mod.rs:11034-11043 | dll/src/desktop/shell2/linux/x11/mod.rs:8660-8669 | dll/src/desktop/shell2/linux/x11/mod.rs:8785-8794 | dll/src/desktop/tray/linux.rs:1178-1185 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:10903` it does not close everything it opens, so those exact lines 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 × 5) doc/src/codegen/v2/lang_crystal/types.rs:179 — doc/src/codegen/v2/lang_crystal/types.rs:179-186 | doc/src/codegen/v2/lang_d/types.rs:145-152 | doc/src/codegen/v2/lang_julia/types.rs:224-231 | doc/src/codegen/v2/lang_odin/types.rs:163-170 | doc/src/codegen/v2/lang_v/types.rs:169-176 — `doc/src/codegen/v2/lang_crystal/types.rs` and `doc/src/codegen/v2/lang_d/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 67 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_crystal/types.rs:179` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 6) · ×4
  • Duplicated block (6 lines × 6) dll/src/desktop/shell2/common/event.rs:6582 — dll/src/desktop/shell2/common/event.rs:6582-6587 | dll/src/desktop/shell2/common/event.rs:11165-11170 | dll/src/desktop/shell2/common/event.rs:11843-11849 | dll/src/desktop/shell2/common/event.rs:11936-11942 | dll/src/desktop/shell2/common/event.rs:12070-12075 | dll/src/desktop/shell2/common/event.rs:12147-12152 — 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 `dll/src/desktop/shell2/common/event.rs:6582` it does not close everything it opens, so those 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 × 6) dll/src/desktop/shell2/linux/wayland/screencopy.rs:67 — dll/src/desktop/shell2/linux/wayland/screencopy.rs:67-72 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:95-100 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:133-138 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:173-178 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:245-250 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:316-321 — 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 `dll/src/desktop/shell2/linux/wayland/screencopy.rs:67` it does not close everything it opens, so those 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 × 6) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:465 — webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:465-470 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:467-472 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:456-461 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:395-400 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:347-352 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:333-338 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs` and `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 439 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 6) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:464 — webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:464-469 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:449-454 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:436-441 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:411-416 | webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:420-425 | webrender/swgl/src/shaders/composite_texture_rect_yuv.rs:400-405 — before extracting anything, compare `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs` and `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 334 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (5 lines × 6) · ×4
  • Duplicated block (5 lines × 6) dll/src/web/transpiler_remill.rs:1642 — dll/src/web/transpiler_remill.rs:1642-1646 | dll/src/web/transpiler_remill.rs:1666-1670 | dll/src/web/transpiler_remill.rs:1692-1696 | dll/src/web/transpiler_remill.rs:1723-1727 | dll/src/web/transpiler_remill.rs:1795-1799 | dll/src/web/transpiler_remill.rs:1820-1824 — 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 `dll/src/web/transpiler_remill.rs:1642` it does not close everything it opens, so those exact lines 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 × 6) layout/src/widgets/backstage.rs:351 — layout/src/widgets/backstage.rs:351-355 | layout/src/widgets/backstage.rs:383-387 | layout/src/widgets/ribbon.rs:993-997 | layout/src/widgets/ribbon.rs:1270-1274 | layout/src/widgets/ribbon.rs:1326-1330 | layout/src/widgets/ribbon.rs:1440-1444 — before extracting anything, compare `layout/src/widgets/backstage.rs` and `layout/src/widgets/ribbon.rs` as WHOLE FILES: this scan already matched 7 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. If that is what happened, the fix is to keep one copy and have the 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 `layout/src/widgets/backstage.rs:351` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `layout/src/widgets/backstage.rs:356` calls `simple`, `const_justify_content` and `layout/src/widgets/backstage.rs:388` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 6) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:270 — webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:270-274 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:274-278 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:280-284 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:274-278 | webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:220-224 | webrender/swgl/src/shaders/composite_texture_rect_yuv.rs:217-221 — before extracting anything, compare `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs` and `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 334 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 6) dll/src/desktop/shell2/linux/wayland/screencopy.rs:100 — dll/src/desktop/shell2/linux/wayland/screencopy.rs:100-115 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:138-158 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:221-225 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:298-302 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:353-357 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:395-410 — 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 `dll/src/desktop/shell2/linux/wayland/screencopy.rs:100` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `dll/src/desktop/shell2/linux/wayland/screencopy.rs:395` calls `leak` and `dll/src/desktop/shell2/linux/wayland/screencopy.rs:221` 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 (5 lines × 5) · ×4
  • Duplicated block (5 lines × 5) layout/src/callbacks.rs:3460 — layout/src/callbacks.rs:3460-3464 | layout/src/callbacks.rs:3485-3489 | layout/src/callbacks.rs:3510-3514 | layout/src/callbacks.rs:3535-3539 | layout/src/callbacks.rs:3560-3564 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (5 lines × 5) doc/src/codegen/v2/lang_cpp/cpp03.rs:615 — doc/src/codegen/v2/lang_cpp/cpp03.rs:615-619 | doc/src/codegen/v2/lang_cpp/cpp11.rs:537-541 | doc/src/codegen/v2/lang_cpp/cpp17.rs:729-733 | doc/src/codegen/v2/lang_cpp/cpp20.rs:845-849 | doc/src/codegen/v2/lang_cpp/cpp20.rs:912-916 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 5) dll/src/desktop/shell2/linux/wayland/defines.rs:2425 — dll/src/desktop/shell2/linux/wayland/defines.rs:2425-2441 | dll/src/desktop/shell2/linux/wayland/defines.rs:2661-2682 | dll/src/desktop/shell2/linux/wayland/defines.rs:2864-2880 | dll/src/desktop/shell2/linux/wayland/defines.rs:2927-2949 | dll/src/desktop/shell2/linux/wayland/defines.rs:3035-3039 — 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 `dll/src/desktop/shell2/linux/wayland/defines.rs:2425` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 5) doc/src/codegen/v2/lang_crystal/types.rs:328 — doc/src/codegen/v2/lang_crystal/types.rs:328-333 | doc/src/codegen/v2/lang_d/types.rs:213-217 | doc/src/codegen/v2/lang_julia/types.rs:315-320 | doc/src/codegen/v2/lang_odin/types.rs:274-279 | doc/src/codegen/v2/lang_v/types.rs:282-287 — `doc/src/codegen/v2/lang_crystal/types.rs` and `doc/src/codegen/v2/lang_d/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 67 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_crystal/types.rs:328` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D1 · Cyclomatic Complexity · TaffyBridge · ×3
  • TaffyBridge::translate_style_to_taffy (cyclomatic 74) layout/src/solver3/taffy_bridge.rs:734 — TaffyBridge::translate_style_to_taffy has cyclomatic complexity 74 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • TaffyBridge::compute_non_flex_layout (cyclomatic 36) layout/src/solver3/taffy_bridge.rs:1990 — TaffyBridge::compute_non_flex_layout has cyclomatic complexity 36 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • TaffyBridge::compute_child_layout (cyclomatic 20) layout/src/solver3/taffy_bridge.rs:1832 — TaffyBridge::compute_child_layout 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 · PictureCompositeMode · ×3
  • PictureCompositeMode::get_coverage_target_svgfe (cyclomatic 59) webrender/core/src/picture.rs:4634 — PictureCompositeMode::get_coverage_target_svgfe has cyclomatic complexity 59 (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.
  • PictureCompositeMode::get_rect (cyclomatic 18) webrender/core/src/picture.rs:4315 — PictureCompositeMode::get_rect 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. This shape REPEATS in the file: one other method here (PictureCompositeMode::get_coverage) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared. This is NOT this file's highest cyclomatic complexity: PictureCompositeMode::kind (cyclomatic 24) 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.
  • PictureCompositeMode::get_coverage (cyclomatic 18) webrender/core/src/picture.rs:4450 — PictureCompositeMode::get_coverage 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. This shape REPEATS in the file: one other method here (PictureCompositeMode::get_rect) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared. This is NOT this file's highest cyclomatic complexity: PictureCompositeMode::kind (cyclomatic 24) 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 · IRBuilder · ×3
  • IRBuilder::validate_api_json (cyclomatic 54) doc/src/codegen/v2/ir_builder.rs:100 — IRBuilder::validate_api_json has cyclomatic complexity 54 (threshold 15). Of this number, 47 points are the body's own statements and 7 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.
  • IRBuilder::sort_types_by_dependencies (cyclomatic 49) doc/src/codegen/v2/ir_builder.rs:528 — IRBuilder::sort_types_by_dependencies 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.
  • IRBuilder::build_monomorphized_def (cyclomatic 16) doc/src/codegen/v2/ir_builder.rs:1389 — IRBuilder::build_monomorphized_def has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · AutofixPatch · ×3
  • AutofixPatch::modify_to_class_patch (cyclomatic 43) doc/src/autofix/patch_format.rs:951 — AutofixPatch::modify_to_class_patch has cyclomatic complexity 43 (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.
  • AutofixPatch::to_api_patch_with_context (cyclomatic 23) doc/src/autofix/patch_format.rs:675 — AutofixPatch::to_api_patch_with_context 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.
  • AutofixPatch::explain (cyclomatic 16) doc/src/autofix/patch_format.rs:407 — AutofixPatch::explain 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 · CompositorState · ×3
  • CompositorState::allocate_layers_from_display_list (cyclomatic 43) layout/src/cpurender/compositor.rs:369 — CompositorState::allocate_layers_from_display_list has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • CompositorState::composite_layer_recursive (cyclomatic 17) layout/src/cpurender/compositor.rs:937 — CompositorState::composite_layer_recursive 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.
  • CompositorState::render_layers (cyclomatic 16) layout/src/cpurender/compositor.rs:706 — CompositorState::render_layers 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 · RenderBackend · ×3
  • RenderBackend::process_api_msg (cyclomatic 28) webrender/core/src/render_backend.rs:953 — RenderBackend::process_api_msg has cyclomatic complexity 28 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • RenderBackend::update_document (cyclomatic 25) webrender/core/src/render_backend.rs:1327 — RenderBackend::update_document 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.
  • RenderBackend::process_scene_builder_result (cyclomatic 19) webrender/core/src/render_backend.rs:1139 — RenderBackend::process_scene_builder_result 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 · Model · ×3
  • Model::new (cyclomatic 24) doc/src/codegen/v2/lang_d/model.rs:245 — Model::new 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.
  • Model::new (cyclomatic 19) doc/src/codegen/v2/lang_swift/model.rs:254 — Model::new 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.
  • Model::new (cyclomatic 18) doc/src/codegen/v2/lang_crystal/model.rs:211 — Model::new 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 · SwCompositor · ×3
  • SwCompositor::occlude_surfaces (cyclomatic 22) webrender/core/src/compositor/sw_compositor.rs:840 — SwCompositor::occlude_surfaces has cyclomatic complexity 22 (threshold 15). Of this number, 16 points are the body's own statements and 6 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • SwCompositor::flush_composites (cyclomatic 17) webrender/core/src/compositor/sw_compositor.rs:1130 — SwCompositor::flush_composites 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.
  • SwCompositor::start_compositing (cyclomatic 16) webrender/core/src/compositor/sw_compositor.rs:1538 — SwCompositor::start_compositing 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 · ResourceCache · ×3
  • ResourceCache::save_capture (cyclomatic 21) webrender/core/src/resource_cache.rs:1931 — ResourceCache::save_capture 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.
  • ResourceCache::post_scene_building_update (cyclomatic 19) webrender/core/src/resource_cache.rs:613 — ResourceCache::post_scene_building_update 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.
  • ResourceCache::request_image (cyclomatic 17) webrender/core/src/resource_cache.rs:954 — ResourceCache::request_image has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D2 · Cognitive Complexity · TaffyBridge · ×3
  • TaffyBridge::translate_style_to_taffy (cognitive 107) layout/src/solver3/taffy_bridge.rs:734 — TaffyBridge::translate_style_to_taffy has cognitive complexity 107 (threshold 15). Drivers by points: if/else 58 (86 pts), match/switch 15 (17 pts), boolean chains 4 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TaffyBridge::compute_non_flex_layout (cognitive 52) layout/src/solver3/taffy_bridge.rs:1990 — TaffyBridge::compute_non_flex_layout has cognitive complexity 52 (threshold 15). Drivers by points: if/else 16 (29 pts), match/switch 11 (18 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TaffyBridge::compute_child_layout (cognitive 27) layout/src/solver3/taffy_bridge.rs:1832 — TaffyBridge::compute_child_layout has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (18 pts), match/switch 4 (7 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompositorState · ×3
  • CompositorState::allocate_layers_from_display_list (cognitive 77) layout/src/cpurender/compositor.rs:369 — CompositorState::allocate_layers_from_display_list has cognitive complexity 77 (threshold 15). Drivers by points: if/else 20 (64 pts), boolean chains 10, match/switch 1 (2 pts), loops 1 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • CompositorState::render_layers (cognitive 25) layout/src/cpurender/compositor.rs:706 — CompositorState::render_layers has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 5 (8 pts), boolean chains 3 (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.
  • CompositorState::composite_layer_recursive (cognitive 25) layout/src/cpurender/compositor.rs:937 — CompositorState::composite_layer_recursive has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 4, loops 1, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · AutofixPatch · ×3
  • AutofixPatch::to_api_patch_with_context (cognitive 64) doc/src/autofix/patch_format.rs:675 — AutofixPatch::to_api_patch_with_context has cognitive complexity 64 (threshold 15). Drivers by points: if/else 14 (43 pts), loops 7 (19 pts), match/switch 1 (2 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.
  • AutofixPatch::modify_to_class_patch (cognitive 44) doc/src/autofix/patch_format.rs:951 — AutofixPatch::modify_to_class_patch has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (28 pts), loops 4 (10 pts), match/switch 2 (6 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.
  • AutofixPatch::explain (cognitive 37) doc/src/autofix/patch_format.rs:407 — AutofixPatch::explain has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 4 (12 pts), match/switch 1 (2 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Device · ×3
  • Device::new (cognitive 62) webrender/core/src/device/gl.rs:1440 — Device::new has cognitive complexity 62 (threshold 15). Drivers by points: if/else 27 (33 pts), boolean chains 19, match/switch 8 (9 pts), loops 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
  • Device::link_program (cognitive 42) webrender/core/src/device/gl.rs:2444 — Device::link_program has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (36 pts), match/switch 2 (4 pts), loops 1 (2 pts) (nesting depth added 24). 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.
  • Device::bind_texture_impl (cognitive 20) webrender/core/src/device/gl.rs:2242 — Device::bind_texture_impl has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 2 (7 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 · TypeResolver · ×3
  • TypeResolver::check_type_c_compatibility_with_index (cognitive 55) doc/src/autofix/type_resolver.rs:434 — TypeResolver::check_type_c_compatibility_with_index has cognitive complexity 55 (threshold 15). Drivers by points: if/else 10 (39 pts), loops 2 (9 pts), match/switch 3 (7 pts) (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.
  • TypeResolver::resolve_type_with_context (cognitive 26) doc/src/autofix/type_resolver.rs:165 — TypeResolver::resolve_type_with_context has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TypeResolver::resolve_referenced_types (cognitive 23) doc/src/autofix/type_resolver.rs:298 — TypeResolver::resolve_referenced_types has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 4 (8 pts), match/switch 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · IntrinsicSizeCalculator · ×3
  • IntrinsicSizeCalculator::calculate_intrinsic_recursive (cognitive 50) layout/src/solver3/sizing.rs:279 — IntrinsicSizeCalculator::calculate_intrinsic_recursive has cognitive complexity 50 (threshold 15). Drivers by points: if/else 22 (45 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 24). 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.
  • IntrinsicSizeCalculator::calculate_node_intrinsic_sizes (cognitive 48) layout/src/solver3/sizing.rs:512 — IntrinsicSizeCalculator::calculate_node_intrinsic_sizes has cognitive complexity 48 (threshold 15). Drivers by points: if/else 26 (41 pts), boolean chains 6, match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • IntrinsicSizeCalculator::calculate_table_intrinsic_sizes (cognitive 28) layout/src/solver3/sizing.rs:1208 — IntrinsicSizeCalculator::calculate_table_intrinsic_sizes has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 4 (7 pts), match/switch 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TextShapingCache · ×3
  • TextShapingCache::measure_intrinsic_widths (cognitive 38) layout/src/text3/cache.rs:8146 — TextShapingCache::measure_intrinsic_widths has cognitive complexity 38 (threshold 15). Drivers by points: if/else 21 (34 pts), boolean chains 3, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TextShapingCache::memory_report (cognitive 25) layout/src/text3/cache.rs:7501 — TextShapingCache::memory_report has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 5 (7 pts), match/switch 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • TextShapingCache::layout_flow (cognitive 18) layout/src/text3/cache.rs:7897 — TextShapingCache::layout_flow has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SymbolTable · ×3
  • SymbolTable::assign_synthetic_addresses (cognitive 28) dll/src/web/symbol_table.rs:756 — SymbolTable::assign_synthetic_addresses has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 6 (7 pts), match/switch 3 (7 pts), boolean chains 3 (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.
  • SymbolTable::enumerate_low32_data_for_wasm (cognitive 20) dll/src/web/symbol_table.rs:513 — SymbolTable::enumerate_low32_data_for_wasm has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 4 (8 pts), if/else 2 (6 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SymbolTable::build_from_loaded_image (cognitive 18) dll/src/web/symbol_table.rs:582 — SymbolTable::build_from_loaded_image has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 3 (6 pts), loops 3 (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 · WorkspaceIndex · ×3
  • WorkspaceIndex::find_type_by_string_search_inner (cognitive 27) doc/src/patch/index.rs:697 — WorkspaceIndex::find_type_by_string_search_inner has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (23 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • WorkspaceIndex::deduce_full_path (cognitive 24) doc/src/patch/index.rs:864 — WorkspaceIndex::deduce_full_path has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 4 (5 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.
  • WorkspaceIndex::build_with_verbosity (cognitive 20) doc/src/patch/index.rs:519 — WorkspaceIndex::build_with_verbosity has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (15 pts), loops 2 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D4 · Code Duplication · Edited copy of a member (48 corresponding lines) · ×3
  • Edited copy of a member (48 corresponding lines) layout/src/xml/svg.rs:1340 — layout/src/xml/svg.rs:1340-1393 | layout/src/xml/svg.rs:1400-1453 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (48 corresponding lines) dll/src/desktop/shell2/common/transient.rs:226 — dll/src/desktop/shell2/common/transient.rs:226-273 | dll/src/desktop/shell2/common/transient.rs:291-347 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (48 corresponding lines) layout/src/managers/gesture.rs:1285 — layout/src/managers/gesture.rs:1285-1332 | layout/src/managers/gesture.rs:1472-1524 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Members sharing a duplicated core (9 members, 50+ identical tokens) · ×3
  • Members sharing a duplicated core (9 members, 50+ identical tokens) dll/src/desktop/extra/file_picker/android.rs:129 — dll/src/desktop/extra/file_picker/android.rs:129-147 | dll/src/desktop/extra/media_keys/android.rs:135-165 | dll/src/desktop/shell2/android/clipboard.rs:118-171 | dll/src/desktop/shell2/android/clipboard.rs:175-231 | dll/src/desktop/shell2/android/mod.rs:2383-2434 | dll/src/desktop/shell2/android/mod.rs:2449-2495 | dll/src/desktop/shell2/android/mod.rs:2511-2559 | dll/src/desktop/shell2/android/mod.rs:2884-2968 | dll/src/desktop/shell2/android/mod.rs:3094-3220 — These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
  • Members sharing a duplicated core (9 members, 50+ identical tokens) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:398 — webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:398-420 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:398-422 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:386-411 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:324-350 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:392-413 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:282-300 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:353-365 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:341-353 | webrender/swgl/src/shaders/brush_image_texture_rect.rs:271-284 — These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
  • Members sharing a duplicated core (9 members, 50+ identical tokens) webrender/swgl/src/shaders/brush_linear_gradient.rs:261 — webrender/swgl/src/shaders/brush_linear_gradient.rs:261-270 | webrender/swgl/src/shaders/brush_linear_gradient_alpha_pass.rs:277-286 | webrender/swgl/src/shaders/cs_border_segment.rs:424-433 | webrender/swgl/src/shaders/cs_border_solid.rs:310-319 | webrender/swgl/src/shaders/cs_conic_gradient.rs:198-207 | webrender/swgl/src/shaders/cs_fast_linear_gradient.rs:178-187 | webrender/swgl/src/shaders/cs_linear_gradient.rs:191-200 | webrender/swgl/src/shaders/cs_radial_gradient.rs:216-225 | webrender/swgl/src/shaders/ps_quad_radial_gradient.rs:273-282 — These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
D4 · Code Duplication · Edited copy of a member (1 corresponding lines) · ×3
  • Edited copy of a member (1 corresponding lines) layout/src/widgets/map.rs:1438 — layout/src/widgets/map.rs:1438-1438 | layout/src/widgets/video.rs:378-378 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (1 corresponding lines) webrender/swgl/src/shaders/brush_mix_blend.rs:141 — webrender/swgl/src/shaders/brush_mix_blend.rs:141-143 | webrender/swgl/src/shaders/brush_mix_blend_alpha_pass.rs:399-399 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (1 corresponding lines) dll/src/desktop/extra/sqlite/mod.rs:288 — dll/src/desktop/extra/sqlite/mod.rs:288-288 | dll/src/unified/sqlite.rs:67-67 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (65 corresponding lines) · ×3
  • Edited copy of a member (65 corresponding lines) doc/src/codegen/v2/lang_odin/types.rs:36 — doc/src/codegen/v2/lang_odin/types.rs:36-100 | doc/src/codegen/v2/lang_v/types.rs:36-103 — These two members are one piece of code written twice and then edited apart: 65 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (65 corresponding lines) dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:398 — dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:398-468 | dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:498-562 — These two members are one piece of code written twice and then edited apart: 65 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (65 corresponding lines) doc/src/codegen/v2/lang_d/mod.rs:340 — doc/src/codegen/v2/lang_d/mod.rs:340-404 | doc/src/codegen/v2/lang_swift/mod.rs:308-378 — These two members are one piece of code written twice and then edited apart: 65 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) · ×3
  • Edited copy of a member (49 corresponding lines) doc/src/codegen/v2/lang_d/wrappers.rs:398 — doc/src/codegen/v2/lang_d/wrappers.rs:398-457 | doc/src/codegen/v2/lang_swift/wrappers.rs:380-428 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (49 corresponding lines) layout/src/solver3/fc.rs:958 — layout/src/solver3/fc.rs:958-1006 | layout/src/solver3/fc.rs:1013-1066 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (49 corresponding lines) doc/src/codegen/v2/lang_ruby/wrappers.rs:1256 — doc/src/codegen/v2/lang_ruby/wrappers.rs:1256-1331 | doc/src/codegen/v2/lang_ruby/wrappers.rs:1343-1391 — 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 (53 corresponding lines) · ×3
  • Edited copy of a member (53 corresponding lines) doc/src/codegen/v2/lang_rust.rs:3771 — doc/src/codegen/v2/lang_rust.rs:3771-3823 | doc/src/codegen/v2/lang_rust.rs:3846-3910 — 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.
  • Edited copy of a member (53 corresponding lines) dll/src/desktop/extra/file_picker/ios.rs:341 — dll/src/desktop/extra/file_picker/ios.rs:341-393 | dll/src/desktop/extra/file_picker/ios.rs:428-490 — 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.
  • Edited copy of a member (53 corresponding lines) layout/src/widgets/breadcrumb.rs:247 — layout/src/widgets/breadcrumb.rs:247-322 | layout/src/widgets/segmented.rs:379-431 — 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 (28 corresponding lines) · ×3
  • Edited copy of a member (28 corresponding lines) dll/src/desktop/shell2/linux/wayland/events.rs:1282 — dll/src/desktop/shell2/linux/wayland/events.rs:1282-1309 | dll/src/desktop/shell2/linux/wayland/events.rs:1311-1339 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:5406 — dll/src/desktop/shell2/linux/wayland/mod.rs:5406-5433 | dll/src/desktop/shell2/linux/wayland/mod.rs:5927-5961 — 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) core/src/gamepad.rs:200 — core/src/gamepad.rs:200-227 | core/src/gamepad.rs:233-260 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 13+ corresponding lines) layout/src/cpurender/compositor.rs:294 — layout/src/cpurender/compositor.rs:294-306 | layout/src/cpurender/pixmap.rs:26-42 | layout/src/solver3/display_list.rs:1810-1826 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) dll/src/desktop/shell2/linux/wayland/events.rs:2854 — dll/src/desktop/shell2/linux/wayland/events.rs:2854-2866 | dll/src/desktop/shell2/linux/wayland/events.rs:2952-2964 | dll/src/desktop/shell2/linux/wayland/events.rs:3034-3049 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) doc/src/codegen/v2/lang_csharp/wrappers.rs:148 — doc/src/codegen/v2/lang_csharp/wrappers.rs:148-160 | doc/src/codegen/v2/lang_java/wrappers.rs:1304-1319 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:137-149 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 8+ corresponding lines) · ×3
  • Edited copies of one member (4 members, 8+ corresponding lines) css/src/corety.rs:717 — css/src/corety.rs:717-726 | css/src/props/layout/shape.rs:47-54 | css/src/props/layout/shape.rs:93-100 | css/src/props/layout/shape.rs:139-146 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 8+ corresponding lines) css/src/codegen/format.rs:292 — css/src/codegen/format.rs:292-311 | css/src/codegen/format.rs:334-341 | css/src/codegen/format.rs:345-352 | css/src/codegen/format.rs:356-366 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 8+ corresponding lines) webrender/swgl/src/shaders/cs_clip_box_shadow_texture_2d.rs:446 — webrender/swgl/src/shaders/cs_clip_box_shadow_texture_2d.rs:446-453 | webrender/swgl/src/shaders/cs_conic_gradient.rs:267-274 | webrender/swgl/src/shaders/cs_linear_gradient.rs:275-282 | webrender/swgl/src/shaders/cs_radial_gradient.rs:302-309 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 7+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 7+ corresponding lines) webrender/swgl/src/shaders/ps_quad_mask.rs:188 — webrender/swgl/src/shaders/ps_quad_mask.rs:188-194 | webrender/swgl/src/shaders/ps_quad_mask_fast_path.rs:276-282 | webrender/swgl/src/shaders/ps_quad_textured.rs:167-173 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 7+ corresponding lines) core/src/tray.rs:106 — core/src/tray.rs:106-114 | dll/src/desktop/eyedropper/mod.rs:494-500 | dll/src/desktop/tray/linux.rs:1030-1036 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 7+ corresponding lines) layout/src/widgets/color_input.rs:205 — layout/src/widgets/color_input.rs:205-211 | layout/src/widgets/date_picker.rs:668-674 | layout/src/widgets/time_picker.rs:470-476 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 13+ corresponding lines) · ×3
  • Edited copies of one member (4 members, 13+ corresponding lines) doc/src/codegen/v2/lang_kotlin/derives.rs:284 — doc/src/codegen/v2/lang_kotlin/derives.rs:284-297 | doc/src/codegen/v2/lang_kotlin/derives.rs:360-376 | doc/src/codegen/v2/lang_kotlin/derives.rs:407-419 | doc/src/codegen/v2/lang_kotlin/derives.rs:429-447 — 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.
  • Edited copies of one member (4 members, 13+ corresponding lines) doc/src/codegen/v2/lang_csharp/wrappers.rs:2049 — doc/src/codegen/v2/lang_csharp/wrappers.rs:2049-2067 | doc/src/codegen/v2/lang_freebasic/wrappers.rs:459-471 | doc/src/codegen/v2/lang_powershell/cmdlets.rs:391-403 | doc/src/codegen/v2/lang_vb6/mod.rs:418-432 — 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.
  • Edited copies of one member (4 members, 13+ corresponding lines) doc/src/codegen/v2/lang_csharp/wrappers.rs:176 — doc/src/codegen/v2/lang_csharp/wrappers.rs:176-198 | doc/src/codegen/v2/lang_csharp/wrappers.rs:200-213 | doc/src/codegen/v2/lang_java/wrappers.rs:1846-1858 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:176-188 — 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 (3 members, 6+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 6+ corresponding lines) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:210 — webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:210-215 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:220-225 | webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:161-166 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 6+ corresponding lines) core/src/dom.rs:3558 — core/src/dom.rs:3558-3564 | core/src/menu.rs:174-179 | core/src/styled_dom.rs:523-528 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 6+ corresponding lines) doc/src/api.rs:1151 — doc/src/api.rs:1151-1156 | doc/src/codegen/v2/lang_d/model.rs:704-709 | layout/src/managers/undo_redo.rs:342-347 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (33 lines × 2) · ×3
  • Duplicated block (33 lines × 2) dll/src/desktop/shell2/linux/x11/mod.rs:4218 — dll/src/desktop/shell2/linux/x11/mod.rs:4218-4250 | dll/src/desktop/shell2/windows/mod.rs:7637-7669 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 450 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 `dll/src/desktop/shell2/linux/x11/mod.rs:4218` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (33 lines × 2) doc/src/codegen/v2/lang_rust.rs:4873 — doc/src/codegen/v2/lang_rust.rs:4873-4905 | doc/src/codegen/v2/lang_rust.rs:4928-4960 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_rust.rs:4873` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (33 lines × 2) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:282 — webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:282-314 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:250-282 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs` and `webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 356 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:282` 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 (30 lines × 2) · ×3
  • Duplicated block (30 lines × 2) dll/src/desktop/shell2/linux/x11/mod.rs:6240 — dll/src/desktop/shell2/linux/x11/mod.rs:6240-6269 | dll/src/desktop/shell2/windows/mod.rs:1899-1928 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 450 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 `dll/src/desktop/shell2/linux/x11/mod.rs:6240` 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, `dll/src/desktop/shell2/linux/x11/mod.rs:6273` calls `update_gnome_menu` and `dll/src/desktop/shell2/windows/mod.rs:1930` 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 (30 lines × 2) doc/src/codegen/v2/lang_lisp/wrappers.rs:224 — doc/src/codegen/v2/lang_lisp/wrappers.rs:224-253 | doc/src/codegen/v2/lang_lisp/wrappers.rs:281-310 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_lisp/wrappers.rs:224` 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) doc/src/codegen/v2/lang_python.rs:1550 — doc/src/codegen/v2/lang_python.rs:1550-1579 | doc/src/codegen/v2/lang_python.rs:1599-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 `doc/src/codegen/v2/lang_python.rs:1550` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×3
  • Duplicated block (27 lines × 2) layout/src/widgets/camera.rs:414 — layout/src/widgets/camera.rs:414-440 | layout/src/widgets/screencap.rs:364-390 — before extracting anything, compare `layout/src/widgets/camera.rs` and `layout/src/widgets/screencap.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 108 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `layout/src/widgets/camera.rs:414` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (27 lines × 2) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:434 — webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:434-460 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:406-432 — before extracting anything, compare `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs` and `webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 326 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (27 lines × 2) dll/src/desktop/wr_translate2.rs:1828 — dll/src/desktop/wr_translate2.rs:1828-1854 | dll/src/desktop/wr_translate2.rs:1869-1895 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/wr_translate2.rs:1828` it does not close everything it opens, so those 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–25 lines × 2) · ×3
  • Duplicated block (23–25 lines × 2) dll/src/desktop/shell2/linux/x11/mod.rs:6904 — dll/src/desktop/shell2/linux/x11/mod.rs:6904-6928 | dll/src/desktop/shell2/windows/mod.rs:1604-1626 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 450 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 `dll/src/desktop/shell2/linux/x11/mod.rs:6904` it does not close everything it opens, so those exact lines 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–25 lines × 2) doc/src/codegen/v2/lang_php/wrappers.rs:202 — doc/src/codegen/v2/lang_php/wrappers.rs:202-226 | doc/src/codegen/v2/lang_php/wrappers.rs:390-412 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_php/wrappers.rs:202` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (23–25 lines × 2) layout/src/managers/gesture.rs:1958 — layout/src/managers/gesture.rs:1958-1982 | layout/src/managers/gesture.rs:2036-2058 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/managers/gesture.rs:1958` it begins part-way through the construct above it, so those 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–25 lines × 2) · ×3
  • Duplicated block (24–25 lines × 2) doc/src/codegen/v2/lang_d/model.rs:635 — doc/src/codegen/v2/lang_d/model.rs:635-659 | doc/src/codegen/v2/lang_swift/model.rs:652-675 — `doc/src/codegen/v2/lang_d/model.rs` and `doc/src/codegen/v2/lang_swift/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 21 separate duplicated blocks between them, totalling at least 240 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (24–25 lines × 2) layout/src/text3/cache.rs:6321 — layout/src/text3/cache.rs:6321-6345 | layout/src/text3/cache.rs:6412-6435 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/text3/cache.rs:6321` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (24–25 lines × 2) layout/src/widgets/pagination.rs:231 — layout/src/widgets/pagination.rs:231-254 | layout/src/widgets/segmented.rs:200-224 — before extracting anything, compare `layout/src/widgets/pagination.rs` and `layout/src/widgets/segmented.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `layout/src/widgets/pagination.rs:231` it begins part-way through the construct above it, so those 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 (19–23 lines × 2) · ×3
  • Duplicated block (19–23 lines × 2) doc/src/codegen/v2/lang_java/types.rs:154 — doc/src/codegen/v2/lang_java/types.rs:154-172 | doc/src/codegen/v2/lang_java/types.rs:446-468 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_java/types.rs:154` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19–23 lines × 2) layout/src/cpurender/compositor.rs:2524 — layout/src/cpurender/compositor.rs:2524-2542 | layout/src/cpurender/raster.rs:1421-1443 — before extracting anything, compare `layout/src/cpurender/compositor.rs` and `layout/src/cpurender/raster.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/cpurender/compositor.rs:2524` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19–23 lines × 2) doc/src/codegen/v2/lang_ruby/types.rs:319 — doc/src/codegen/v2/lang_ruby/types.rs:319-341 | doc/src/codegen/v2/lang_ruby/types.rs:642-660 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_ruby/types.rs:319` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21–22 lines × 2) · ×3
  • Duplicated block (21–22 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:11024 — dll/src/desktop/shell2/linux/wayland/mod.rs:11024-11045 | dll/src/desktop/shell2/linux/x11/mod.rs:8776-8796 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:11024` it begins part-way through the construct above it, so those exact lines 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–22 lines × 2) dll/src/desktop/shell2/linux/x11/accessibility.rs:171 — dll/src/desktop/shell2/linux/x11/accessibility.rs:171-192 | dll/src/desktop/shell2/windows/accessibility.rs:148-168 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/accessibility.rs` and `dll/src/desktop/shell2/windows/accessibility.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 63 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 (21–22 lines × 2) webrender/swgl/src/shaders/cs_blur_alpha_target.rs:137 — webrender/swgl/src/shaders/cs_blur_alpha_target.rs:137-157 | webrender/swgl/src/shaders/cs_blur_color_target.rs:129-150 — before extracting anything, compare `webrender/swgl/src/shaders/cs_blur_alpha_target.rs` and `webrender/swgl/src/shaders/cs_blur_color_target.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/cs_blur_alpha_target.rs:137` it does not close everything it opens, so those 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–22 lines × 2) · ×3
  • Duplicated block (20–22 lines × 2) doc/src/codegen/v2/config.rs:481 — doc/src/codegen/v2/config.rs:481-500 | doc/src/codegen/v2/config.rs:707-728 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/config.rs:481` it begins part-way through the construct above it, so those exact lines 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–22 lines × 2) layout/src/solver3/getters.rs:4690 — layout/src/solver3/getters.rs:4690-4711 | layout/src/solver3/getters.rs:5020-5039 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/getters.rs:4690` it does not close everything it opens, so those exact lines 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–22 lines × 2) layout/src/widgets/badge.rs:56 — layout/src/widgets/badge.rs:56-75 | layout/src/widgets/chip.rs:135-156 — before extracting anything, compare `layout/src/widgets/badge.rs` and `layout/src/widgets/chip.rs` as WHOLE FILES: this scan already matched 4 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 `layout/src/widgets/badge.rs:56` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21 lines × 4) · ×3
  • Duplicated block (21 lines × 4) doc/src/reftest/autodoc.rs:1116 — doc/src/reftest/autodoc.rs:1116-1136 | doc/src/reftest/autoreview.rs:756-776 | doc/src/reftest/autoreview.rs:992-1012 | doc/src/reftest/autoreview.rs:1895-1915 — before extracting anything, compare `doc/src/reftest/autodoc.rs` and `doc/src/reftest/autoreview.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 212 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/reftest/autodoc.rs:1116` it begins part-way through the construct above it, so those exact lines 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 × 4) webrender/core/src/batch.rs:2871 — webrender/core/src/batch.rs:2871-2891 | webrender/core/src/batch.rs:2998-3018 | webrender/core/src/batch.rs:3125-3145 | webrender/core/src/batch.rs:3252-3272 — 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 `webrender/core/src/batch.rs:2871` 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, `webrender/core/src/batch.rs:2870` calls `get_address` and `webrender/core/src/batch.rs:2997` 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 (21 lines × 4) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:127 — webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:127-147 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:129-149 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:129-149 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:120-140 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs` and `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 439 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:127` 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–21 lines × 3) · ×3
  • Duplicated block (15–21 lines × 3) doc/src/codegen/v2/lang_ada/types.rs:133 — doc/src/codegen/v2/lang_ada/types.rs:133-147 | doc/src/codegen/v2/lang_fortran/types.rs:95-110 | doc/src/codegen/v2/lang_pascal/types.rs:84-104 — `doc/src/codegen/v2/lang_ada/types.rs` and `doc/src/codegen/v2/lang_fortran/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 47 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_ada/types.rs:133` it begins part-way through the construct above it, so those 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, `doc/src/codegen/v2/lang_fortran/types.rs:94` calls `line`, `marker` and `doc/src/codegen/v2/lang_ada/types.rs:132` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15–21 lines × 3) doc/src/codegen/v2/lang_cpp/cpp17.rs:27 — doc/src/codegen/v2/lang_cpp/cpp17.rs:27-47 | doc/src/codegen/v2/lang_cpp/cpp20.rs:37-57 | doc/src/codegen/v2/lang_cpp/cpp20.rs:434-448 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp17.rs` and `doc/src/codegen/v2/lang_cpp/cpp20.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 616 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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, `doc/src/codegen/v2/lang_cpp/cpp20.rs:58` calls `push_str`, `generate_deducing_this_feature_macro` and `doc/src/codegen/v2/lang_cpp/cpp17.rs:50` 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–21 lines × 3) doc/src/codegen/v2/lang_java/wrappers.rs:1582 — doc/src/codegen/v2/lang_java/wrappers.rs:1582-1602 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:1617-1631 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:1858-1872 — `doc/src/codegen/v2/lang_java/wrappers.rs` and `doc/src/codegen/v2/lang_kotlin/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 173 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_java/wrappers.rs:1582` it begins part-way through the construct above it, so those 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–20 lines × 2) · ×3
  • Duplicated block (18–20 lines × 2) layout/src/solver3/cache.rs:2004 — layout/src/solver3/cache.rs:2004-2023 | layout/src/solver3/cache.rs:2162-2179 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/cache.rs:2004` it begins part-way through the construct above it, so those 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, `layout/src/solver3/cache.rs:2003` calls `clear` and `layout/src/solver3/cache.rs:2160` 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 (18–20 lines × 2) layout/src/widgets/text_area.rs:682 — layout/src/widgets/text_area.rs:682-699 | layout/src/widgets/text_input.rs:1060-1079 — before extracting anything, compare `layout/src/widgets/text_area.rs` and `layout/src/widgets/text_input.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `layout/src/widgets/text_area.rs:682` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18–20 lines × 2) doc/src/codegen/v2/lang_csharp/derives.rs:295 — doc/src/codegen/v2/lang_csharp/derives.rs:295-314 | doc/src/codegen/v2/lang_csharp/derives.rs:321-338 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_csharp/derives.rs:295` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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–18 lines × 2) · ×3
  • Duplicated block (15–18 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:10403 — dll/src/desktop/shell2/linux/wayland/mod.rs:10403-10420 | dll/src/desktop/shell2/linux/wayland/mod.rs:10674-10688 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:10403` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15–18 lines × 2) doc/src/codegen/v2/lang_cpp/common.rs:518 — doc/src/codegen/v2/lang_cpp/common.rs:518-535 | doc/src/codegen/v2/lang_cpp/common.rs:930-944 — both copies are in the same file, so extract the 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, `doc/src/codegen/v2/lang_cpp/common.rs:945` calls `push_str` and `doc/src/codegen/v2/lang_cpp/common.rs:536` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15–18 lines × 2) doc/src/codegen/v2/lang_fortran/types.rs:482 — doc/src/codegen/v2/lang_fortran/types.rs:482-499 | doc/src/codegen/v2/lang_fortran/types.rs:527-541 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×3
  • Duplicated block (17–18 lines × 2) dll/src/desktop/shell2/macos/mod.rs:7456 — dll/src/desktop/shell2/macos/mod.rs:7456-7473 | dll/src/desktop/shell2/windows/mod.rs:7584-7600 — `dll/src/desktop/shell2/macos/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 13 separate duplicated blocks between them, totalling at least 196 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/macos/mod.rs:7456` 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–18 lines × 2) doc/src/codegen/v2/lang_php/wrappers.rs:144 — doc/src/codegen/v2/lang_php/wrappers.rs:144-161 | doc/src/codegen/v2/lang_php/wrappers.rs:256-272 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_php/wrappers.rs:144` 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–18 lines × 2) doc/src/reftest/autodoc.rs:1764 — doc/src/reftest/autodoc.rs:1764-1781 | doc/src/reftest/autodoc.rs:2033-2049 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (17 lines × 4) · ×3
  • Duplicated block (17 lines × 4) dll/src/desktop/shell2/linux/wayland/mod.rs:10938 — dll/src/desktop/shell2/linux/wayland/mod.rs:10938-10954 | dll/src/desktop/shell2/linux/wayland/mod.rs:11057-11073 | dll/src/desktop/shell2/linux/x11/mod.rs:8695-8711 | dll/src/desktop/shell2/linux/x11/mod.rs:8808-8824 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:10938` it begins part-way through the construct above it, so those exact lines 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 × 4) doc/src/codegen/v2/lang_cpp/cpp03.rs:192 — doc/src/codegen/v2/lang_cpp/cpp03.rs:192-208 | doc/src/codegen/v2/lang_cpp/cpp11.rs:702-718 | doc/src/codegen/v2/lang_cpp/cpp17.rs:213-229 | doc/src/codegen/v2/lang_cpp/cpp20.rs:678-694 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (17 lines × 4) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:178 — webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:178-194 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:184-200 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:188-204 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:184-200 — before extracting anything, compare `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs` and `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 334 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:178` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13–16 lines × 2) · ×3
  • Duplicated block (13–16 lines × 2) dll/src/desktop/compositor2.rs:682 — dll/src/desktop/compositor2.rs:682-694 | dll/src/desktop/compositor2.rs:1429-1444 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/compositor2.rs:682` 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–16 lines × 2) doc/src/codegen/v2/lang_cobol/types.rs:319 — doc/src/codegen/v2/lang_cobol/types.rs:319-331 | doc/src/codegen/v2/lang_cobol/types.rs:357-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 `doc/src/codegen/v2/lang_cobol/types.rs:319` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13–16 lines × 2) layout/src/solver3/display_list.rs:10959 — layout/src/solver3/display_list.rs:10959-10971 | layout/src/solver3/display_list.rs:11206-11221 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/display_list.rs:10959` it begins part-way through the construct above it, so those 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 × 4) · ×3
  • Duplicated block (15 lines × 4) dll/src/desktop/shell2/linux/wayland/mod.rs:5016 — dll/src/desktop/shell2/linux/wayland/mod.rs:5016-5030 | dll/src/desktop/shell2/linux/x11/events.rs:954-968 | dll/src/desktop/shell2/macos/events.rs:654-671 | dll/src/desktop/shell2/windows/mod.rs:5612-5627 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/events.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 263 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 `dll/src/desktop/shell2/linux/wayland/mod.rs:5016` 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 × 4) doc/src/autofix/debug.rs:1179 — doc/src/autofix/debug.rs:1179-1193 | doc/src/autofix/debug.rs:1208-1222 | doc/src/autofix/debug.rs:1244-1258 | doc/src/autofix/debug.rs:1273-1287 — 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 `doc/src/autofix/debug.rs:1179` it does not close everything it opens, so those exact lines 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 × 4) doc/src/codegen/v2/lang_cpp/cpp03.rs:251 — doc/src/codegen/v2/lang_cpp/cpp03.rs:251-265 | doc/src/codegen/v2/lang_cpp/cpp11.rs:160-174 | doc/src/codegen/v2/lang_cpp/cpp17.rs:291-305 | doc/src/codegen/v2/lang_cpp/cpp20.rs:1004-1018 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/codegen/v2/lang_cpp/cpp03.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `doc/src/codegen/v2/lang_cpp/cpp03.rs:248` calls `is_copy` and `doc/src/codegen/v2/lang_cpp/cpp11.rs:157` 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–15 lines × 2) · ×3
  • Duplicated block (13–15 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:10471 — dll/src/desktop/shell2/linux/wayland/mod.rs:10471-10485 | dll/src/desktop/shell2/linux/wayland/mod.rs:10611-10623 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13–15 lines × 2) doc/src/codegen/v2/lang_freebasic/functions.rs:117 — doc/src/codegen/v2/lang_freebasic/functions.rs:117-131 | doc/src/codegen/v2/lang_freebasic/types.rs:362-374 — before extracting anything, compare `doc/src/codegen/v2/lang_freebasic/functions.rs` and `doc/src/codegen/v2/lang_freebasic/types.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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, `doc/src/codegen/v2/lang_freebasic/types.rs:360` calls `ffi_type_name` and `doc/src/codegen/v2/lang_freebasic/functions.rs:115` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13–15 lines × 2) layout/src/dom_lint.rs:885 — layout/src/dom_lint.rs:885-899 | layout/src/dom_lint.rs:1092-1104 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/dom_lint.rs:885` it does not close everything it opens, so those 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–14 lines × 3) · ×3
  • Duplicated block (12–14 lines × 3) layout/src/solver3/display_list.rs:1230 — layout/src/solver3/display_list.rs:1230-1243 | layout/src/solver3/display_list.rs:1345-1358 | layout/src/solver3/display_list.rs:1370-1381 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/display_list.rs:1230` 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 (12–14 lines × 3) layout/src/text3/edit.rs:560 — layout/src/text3/edit.rs:560-573 | layout/src/text3/edit.rs:824-835 | layout/src/text3/edit.rs:957-968 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/text3/edit.rs:560` 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–14 lines × 3) webrender/core/src/scene_building.rs:3858 — webrender/core/src/scene_building.rs:3858-3871 | webrender/core/src/scene_building.rs:3910-3923 | webrender/core/src/scene_building.rs:3986-3997 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/core/src/scene_building.rs:3858` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–14 lines × 2) · ×3
  • Duplicated block (11–14 lines × 2) dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:281 — dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:281-291 | dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:478-491 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.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.
  • Duplicated block (11–14 lines × 2) dll/src/desktop/shell2/macos/mod.rs:909 — dll/src/desktop/shell2/macos/mod.rs:909-922 | dll/src/desktop/shell2/macos/mod.rs:950-960 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/macos/mod.rs:909` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11–14 lines × 2) doc/src/codegen/v2/lang_rust.rs:2892 — doc/src/codegen/v2/lang_rust.rs:2892-2902 | doc/src/codegen/v2/lang_rust.rs:3176-3189 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_rust.rs:2892` it begins part-way through the construct above it, so those 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 × 4) · ×3
  • Duplicated block (13 lines × 4) doc/src/autofix/type_index.rs:2266 — doc/src/autofix/type_index.rs:2266-2278 | doc/src/autofix/type_index.rs:2313-2325 | doc/src/autofix/type_index.rs:2368-2380 | doc/src/autofix/type_index.rs:2414-2426 — 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 `doc/src/autofix/type_index.rs:2266` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 4) doc/src/codegen/v2/lang_rust.rs:2523 — doc/src/codegen/v2/lang_rust.rs:2523-2535 | doc/src/codegen/v2/lang_rust.rs:2598-2610 | doc/src/codegen/v2/rust/shared.rs:132-144 | doc/src/codegen/v2/rust/shared.rs:181-193 — before extracting anything, compare `doc/src/codegen/v2/lang_rust.rs` and `doc/src/codegen/v2/rust/shared.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 210 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 `doc/src/codegen/v2/lang_rust.rs:2523` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 4) layout/src/solver3/fc.rs:5937 — layout/src/solver3/fc.rs:5937-5949 | layout/src/solver3/fc.rs:5967-5979 | layout/src/solver3/fc.rs:5997-6009 | layout/src/solver3/fc.rs:6027-6039 — 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 `layout/src/solver3/fc.rs:5937` it begins part-way through the construct above it, so those 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 × 6) · ×3
  • Duplicated block (10 lines × 6) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:299 — webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:299-308 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:303-312 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:309-318 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:303-312 | webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:263-272 | webrender/swgl/src/shaders/composite_texture_rect_yuv.rs:261-270 — before extracting anything, compare `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs` and `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 334 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:299` 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 × 6) doc/src/codegen/v2/lang_ada/types.rs:562 — doc/src/codegen/v2/lang_ada/types.rs:562-571 | doc/src/codegen/v2/lang_csharp/types.rs:800-809 | doc/src/codegen/v2/lang_java/types.rs:1048-1057 | doc/src/codegen/v2/lang_kotlin/mod.rs:1268-1277 | doc/src/codegen/v2/lang_ocaml/types.rs:964-973 | doc/src/codegen/v2/lang_smalltalk/types.rs:411-420 — `doc/src/codegen/v2/lang_ada/types.rs` and `doc/src/codegen/v2/lang_ocaml/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 40 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 6) webrender/swgl/src/shaders/cs_border_segment.rs:265 — webrender/swgl/src/shaders/cs_border_segment.rs:265-275 | webrender/swgl/src/shaders/cs_border_solid.rs:192-201 | webrender/swgl/src/shaders/cs_conic_gradient.rs:134-143 | webrender/swgl/src/shaders/cs_fast_linear_gradient.rs:127-137 | webrender/swgl/src/shaders/cs_linear_gradient.rs:127-137 | webrender/swgl/src/shaders/cs_radial_gradient.rs:152-162 — before extracting anything, compare `webrender/swgl/src/shaders/cs_border_segment.rs` and `webrender/swgl/src/shaders/cs_border_solid.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `_context` to `&mut ShaderContext` in one and `&ShaderContext` 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 (8–10 lines × 3) · ×3
  • Duplicated block (8–10 lines × 3) dll/src/desktop/shell2/windows/mod.rs:4729 — dll/src/desktop/shell2/windows/mod.rs:4729-4736 | dll/src/desktop/shell2/windows/mod.rs:4968-4977 | dll/src/desktop/shell2/windows/mod.rs:5060-5069 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/windows/mod.rs:4968` it does not close everything it opens, so those 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–10 lines × 3) webrender/core/src/picture.rs:1918 — webrender/core/src/picture.rs:1918-1927 | webrender/core/src/picture.rs:2357-2364 | webrender/core/src/picture.rs:2454-2461 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/core/src/picture.rs:1918` it does not close everything it opens, so those exact lines 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–10 lines × 3) webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:249 — webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:249-256 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:245-252 | webrender/swgl/src/shaders/brush_image_texture_rect.rs:187-196 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs` and `webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 392 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (7–10 lines × 2) · ×3
  • Duplicated block (7–10 lines × 2) doc/src/api.rs:2011 — doc/src/api.rs:2011-2020 | doc/src/api.rs:2283-2289 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/api.rs:2011` it does not close everything it opens, so those 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, `doc/src/api.rs:2291` calls `contains` and `doc/src/api.rs:2022` 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–10 lines × 2) doc/src/codegen/v2/transmute_helpers.rs:406 — doc/src/codegen/v2/transmute_helpers.rs:406-415 | doc/src/codegen/v2/transmute_helpers.rs:428-434 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/transmute_helpers.rs:406` it does not close everything it opens, so those exact lines 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–10 lines × 2) doc/src/reftest/autoreview.rs:1122 — doc/src/reftest/autoreview.rs:1122-1128 | doc/src/reftest/autoreview.rs:1558-1567 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/reftest/autoreview.rs:1558` 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 × 2) · ×3
  • Duplicated block (7–9 lines × 2) dll/src/desktop/shell2/common/layout.rs:561 — dll/src/desktop/shell2/common/layout.rs:561-567 | dll/src/desktop/shell2/common/layout.rs:1135-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.
  • Duplicated block (7–9 lines × 2) doc/src/codegen/v2/rust/dynamic_binding.rs:400 — doc/src/codegen/v2/rust/dynamic_binding.rs:400-406 | doc/src/codegen/v2/rust/static_binding.rs:470-478 — before extracting anything, compare `doc/src/codegen/v2/rust/dynamic_binding.rs` and `doc/src/codegen/v2/rust/static_binding.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/rust/static_binding.rs:470` it does not close everything it opens, so those 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–9 lines × 2) layout/src/cpurender/svg.rs:61 — layout/src/cpurender/svg.rs:61-69 | layout/src/cpurender/svg.rs:126-132 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/cpurender/svg.rs:61` it does not close everything it opens, so those 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 × 9) · ×3
  • Duplicated block (8 lines × 9) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:253 — webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:253-261 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:252-261 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:241-248 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:247-254 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:225-233 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:163-172 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:157-166 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:250-257 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:246-253 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs` and `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 439 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 9) webrender/swgl/src/shaders/brush_blend_alpha_pass.rs:96 — webrender/swgl/src/shaders/brush_blend_alpha_pass.rs:96-103 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:99-106 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:99-106 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:90-97 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:90-97 | webrender/swgl/src/shaders/brush_image_texture_2d.rs:87-94 | webrender/swgl/src/shaders/brush_linear_gradient.rs:97-104 | webrender/swgl/src/shaders/brush_linear_gradient_alpha_pass.rs:98-105 | webrender/swgl/src/shaders/brush_mix_blend_alpha_pass.rs:114-121 — before extracting anything, compare `webrender/swgl/src/shaders/brush_blend_alpha_pass.rs` and `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 157 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_blend_alpha_pass.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. Note first that the copies are not typed on the same thing: the declarations holding them bind `context` to `&mut ShaderContext` in one and `&ShaderContext` 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 × 9) webrender/swgl/src/shaders/brush_linear_gradient.rs:252 — webrender/swgl/src/shaders/brush_linear_gradient.rs:252-259 | webrender/swgl/src/shaders/brush_linear_gradient_alpha_pass.rs:268-275 | webrender/swgl/src/shaders/cs_border_segment.rs:415-422 | webrender/swgl/src/shaders/cs_border_solid.rs:301-308 | webrender/swgl/src/shaders/cs_conic_gradient.rs:189-196 | webrender/swgl/src/shaders/cs_fast_linear_gradient.rs:169-176 | webrender/swgl/src/shaders/cs_linear_gradient.rs:182-189 | webrender/swgl/src/shaders/cs_radial_gradient.rs:207-214 | webrender/swgl/src/shaders/ps_quad_radial_gradient.rs:264-271 — before extracting anything, compare `webrender/swgl/src/shaders/brush_linear_gradient.rs` and `webrender/swgl/src/shaders/brush_linear_gradient_alpha_pass.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 218 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (5 lines × 8) · ×3
  • Duplicated block (5 lines × 8) dll/src/desktop/extra/file_picker/android.rs:140 — dll/src/desktop/extra/file_picker/android.rs:140-144 | dll/src/desktop/shell2/android/clipboard.rs:127-132 | dll/src/desktop/shell2/android/clipboard.rs:184-189 | dll/src/desktop/shell2/android/mod.rs:2396-2401 | dll/src/desktop/shell2/android/mod.rs:2458-2463 | dll/src/desktop/shell2/android/mod.rs:2524-2529 | dll/src/desktop/shell2/android/mod.rs:2905-2909 | dll/src/desktop/shell2/android/mod.rs:3114-3119 — before extracting anything, compare `dll/src/desktop/shell2/android/clipboard.rs` and `dll/src/desktop/shell2/android/mod.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 × 8) dll/src/desktop/extra/file_picker/android.rs:141 — dll/src/desktop/extra/file_picker/android.rs:141-145 | dll/src/desktop/extra/media_keys/android.rs:143-148 | dll/src/desktop/shell2/android/clipboard.rs:128-133 | dll/src/desktop/shell2/android/clipboard.rs:185-190 | dll/src/desktop/shell2/android/mod.rs:2397-2402 | dll/src/desktop/shell2/android/mod.rs:2459-2464 | dll/src/desktop/shell2/android/mod.rs:2525-2530 | dll/src/desktop/shell2/android/mod.rs:3115-3120 — before extracting anything, compare `dll/src/desktop/shell2/android/clipboard.rs` and `dll/src/desktop/shell2/android/mod.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/extra/file_picker/android.rs:141` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 × 8) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:402 — webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:402-406 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:401-407 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:390-396 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:328-334 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:396-400 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:356-362 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:344-350 | webrender/swgl/src/shaders/brush_image_texture_rect.rs:274-281 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs` and `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 439 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D5 · Coupling · Off the main sequence · ×3
  • Off the main sequence: webrender_build — webrender_build: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: azul-css — azul-css: abstractness 0.02, instability 0.00, distance 0.98 — zone of pain — concrete and depended on by 6 project(s), so it's rigid to change.
  • Off the main sequence: azul-core — azul-core: abstractness 0.02, instability 0.14, distance 0.84 — zone of pain — concrete and depended on by 6 project(s), so it's rigid to change.
R10 · Code Duplication · Duplicated block (8 lines × 2 locations) · ×3
  • Duplicated block (8 lines × 2 locations) dll/src/desktop/shell2/common/debugger/debugger.js:1442 — dll/src/desktop/shell2/common/debugger/debugger.js:1442 · dll/src/desktop/shell2/common/debugger/debugger.js:1463 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (8 lines × 2 locations) dll/src/desktop/shell2/common/debugger/debugger.js:2915 — dll/src/desktop/shell2/common/debugger/debugger.js:2915 · dll/src/desktop/shell2/common/debugger/debugger.js:2964 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (8 lines × 2 locations) dll/src/desktop/shell2/common/debugger/debugger.js:3352 — dll/src/desktop/shell2/common/debugger/debugger.js:3352 · dll/src/desktop/shell2/common/debugger/debugger.js:3389 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D1 · Cyclomatic Complexity · RenderTask · ×2
  • RenderTask::new_svg_filter_graph (cyclomatic 134) webrender/core/src/render_task.rs:1643 — RenderTask::new_svg_filter_graph has cyclomatic complexity 134 (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.
  • RenderTask::new_svg_filter (cyclomatic 17) webrender/core/src/render_task.rs:1297 — RenderTask::new_svg_filter 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: RenderTaskKind::as_str (cyclomatic 22) 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 · PicturePrimitive · ×2
  • PicturePrimitive::take_context (cyclomatic 84) webrender/core/src/picture.rs:5302 — PicturePrimitive::take_context has cyclomatic complexity 84 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • PicturePrimitive::prepare_for_render (cyclomatic 19) webrender/core/src/picture.rs:7265 — PicturePrimitive::prepare_for_render 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. This is NOT this file's highest cyclomatic complexity: PictureCompositeMode::kind (cyclomatic 24) 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 · A11yManager · ×2
  • A11yManager::build_node (cyclomatic 62) layout/src/managers/a11y.rs:851 — A11yManager::build_node has cyclomatic complexity 62 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: A11yManager::node_type_to_role (cyclomatic 74) 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.
  • A11yManager::update_tree (cyclomatic 34) layout/src/managers/a11y.rs:470 — A11yManager::update_tree has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: A11yManager::node_type_to_role (cyclomatic 74) 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 · Device · ×2
  • Device::new (cyclomatic 55) webrender/core/src/device/gl.rs:1440 — Device::new has cyclomatic complexity 55 (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.
  • Device::link_program (cyclomatic 18) webrender/core/src/device/gl.rs:2444 — Device::link_program 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 · LayoutTreeBuilder · ×2
  • LayoutTreeBuilder::process_node (cyclomatic 41) layout/src/solver3/layout_tree.rs:2062 — LayoutTreeBuilder::process_node has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • LayoutTreeBuilder::apply_split_previews (cyclomatic 16) layout/src/solver3/layout_tree.rs:2976 — LayoutTreeBuilder::apply_split_previews has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: azul_layout::solver3::layout_tree::determine_formatting_context_for_display (cyclomatic 20) 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 · UnifiedLayout · ×2
  • UnifiedLayout::get_selection_rects (cyclomatic 36) layout/src/text3/cache.rs:5767 — UnifiedLayout::get_selection_rects has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • UnifiedLayout::move_cursor_to_prev_word (cyclomatic 16) layout/src/text3/cache.rs:6604 — UnifiedLayout::move_cursor_to_prev_word 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 · CssPropertyWithConditionsVec · ×2
  • CssPropertyWithConditionsVec::parse_at_rule (cyclomatic 34) css/src/dynamic_selector.rs:2260 — CssPropertyWithConditionsVec::parse_at_rule has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • CssPropertyWithConditionsVec::parse_media_query (cyclomatic 16) css/src/dynamic_selector.rs:2419 — CssPropertyWithConditionsVec::parse_media_query has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: azul_css::dynamic_selector::parse_android_version (cyclomatic 24) 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 · IntrinsicSizeCalculator · ×2
  • IntrinsicSizeCalculator::calculate_node_intrinsic_sizes (cyclomatic 29) layout/src/solver3/sizing.rs:512 — IntrinsicSizeCalculator::calculate_node_intrinsic_sizes 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.
  • IntrinsicSizeCalculator::calculate_intrinsic_recursive (cyclomatic 25) layout/src/solver3/sizing.rs:279 — IntrinsicSizeCalculator::calculate_intrinsic_recursive 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 · SvgNodeData · ×2
  • SvgNodeData::eq (cyclomatic 25) core/src/dom.rs:1946 — SvgNodeData::eq has cyclomatic complexity 25 (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: NodeType::to_library_owned_nodetype (cyclomatic 184) 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.
  • SvgNodeData::hash (cyclomatic 17) core/src/dom.rs:2143 — SvgNodeData::hash 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: NodeType::to_library_owned_nodetype (cyclomatic 184) 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 · Shaders · ×2
  • Shaders::new (cyclomatic 22) webrender/core/src/renderer/shade.rs:630 — Shaders::new 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.
  • Shaders::get (cyclomatic 21) webrender/core/src/renderer/shade.rs:1182 — Shaders::get 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 · SpatialNode · ×2
  • SpatialNode::calculate_sticky_offset (cyclomatic 21) webrender/core/src/spatial_node.rs:607 — SpatialNode::calculate_sticky_offset 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.
  • SpatialNode::update_transform (cyclomatic 19) webrender/core/src/spatial_node.rs:370 — SpatialNode::update_transform 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 · SymbolCollector · ×2
  • SymbolCollector::visit_item_fn (cyclomatic 20) doc/src/patch/parser.rs:279 — SymbolCollector::visit_item_fn 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.
  • SymbolCollector::visit_impl_item_fn (cyclomatic 19) doc/src/patch/parser.rs:401 — SymbolCollector::visit_impl_item_fn 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 · CGenerator · ×2
  • CGenerator::generate_types (cyclomatic 18) doc/src/codegen/v2/lang_c.rs:203 — CGenerator::generate_types 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: CGenerator::rust_type_to_c (cyclomatic 31) 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.
  • CGenerator::generate_function_declaration (cyclomatic 18) doc/src/codegen/v2/lang_c.rs:869 — CGenerator::generate_function_declaration 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. This is NOT this file's highest cyclomatic complexity: CGenerator::rust_type_to_c (cyclomatic 31) 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 · A11yManager · ×2
  • A11yManager::update_tree (cognitive 104) layout/src/managers/a11y.rs:470 — A11yManager::update_tree has cognitive complexity 104 (threshold 15). Drivers by points: if/else 26 (82 pts), loops 6 (12 pts), match/switch 2 (7 pts), boolean chains 3 (nesting depth added 67). 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.
  • A11yManager::build_node (cognitive 54) layout/src/managers/a11y.rs:851 — A11yManager::build_node has cognitive complexity 54 (threshold 15). Drivers by points: if/else 23 (33 pts), match/switch 6 (13 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TileNode · ×2
  • TileNode::maybe_merge_or_split (cognitive 57) webrender/core/src/picture.rs:7714 — TileNode::maybe_merge_or_split has cognitive complexity 57 (threshold 15). Drivers by points: if/else 12 (33 pts), loops 5 (13 pts), match/switch 5 (10 pts), boolean chains 1 (nesting depth added 34). Of this number, 55 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.
  • TileNode::update_dirty_rects (cognitive 21) webrender/core/src/picture.rs:7886 — TileNode::update_dirty_rects has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (5 pts), match/switch 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ParsedFont · ×2
  • ParsedFont::from_provider (cognitive 54) layout/src/font.rs:1011 — ParsedFont::from_provider has cognitive complexity 54 (threshold 15). Drivers by points: if/else 26 (42 pts), loops 2 (6 pts), match/switch 3 (4 pts), boolean chains 2 (nesting depth added 21). Of this number, 48 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ParsedFont::decode_glyph_inner (cognitive 48) layout/src/font.rs:1792 — ParsedFont::decode_glyph_inner has cognitive complexity 48 (threshold 15). Drivers by points: if/else 14 (48 pts) (nesting depth added 34). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Cpp17Generator · ×2
  • Cpp17Generator::generate_method_implementations (cognitive 48) doc/src/codegen/v2/lang_cpp/cpp17.rs:277 — Cpp17Generator::generate_method_implementations has cognitive complexity 48 (threshold 15). Drivers by points: if/else 22 (39 pts), boolean chains 6, loops 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Cpp17Generator::generate_method_declarations (cognitive 17) doc/src/codegen/v2/lang_cpp/cpp17.rs:804 — Cpp17Generator::generate_method_declarations has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 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 · SpatialNode · ×2
  • SpatialNode::update_transform (cognitive 45) webrender/core/src/spatial_node.rs:370 — SpatialNode::update_transform has cognitive complexity 45 (threshold 15). Drivers by points: if/else 11 (27 pts), match/switch 6 (14 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • SpatialNode::calculate_sticky_offset (cognitive 28) webrender/core/src/spatial_node.rs:607 — SpatialNode::calculate_sticky_offset has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Shaders · ×2
  • Shaders::new (cognitive 34) webrender/core/src/renderer/shade.rs:630 — Shaders::new has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (23 pts), loops 6, boolean chains 5 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Shaders::get (cognitive 25) webrender/core/src/renderer/shade.rs:1182 — Shaders::get has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 4 (8 pts), boolean chains 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · MultiCursorState · ×2
  • MultiCursorState::move_all_cursors_with (cognitive 31) core/src/selection.rs:893 — MultiCursorState::move_all_cursors_with has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (28 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • MultiCursorState::merge_overlapping (cognitive 23) core/src/selection.rs:734 — MultiCursorState::merge_overlapping has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LayoutTree · ×2
  • LayoutTree::memory_report (cognitive 31) layout/src/solver3/layout_tree.rs:1418 — LayoutTree::memory_report has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 4 (9 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.
  • LayoutTree::get_ifc_root_layout_index (cognitive 17) layout/src/solver3/layout_tree.rs:1842 — LayoutTree::get_ifc_root_layout_index has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 1 (4 pts), loops 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GlyphCache · ×2
  • GlyphCache::get_or_build_cells (cognitive 27) layout/src/glyph_cache.rs:331 — GlyphCache::get_or_build_cells has cognitive complexity 27 (threshold 15). Drivers by points: if/else 19 (24 pts), boolean chains 3 (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.
  • GlyphCache::get_or_build_cells_lcd (cognitive 19) layout/src/glyph_cache.rs:496 — GlyphCache::get_or_build_cells_lcd has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (18 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.
D2 · Cognitive Complexity · SmartCtor · ×2
  • SmartCtor::build (cognitive 25) doc/src/codegen/v2/lang_ocaml/wrappers.rs:885 — SmartCtor::build has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (3 pts), boolean chains 2, match/switch 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.
  • SmartCtor::emit_implementation (cognitive 19) doc/src/codegen/v2/lang_ocaml/wrappers.rs:1013 — SmartCtor::emit_implementation has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 5 (8 pts), if/else 5 (7 pts), loops 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GpuCacheTexture · ×2
  • GpuCacheTexture::update (cognitive 23) webrender/core/src/renderer/gpu_cache.rs:269 — GpuCacheTexture::update has cognitive complexity 23 (threshold 15). Drivers by points: loops 5 (16 pts), match/switch 3 (7 pts) (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • GpuCacheTexture::ensure_texture (cognitive 20) webrender/core/src/renderer/gpu_cache.rs:98 — GpuCacheTexture::ensure_texture has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 1 (4 pts), boolean chains 3, match/switch 1 (3 pts) (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 · FontManager · ×2
  • FontManager::register_variable_instances (cognitive 19) layout/src/text3/cache.rs:1562 — FontManager::register_variable_instances has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • FontManager::register_named_font_in_tier (cognitive 17) layout/src/text3/cache.rs:1425 — FontManager::register_named_font_in_tier has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D3 · God Classes · TooManyFunctions · ×2
  • TooManyFunctions: azul_layout::widgets::capture_common layout/src/widgets/capture_common.rs:63 — TooManyFunctions — 40 free functions. The bar is 30 free functions; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyFunctions: azul_layout::text3::script layout/src/text3/script.rs:133 — TooManyFunctions — 33 free functions. The bar is 30 free functions; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D35 · Change Coupling · Change coupling · ×2
  • Change coupling: prop_cache.rs ↔ macros.rs core/src/prop_cache.rs:1 — `core/src/prop_cache.rs` and `css/src/props/macros.rs` change together 58% of the time (22 of the 38 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 22 shared commits counted here, the most recent 3 are `87739d23` feat(css): 9a-i-b - spatial-navigation-contain and spatial-navigation…; `3f9de5fc` feat(css): wire overscroll-behavior end to end, so overscroll can be …; `d51fa6e8` feat(css): -azul-app-region, the real property, and native window grabs — run `git show` on any of them.
  • Change coupling: tabs.rs ↔ text_input.rs layout/src/widgets/tabs.rs:1 — `layout/src/widgets/tabs.rs` and `layout/src/widgets/text_input.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 — 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 `3964e334` fix(widgets): flex properties do nothing without `display: flex`; `a81aa6cc` ffi: roll impl_managed_callback! to 16 widget callbacks + internals doc; `294043c8` refactor(dropdown): rewrite with clean CSS + builder API, system:ui f… — run `git show` on any of them.
D36 · Supply-chain Provenance & Signing · REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (3 members, 21 shared lines) · ×2
  • Near-duplicate member family (3 members, 21 shared lines) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:336 — webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:336-365 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:345-374 | webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:299-328 — These 3 members are variants of one another: a block of 21 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
  • Near-duplicate member family (3 members, 21 shared lines) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:339 — webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:339-368 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:338-367 | webrender/swgl/src/shaders/composite_texture_rect_yuv.rs:297-326 — These 3 members are variants of one another: a block of 21 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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 (67 shared lines) · ×2
  • Near-duplicate member pair (67 shared lines) dll/src/desktop/shell2/linux/wayland/mod.rs:2971 — dll/src/desktop/shell2/linux/wayland/mod.rs:2971-3294 | dll/src/desktop/shell2/linux/x11/mod.rs:4486-4758 — These two members are variants of one another: 67 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
  • Near-duplicate member pair (67 shared lines) layout/src/widgets/themes/flat.rs:1469 — layout/src/widgets/themes/flat.rs:1469-1588 | layout/src/widgets/themes/flora.rs:1876-2007 — These two members are variants of one another: 67 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (58 shared lines) · ×2
  • Near-duplicate member pair (58 shared lines) doc/src/reftest/autoreview.rs:1441 — doc/src/reftest/autoreview.rs:1441-1534 | doc/src/reftest/autoreview.rs:1970-2114 — These two members are variants of one another: 58 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
  • Near-duplicate member pair (58 shared lines) doc/src/codegen/v2/lang_php/wrappers.rs:109 — doc/src/codegen/v2/lang_php/wrappers.rs:109-226 | doc/src/codegen/v2/lang_php/wrappers.rs:232-412 — These two members are variants of one another: 58 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (57 shared lines) · ×2
  • Near-duplicate member pair (57 shared lines) dll/src/desktop/tray/linux.rs:422 — dll/src/desktop/tray/linux.rs:422-547 | dll/src/desktop/tray/linux.rs:782-1007 — These two members are variants of one another: 57 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
  • Near-duplicate member pair (57 shared lines) doc/src/autofix/diff.rs:554 — doc/src/autofix/diff.rs:554-697 | doc/src/autofix/diff.rs:2211-2292 — These two members are variants of one another: 57 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (51 shared lines) · ×2
  • Near-duplicate member pair (51 shared lines) doc/src/codegen/v2/lang_d/model.rs:245 — doc/src/codegen/v2/lang_d/model.rs:245-492 | doc/src/codegen/v2/lang_swift/model.rs:254-471 — These two members are variants of one another: 51 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
  • Near-duplicate member pair (51 shared lines) layout/src/text3/cache.rs:6284 — layout/src/text3/cache.rs:6284-6366 | layout/src/text3/cache.rs:6374-6455 — These two members are variants of one another: 51 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (45 shared lines) · ×2
  • Near-duplicate member pair (45 shared lines) doc/src/codegen/v2/lang_java/wrappers.rs:1737 — doc/src/codegen/v2/lang_java/wrappers.rs:1737-1827 | doc/src/codegen/v2/lang_java/wrappers.rs:1869-1926 — These two members are variants of one another: 45 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
  • Near-duplicate member pair (45 shared lines) layout/src/widgets/text_area.rs:712 — layout/src/widgets/text_area.rs:712-819 | layout/src/widgets/text_input.rs:1092-1216 — These two members are variants of one another: 45 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (40 shared lines) · ×2
  • Near-duplicate member pair (40 shared lines) dll/src/desktop/shell2/android/mod.rs:2675 — dll/src/desktop/shell2/android/mod.rs:2675-2824 | dll/src/desktop/shell2/android/mod.rs:2975-3091 — These two members are variants of one another: 40 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
  • Near-duplicate member pair (40 shared lines) doc/src/codegen/v2/lang_cpp/common.rs:517 — doc/src/codegen/v2/lang_cpp/common.rs:517-570 | doc/src/codegen/v2/lang_cpp/common.rs:929-988 — These two members are variants of one another: 40 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Members sharing a duplicated core (36 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (36 members, 50+ identical tokens) webrender/swgl/src/shaders/brush_blend.rs:41 — webrender/swgl/src/shaders/brush_blend.rs:41-57 | webrender/swgl/src/shaders/brush_blend_alpha_pass.rs:41-49 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:38-54 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:39-55 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:41-49 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:39-55 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:38-46 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:41-49 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:38-46 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:38-46 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:35-51 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:35-51 | webrender/swgl/src/shaders/brush_image_texture_2d.rs:35-43 | webrender/swgl/src/shaders/brush_image_texture_rect.rs:37-53 | webrender/swgl/src/shaders/brush_linear_gradient.rs:37-45 | webrender/swgl/src/shaders/brush_linear_gradient_alpha_pass.rs:38-46 | webrender/swgl/src/shaders/brush_mix_blend.rs:191-199 | webrender/swgl/src/shaders/brush_mix_blend_alpha_pass.rs:58-66 | webrender/swgl/src/shaders/brush_opacity.rs:35-51 | webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs:36-52 | webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs:34-50 | webrender/swgl/src/shaders/brush_opacity_antialiasing.rs:35-51 | webrender/swgl/src/shaders/brush_solid.rs:39-55 | webrender/swgl/src/shaders/brush_solid_alpha_pass.rs:33-49 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:70-78 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:78-86 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:88-96 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:79-95 | webrender/swgl/src/shaders/ps_quad_conic_gradient.rs:54-62 | webrender/swgl/src/shaders/ps_quad_radial_gradient.rs:40-48 | webrender/swgl/src/shaders/ps_quad_textured.rs:91-99 | webrender/swgl/src/shaders/ps_split_composite.rs:38-46 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs:62-70 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_texture_2d.rs:38-46 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_glyph_transform_texture_2d.rs:38-54 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_texture_2d.rs:64-72 — These 36 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 36 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 36 times.
  • Members sharing a duplicated core (36 members, 50+ identical tokens) webrender/swgl/src/shaders/brush_blend.rs:526 — webrender/swgl/src/shaders/brush_blend.rs:526-536 | webrender/swgl/src/shaders/brush_blend_alpha_pass.rs:470-480 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:528-538 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:531-541 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:522-532 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:455-465 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:506-516 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:463-473 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:399-409 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:384-394 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:457-467 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:445-455 | webrender/swgl/src/shaders/brush_image_texture_2d.rs:316-326 | webrender/swgl/src/shaders/brush_image_texture_rect.rs:376-386 | webrender/swgl/src/shaders/brush_linear_gradient.rs:345-356 | webrender/swgl/src/shaders/brush_linear_gradient_alpha_pass.rs:361-372 | webrender/swgl/src/shaders/brush_mix_blend.rs:475-486 | webrender/swgl/src/shaders/brush_mix_blend_alpha_pass.rs:440-451 | webrender/swgl/src/shaders/brush_opacity.rs:281-291 | webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs:381-391 | webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs:363-373 | webrender/swgl/src/shaders/brush_opacity_antialiasing.rs:345-355 | webrender/swgl/src/shaders/brush_solid.rs:280-289 | webrender/swgl/src/shaders/brush_solid_alpha_pass.rs:264-287 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:507-519 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:492-504 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:466-478 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:441-453 | webrender/swgl/src/shaders/cs_blur_alpha_target.rs:360-370 | webrender/swgl/src/shaders/cs_blur_color_target.rs:325-335 | webrender/swgl/src/shaders/cs_svg_filter_node.rs:463-474 | webrender/swgl/src/shaders/ps_split_composite.rs:311-321 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs:368-378 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_texture_2d.rs:311-321 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_glyph_transform_texture_2d.rs:326-336 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_texture_2d.rs:369-379 — These 36 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 36 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 36 times.
D4 · Code Duplication · Members sharing a duplicated core (30 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (30 members, 50+ identical tokens) webrender/swgl/src/shaders/brush_blend.rs:82 — webrender/swgl/src/shaders/brush_blend.rs:82-89 | webrender/swgl/src/shaders/brush_blend_alpha_pass.rs:74-81 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:76-84 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:78-86 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:75-83 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:78-86 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:69-77 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:75-83 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:68-76 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:68-76 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:74-82 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:74-82 | webrender/swgl/src/shaders/brush_image_texture_2d.rs:65-73 | webrender/swgl/src/shaders/brush_image_texture_rect.rs:75-82 | webrender/swgl/src/shaders/brush_linear_gradient.rs:75-82 | webrender/swgl/src/shaders/brush_linear_gradient_alpha_pass.rs:76-83 | webrender/swgl/src/shaders/brush_mix_blend.rs:226-233 | webrender/swgl/src/shaders/brush_mix_blend_alpha_pass.rs:92-99 | webrender/swgl/src/shaders/brush_opacity.rs:73-81 | webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs:74-82 | webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs:72-80 | webrender/swgl/src/shaders/brush_opacity_antialiasing.rs:73-81 | webrender/swgl/src/shaders/brush_solid.rs:81-89 | webrender/swgl/src/shaders/brush_solid_alpha_pass.rs:68-76 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:107-114 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:115-122 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:125-132 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:124-131 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs:98-179 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_texture_2d.rs:71-137 — These 30 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 30 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 30 times.
  • Members sharing a duplicated core (30 members, 50+ identical tokens) webrender/swgl/src/shaders/brush_blend.rs:453 — webrender/swgl/src/shaders/brush_blend.rs:453-462 | webrender/swgl/src/shaders/brush_blend_alpha_pass.rs:402-411 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:433-442 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:435-444 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:424-433 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:363-372 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:437-446 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:393-402 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:313-324 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:301-310 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:378-387 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:366-375 | webrender/swgl/src/shaders/brush_image_texture_2d.rs:242-251 | webrender/swgl/src/shaders/brush_image_texture_rect.rs:297-308 | webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs:296-307 | webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs:282-293 | webrender/swgl/src/shaders/brush_opacity_antialiasing.rs:267-276 | webrender/swgl/src/shaders/composite_fast_path_texture_2d.rs:177-186 | webrender/swgl/src/shaders/composite_fast_path_texture_rect.rs:167-176 | webrender/swgl/src/shaders/composite_texture_2d.rs:192-201 | webrender/swgl/src/shaders/composite_texture_rect.rs:200-209 | webrender/swgl/src/shaders/cs_blur_alpha_target.rs:280-289 | webrender/swgl/src/shaders/cs_scale_texture_2d.rs:174-183 | webrender/swgl/src/shaders/cs_scale_texture_rect.rs:186-195 | webrender/swgl/src/shaders/ps_copy.rs:155-166 | webrender/swgl/src/shaders/ps_split_composite.rs:235-244 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs:287-297 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_texture_2d.rs:226-235 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_glyph_transform_texture_2d.rs:248-257 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_texture_2d.rs:286-296 — These 30 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 30 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 30 times.
D4 · Code Duplication · Members sharing a duplicated core (11 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (11 members, 50+ identical tokens) dll/src/desktop/shell2/macos/mod.rs:265 — dll/src/desktop/shell2/macos/mod.rs:265-323 | dll/src/desktop/shell2/macos/mod.rs:325-369 | dll/src/desktop/shell2/macos/mod.rs:371-398 | dll/src/desktop/shell2/macos/mod.rs:400-428 | dll/src/desktop/shell2/macos/mod.rs:657-695 | dll/src/desktop/shell2/macos/mod.rs:697-725 | dll/src/desktop/shell2/macos/mod.rs:727-755 | dll/src/desktop/shell2/macos/mod.rs:757-784 | dll/src/desktop/shell2/macos/mod.rs:786-813 | dll/src/desktop/shell2/macos/mod.rs:815-842 | dll/src/desktop/shell2/macos/mod.rs:879-899 — These 11 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 11 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 11 times.
  • Members sharing a duplicated core (11 members, 50+ identical tokens) doc/src/codegen/v2/lang_ada/mod.rs:188 — doc/src/codegen/v2/lang_ada/mod.rs:188-235 | doc/src/codegen/v2/lang_algol68/mod.rs:345-394 | doc/src/codegen/v2/lang_cobol/types.rs:501-573 | doc/src/codegen/v2/lang_freebasic/mod.rs:117-186 | doc/src/codegen/v2/lang_haskell/types.rs:1082-1129 | doc/src/codegen/v2/lang_nim/mod.rs:146-213 | doc/src/codegen/v2/lang_nim/mod.rs:217-235 | doc/src/codegen/v2/lang_ocaml/mod.rs:891-945 | doc/src/codegen/v2/lang_pascal/mod.rs:228-307 | doc/src/codegen/v2/lang_smalltalk/mod.rs:148-198 | doc/src/codegen/v2/lang_vb6/mod.rs:197-262 — These 11 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 11 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 11 times.
D4 · Code Duplication · Edited copy of a member (112 corresponding lines) · ×2
  • Edited copy of a member (112 corresponding lines) core/src/diff.rs:365 — core/src/diff.rs:365-476 | core/src/diff.rs:1430-1542 — These two members are one piece of code written twice and then edited apart: 112 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (112 corresponding lines) doc/src/autofix/type_resolver.rs:434 — doc/src/autofix/type_resolver.rs:434-545 | doc/src/autofix/type_resolver.rs:739-867 — These two members are one piece of code written twice and then edited apart: 112 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (5 members, 1+ corresponding lines) · ×2
  • Edited copies of one member (5 members, 1+ corresponding lines) core/src/db.rs:739 — core/src/db.rs:739-739 | layout/src/widgets/text_area.rs:286-286 | layout/src/widgets/text_area.rs:311-311 | layout/src/widgets/text_input.rs:600-600 | layout/src/widgets/text_input.rs:623-623 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 1 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, 1+ corresponding lines) core/src/callbacks.rs:255 — core/src/callbacks.rs:255-255 | core/src/db.rs:739-739 | core/src/events.rs:4540-4540 | core/src/xml.rs:2473-2473 | layout/src/solver3/pagination.rs:93-93 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 1 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (80 corresponding lines) · ×2
  • Edited copy of a member (80 corresponding lines) doc/src/codegen/v2/lang_java/types.rs:802 — doc/src/codegen/v2/lang_java/types.rs:802-883 | doc/src/codegen/v2/lang_kotlin/mod.rs:843-922 — These two members are one piece of code written twice and then edited apart: 80 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (80 corresponding lines) core/src/gpu.rs:327 — core/src/gpu.rs:327-406 | core/src/gpu.rs:430-509 — These two members are one piece of code written twice and then edited apart: 80 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (81 corresponding lines) · ×2
  • Edited copy of a member (81 corresponding lines) doc/src/codegen/v2/lang_swift/wrappers.rs:1026 — doc/src/codegen/v2/lang_swift/wrappers.rs:1026-1106 | doc/src/codegen/v2/lang_swift/wrappers.rs:3146-3244 — These two members are one piece of code written twice and then edited apart: 81 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (81 corresponding lines) doc/src/reftest/autodebug.rs:1991 — doc/src/reftest/autodebug.rs:1991-2082 | doc/src/reftest/autoreview.rs:1219-1299 — These two members are one piece of code written twice and then edited apart: 81 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (63 corresponding lines) · ×2
  • Edited copy of a member (63 corresponding lines) layout/src/widgets/themes/flat.rs:1718 — layout/src/widgets/themes/flat.rs:1718-1780 | layout/src/widgets/themes/flora.rs:2136-2198 — These two members are one piece of code written twice and then edited apart: 63 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (63 corresponding lines) dll/src/desktop/extra/video_codec/mod.rs:203 — dll/src/desktop/extra/video_codec/mod.rs:203-266 | dll/src/desktop/extra/video_codec/mod.rs:596-658 — These two members are one piece of code written twice and then edited apart: 63 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (61 corresponding lines) · ×2
  • Edited copy of a member (61 corresponding lines) dll/src/web/symbol_table.rs:513 — dll/src/web/symbol_table.rs:513-573 | dll/src/web/transpiler_remill.rs:5151-5265 — These two members are one piece of code written twice and then edited apart: 61 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (61 corresponding lines) doc/src/codegen/v2/lang_nim/types.rs:325 — doc/src/codegen/v2/lang_nim/types.rs:325-385 | doc/src/codegen/v2/lang_racket/types.rs:180-249 — These two members are one piece of code written twice and then edited apart: 61 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (69 corresponding lines) · ×2
  • Edited copy of a member (69 corresponding lines) dll/src/desktop/shell2/headless/mod.rs:1680 — dll/src/desktop/shell2/headless/mod.rs:1680-1809 | dll/src/desktop/shell2/headless/mod.rs:1877-1945 — These two members are one piece of code written twice and then edited apart: 69 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (69 corresponding lines) layout/src/widgets/combobox.rs:417 — layout/src/widgets/combobox.rs:417-485 | layout/src/widgets/spinner.rs:93-165 — These two members are one piece of code written twice and then edited apart: 69 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (74 corresponding lines) · ×2
  • Edited copy of a member (74 corresponding lines) doc/src/codegen/v2/lang_java/wrappers.rs:1002 — doc/src/codegen/v2/lang_java/wrappers.rs:1002-1079 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:1457-1530 — These two members are one piece of code written twice and then edited apart: 74 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (74 corresponding lines) layout/src/widgets/themes/flat.rs:2086 — layout/src/widgets/themes/flat.rs:2086-2159 | layout/src/widgets/themes/flora.rs:2394-2473 — These two members are one piece of code written twice and then edited apart: 74 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) doc/src/codegen/v2/lang_csharp/wrappers.rs:222 — doc/src/codegen/v2/lang_csharp/wrappers.rs:222-290 | doc/src/codegen/v2/lang_csharp/wrappers.rs:297-351 — 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) layout/src/desktop/dialogs.rs:538 — layout/src/desktop/dialogs.rs:538-604 | layout/src/desktop/dialogs.rs:621-675 — 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 (41 corresponding lines) · ×2
  • Edited copy of a member (41 corresponding lines) layout/src/cpurender/pixmap.rs:1237 — layout/src/cpurender/pixmap.rs:1237-1277 | layout/src/xml/svg.rs:2021-2075 — 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) doc/src/codegen/v2/lang_c.rs:1140 — doc/src/codegen/v2/lang_c.rs:1140-1190 | doc/src/codegen/v2/lang_haskell/cshim.rs:478-518 — 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 (59 corresponding lines) · ×2
  • Edited copy of a member (59 corresponding lines) doc/src/codegen/v2/ir_builder.rs:1041 — doc/src/codegen/v2/ir_builder.rs:1041-1119 | doc/src/codegen/v2/ir_builder.rs:1151-1209 — 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.
  • Edited copy of a member (59 corresponding lines) css/src/props/basic/font.rs:801 — css/src/props/basic/font.rs:801-859 | layout/src/text3/default.rs:249-330 — 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 (3 members, 27+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 27+ corresponding lines) doc/src/codegen/v2/lang_crystal/wrappers.rs:1870 — doc/src/codegen/v2/lang_crystal/wrappers.rs:1870-1896 | doc/src/codegen/v2/lang_d/wrappers.rs:2839-2865 | doc/src/codegen/v2/lang_swift/wrappers.rs:3615-3650 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 27+ corresponding lines) dll/src/desktop/extra/file_picker/android.rs:156 — dll/src/desktop/extra/file_picker/android.rs:156-185 | dll/src/desktop/extra/file_picker/android.rs:199-228 | dll/src/desktop/extra/file_picker/android.rs:240-266 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (52 corresponding lines) · ×2
  • Edited copy of a member (52 corresponding lines) doc/src/autofix/type_index.rs:1244 — doc/src/autofix/type_index.rs:1244-1298 | doc/src/autofix/type_index.rs:3126-3177 — 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.
  • Edited copy of a member (52 corresponding lines) layout/src/widgets/check_box.rs:337 — layout/src/widgets/check_box.rs:337-388 | layout/src/widgets/switch.rs:386-445 — 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 (44 corresponding lines) · ×2
  • Edited copy of a member (44 corresponding lines) layout/src/widgets/date_picker.rs:782 — layout/src/widgets/date_picker.rs:782-825 | layout/src/widgets/time_picker.rs:583-639 — 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) layout/src/solver3/sizing.rs:2682 — layout/src/solver3/sizing.rs:2682-2725 | layout/src/solver3/sizing.rs:2741-2790 — 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 copies of one member (3 members, 24+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 24+ corresponding lines) doc/src/codegen/v2/lang_crystal/model.rs:546 — doc/src/codegen/v2/lang_crystal/model.rs:546-573 | doc/src/codegen/v2/lang_swift/model.rs:787-810 | doc/src/codegen/v2/lang_swift/model.rs:853-880 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 24+ corresponding lines) doc/src/codegen/v2/config.rs:544 — doc/src/codegen/v2/config.rs:544-567 | doc/src/codegen/v2/config.rs:570-594 | doc/src/codegen/v2/config.rs:597-621 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (37 corresponding lines) · ×2
  • Edited copy of a member (37 corresponding lines) doc/src/autofix/workspace.rs:1519 — doc/src/autofix/workspace.rs:1519-1556 | doc/src/autofix/workspace.rs:1565-1601 — 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) layout/src/window.rs:12496 — layout/src/window.rs:12496-12532 | layout/src/window.rs:18984-19026 — 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 (51 corresponding lines) · ×2
  • Edited copy of a member (51 corresponding lines) doc/src/codegen/v2/lang_freebasic/types.rs:41 — doc/src/codegen/v2/lang_freebasic/types.rs:41-91 | doc/src/codegen/v2/lang_vb6/types.rs:53-108 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (51 corresponding lines) doc/src/docgen/apidocs.rs:28 — doc/src/docgen/apidocs.rs:28-80 | doc/src/docgen/apidocs.rs:553-603 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 19+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 19+ corresponding lines) webrender/swgl/src/shaders/cs_clip_box_shadow_texture_2d.rs:231 — webrender/swgl/src/shaders/cs_clip_box_shadow_texture_2d.rs:231-249 | webrender/swgl/src/shaders/cs_clip_rectangle.rs:251-270 | webrender/swgl/src/shaders/cs_clip_rectangle_fast_path.rs:222-242 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:6325 — dll/src/desktop/shell2/linux/wayland/mod.rs:6325-6343 | dll/src/desktop/shell2/linux/x11/events.rs:1456-1474 | dll/src/desktop/shell2/macos/events.rs:1588-1607 — 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, 16+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 16+ corresponding lines) layout/src/widgets/ribbon.rs:1153 — layout/src/widgets/ribbon.rs:1153-1172 | layout/src/widgets/ribbon.rs:1252-1267 | layout/src/widgets/ribbon.rs:1413-1436 — 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) css/src/props/style/filter.rs:477 — css/src/props/style/filter.rs:477-492 | css/src/props/style/filter.rs:540-555 | css/src/props/style/filter.rs:611-629 — 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 (4 members, 17+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 17+ corresponding lines) doc/src/codegen/v2/lang_d/wrappers.rs:140 — doc/src/codegen/v2/lang_d/wrappers.rs:140-156 | doc/src/codegen/v2/lang_d/wrappers.rs:159-177 | doc/src/codegen/v2/lang_swift/wrappers.rs:101-118 | doc/src/codegen/v2/lang_swift/wrappers.rs:121-139 — 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) doc/src/codegen/v2/lang_algol68/functions.rs:42 — doc/src/codegen/v2/lang_algol68/functions.rs:42-62 | doc/src/codegen/v2/lang_lisp/functions.rs:29-46 | doc/src/codegen/v2/lang_node/functions.rs:31-47 | doc/src/codegen/v2/lang_racket/functions.rs:28-46 — 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 copies of one member (4 members, 18+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 18+ corresponding lines) doc/src/reftest/apply_midlevel.rs:2094 — doc/src/reftest/apply_midlevel.rs:2094-2113 | doc/src/reftest/apply_midlevel.rs:3563-3580 | doc/src/reftest/autodoc.rs:795-814 | doc/src/reftest/autoreview.rs:2646-2664 — 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.
  • Edited copies of one member (4 members, 18+ corresponding lines) layout/src/callbacks.rs:6746 — layout/src/callbacks.rs:6746-6763 | layout/src/callbacks.rs:6769-6786 | layout/src/callbacks.rs:6792-6810 | layout/src/callbacks.rs:6816-6834 — 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, 18+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 18+ corresponding lines) dll/src/desktop/extra/capability.rs:158 — dll/src/desktop/extra/capability.rs:158-179 | dll/src/desktop/extra/capability.rs:223-240 | dll/src/desktop/extra/capability.rs:243-260 — 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) layout/src/callbacks.rs:2072 — layout/src/callbacks.rs:2072-2094 | layout/src/widgets/progressbar.rs:327-344 | layout/src/widgets/statusbar.rs:1392-1412 — 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 (5 members, 11+ corresponding lines) · ×2
  • Edited copies of one member (5 members, 11+ corresponding lines) layout/src/window.rs:8367 — layout/src/window.rs:8367-8380 | layout/src/window.rs:8383-8393 | layout/src/window.rs:8396-8409 | layout/src/window.rs:8412-8425 | layout/src/window.rs:8428-8441 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 11+ corresponding lines) dll/src/web/transpiler_remill.rs:6130 — dll/src/web/transpiler_remill.rs:6130-6140 | dll/src/web/transpiler_remill.rs:6144-6154 | dll/src/web/transpiler_remill.rs:6158-6168 | dll/src/web/transpiler_remill.rs:6211-6221 | dll/src/web/transpiler_remill.rs:6225-6235 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 12+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 12+ corresponding lines) core/src/json.rs:620 — core/src/json.rs:620-631 | core/src/json.rs:635-646 | core/src/json.rs:667-678 | core/src/json.rs:682-700 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 12+ corresponding lines) layout/src/solver3/getters.rs:6585 — layout/src/solver3/getters.rs:6585-6596 | layout/src/solver3/getters.rs:6604-6615 | layout/src/solver3/getters.rs:6623-6634 | layout/src/solver3/getters.rs:6642-6653 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 9+ corresponding lines) · ×2
  • Edited copies of one member (5 members, 9+ corresponding lines) doc/src/codegen/v2/lang_crystal/types.rs:394 — doc/src/codegen/v2/lang_crystal/types.rs:394-402 | doc/src/codegen/v2/lang_d/types.rs:265-273 | doc/src/codegen/v2/lang_julia/mod.rs:293-301 | doc/src/codegen/v2/lang_odin/types.rs:336-344 | doc/src/codegen/v2/lang_v/types.rs:347-355 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 9+ corresponding lines) dll/src/desktop/shell2/linux/wayland/events.rs:3813 — dll/src/desktop/shell2/linux/wayland/events.rs:3813-3821 | dll/src/desktop/shell2/linux/wayland/events.rs:3829-3839 | dll/src/desktop/shell2/linux/wayland/events.rs:3901-3911 | dll/src/desktop/shell2/linux/wayland/events.rs:3919-3930 | dll/src/desktop/shell2/linux/wayland/events.rs:3937-3947 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 4+ corresponding lines) · ×2
  • Edited copies of one member (6 members, 4+ corresponding lines) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:265 — webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:265-268 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:269-272 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:275-278 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:269-272 | webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:215-218 | webrender/swgl/src/shaders/composite_texture_rect_yuv.rs:212-215 — These 6 members are one piece of code written 6 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 6 times and the copies will drift further apart.
  • Edited copies of one member (6 members, 4+ corresponding lines) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:276 — webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:276-279 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:280-283 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:286-289 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:280-283 | webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:226-229 | webrender/swgl/src/shaders/composite_texture_rect_yuv.rs:223-226 — These 6 members are one piece of code written 6 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 6 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (48 lines × 2) · ×2
  • Duplicated block (48 lines × 2) layout/src/widgets/badge.rs:77 — layout/src/widgets/badge.rs:77-124 | layout/src/widgets/chip.rs:158-205 — before extracting anything, compare `layout/src/widgets/badge.rs` and `layout/src/widgets/chip.rs` as WHOLE FILES: this scan already matched 4 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 `layout/src/widgets/badge.rs:77` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (48 lines × 2) layout/src/widgets/themes/flat.rs:778 — layout/src/widgets/themes/flat.rs:778-825 | layout/src/widgets/themes/flora.rs:1038-1085 — before extracting anything, compare `layout/src/widgets/themes/flat.rs` and `layout/src/widgets/themes/flora.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 927 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `layout/src/widgets/themes/flat.rs:778` it does not close everything it opens, so those 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 (40 lines × 2) · ×2
  • Duplicated block (40 lines × 2) layout/src/widgets/themes/flat.rs:1038 — layout/src/widgets/themes/flat.rs:1038-1077 | layout/src/widgets/themes/flora.rs:1310-1349 — before extracting anything, compare `layout/src/widgets/themes/flat.rs` and `layout/src/widgets/themes/flora.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 927 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `layout/src/widgets/themes/flat.rs:1038` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (40 lines × 2) layout/src/widgets/themes/flat.rs:2120 — layout/src/widgets/themes/flat.rs:2120-2159 | layout/src/widgets/themes/flora.rs:2434-2473 — before extracting anything, compare `layout/src/widgets/themes/flat.rs` and `layout/src/widgets/themes/flora.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 927 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `layout/src/widgets/themes/flat.rs:2120` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (37 lines × 2) · ×2
  • Duplicated block (37 lines × 2) doc/src/codegen/v2/rust/dynamic_binding.rs:42 — doc/src/codegen/v2/rust/dynamic_binding.rs:42-78 | doc/src/codegen/v2/rust/static_binding.rs:108-144 — before extracting anything, compare `doc/src/codegen/v2/rust/dynamic_binding.rs` and `doc/src/codegen/v2/rust/static_binding.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `doc/src/codegen/v2/rust/dynamic_binding.rs:37` calls `blank`, `line`, `indent` and `doc/src/codegen/v2/rust/static_binding.rs:107` 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 (37 lines × 2) layout/src/solver3/fc.rs:8969 — layout/src/solver3/fc.rs:8969-9005 | layout/src/solver3/fc.rs:9530-9566 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/fc.rs:8969` it begins part-way through the construct above it, so those 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 (35 lines × 2) · ×2
  • Duplicated block (35 lines × 2) dll/src/desktop/extra/geolocation/ios.rs:183 — dll/src/desktop/extra/geolocation/ios.rs:183-217 | dll/src/desktop/extra/geolocation/macos.rs:177-211 — before extracting anything, compare `dll/src/desktop/extra/geolocation/ios.rs` and `dll/src/desktop/extra/geolocation/macos.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (35 lines × 2) doc/src/codegen/v2/lang_kotlin/wrappers.rs:1610 — doc/src/codegen/v2/lang_kotlin/wrappers.rs:1610-1644 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:1851-1885 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_kotlin/wrappers.rs:1610` 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, `doc/src/codegen/v2/lang_kotlin/wrappers.rs:1848` calls `classify_return` and `doc/src/codegen/v2/lang_kotlin/wrappers.rs:1605` 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 (26–34 lines × 2) · ×2
  • Duplicated block (26–34 lines × 2) dll/src/desktop/shell2/run.rs:1056 — dll/src/desktop/shell2/run.rs:1056-1089 | dll/src/desktop/shell2/run.rs:1228-1253 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (26–34 lines × 2) layout/src/text3/cache.rs:7927 — layout/src/text3/cache.rs:7927-7960 | layout/src/text3/cache.rs:8156-8181 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (30–31 lines × 2) · ×2
  • Duplicated block (30–31 lines × 2) dll/src/desktop/extra/permission/ios.rs:100 — dll/src/desktop/extra/permission/ios.rs:100-130 | dll/src/desktop/extra/permission/macos.rs:200-229 — before extracting anything, compare `dll/src/desktop/extra/permission/ios.rs` and `dll/src/desktop/extra/permission/macos.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (30–31 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:10884 — dll/src/desktop/shell2/linux/wayland/mod.rs:10884-10914 | dll/src/desktop/shell2/linux/x11/mod.rs:8642-8671 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:10884` it begins part-way through the construct above it, so those 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–28 lines × 2) · ×2
  • Duplicated block (26–28 lines × 2) dll/src/desktop/extra/geolocation/mod.rs:37 — dll/src/desktop/extra/geolocation/mod.rs:37-62 | dll/src/desktop/extra/permission/mod.rs:38-65 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/extra/geolocation/mod.rs:37` 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 `events` to `&[GeolocationDiffEvent]` in one and `&[PermissionDiffEvent]` 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 (26–28 lines × 2) layout/src/widgets/themes/flat.rs:1439 — layout/src/widgets/themes/flat.rs:1439-1466 | layout/src/widgets/themes/flora.rs:1848-1873 — before extracting anything, compare `layout/src/widgets/themes/flat.rs` and `layout/src/widgets/themes/flora.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 927 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `layout/src/widgets/themes/flat.rs:1439` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (27–28 lines × 2) · ×2
  • Duplicated block (27–28 lines × 2) doc/src/codegen/v2/lang_ada/functions.rs:243 — doc/src/codegen/v2/lang_ada/functions.rs:243-269 | doc/src/codegen/v2/lang_ada/mod.rs:284-311 — 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 (27–28 lines × 2) layout/src/text3/cache.rs:10198 — layout/src/text3/cache.rs:10198-10225 | layout/src/text3/cache.rs:10259-10285 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/text3/cache.rs:10198` it does not close everything it opens, so those 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–27 lines × 2) · ×2
  • Duplicated block (22–27 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:4952 — dll/src/desktop/shell2/linux/wayland/mod.rs:4952-4978 | dll/src/desktop/shell2/linux/x11/events.rs:898-919 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/events.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 263 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 `dll/src/desktop/shell2/linux/wayland/mod.rs:4952` it does not close everything it opens, so those exact lines 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–27 lines × 2) doc/src/codegen/v2/lang_node/wrappers.rs:429 — doc/src/codegen/v2/lang_node/wrappers.rs:429-455 | doc/src/codegen/v2/lang_node/wrappers.rs:653-674 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `doc/src/codegen/v2/lang_node/wrappers.rs:427` calls `has_delete_for` and `doc/src/codegen/v2/lang_node/wrappers.rs:651` 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 (24 lines × 3) · ×2
  • Duplicated block (24 lines × 3) doc/src/autofix/type_index.rs:2266 — doc/src/autofix/type_index.rs:2266-2289 | doc/src/autofix/type_index.rs:2313-2336 | doc/src/autofix/type_index.rs:2414-2437 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/type_index.rs:2266` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (24 lines × 3) webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:122 — webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:122-145 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:122-145 | webrender/swgl/src/shaders/brush_image_texture_rect.rs:113-136 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs` and `webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 392 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:122` 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–24 lines × 2) · ×2
  • Duplicated block (17–24 lines × 2) dll/src/desktop/compositor2.rs:452 — dll/src/desktop/compositor2.rs:452-468 | dll/src/desktop/compositor2.rs:529-552 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/compositor2.rs:452` it begins part-way through the construct above it, so those 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 (17–24 lines × 2) dll/src/web/transpiler_remill.rs:1287 — dll/src/web/transpiler_remill.rs:1287-1310 | dll/src/web/transpiler_remill.rs:6694-6710 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/web/transpiler_remill.rs:6694` it does not close everything it opens, so those 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, `dll/src/web/transpiler_remill.rs:1345` calls `get`, `Some` and `dll/src/web/transpiler_remill.rs:6710` 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 (22–24 lines × 2) · ×2
  • Duplicated block (22–24 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:5476 — dll/src/desktop/shell2/linux/wayland/mod.rs:5476-5497 | dll/src/desktop/shell2/linux/x11/mod.rs:5073-5096 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/x11/mod.rs:5073` it begins part-way through the construct above it, so those exact lines 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–24 lines × 2) layout/src/cpurender/raster.rs:3274 — layout/src/cpurender/raster.rs:3274-3297 | layout/src/cpurender/raster.rs:3301-3322 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/cpurender/raster.rs:3301` it begins part-way through the construct above it, so those 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–24 lines × 2) · ×2
  • Duplicated block (23–24 lines × 2) doc/src/autofix/diff.rs:812 — doc/src/autofix/diff.rs:812-835 | doc/src/autofix/diff.rs:843-865 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/diff.rs:812` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (23–24 lines × 2) doc/src/codegen/v2/lang_d/wrappers.rs:1641 — doc/src/codegen/v2/lang_d/wrappers.rs:1641-1663 | doc/src/codegen/v2/lang_swift/wrappers.rs:1553-1576 — `doc/src/codegen/v2/lang_d/wrappers.rs` and `doc/src/codegen/v2/lang_swift/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 27 separate duplicated blocks between them, totalling at least 281 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (21–23 lines × 3) · ×2
  • Duplicated block (21–23 lines × 3) dll/src/desktop/shell2/linux/x11/mod.rs:6237 — dll/src/desktop/shell2/linux/x11/mod.rs:6237-6258 | dll/src/desktop/shell2/windows/mod.rs:1896-1918 | dll/src/desktop/shell2/windows/mod.rs:1963-1983 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 450 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 `dll/src/desktop/shell2/linux/x11/mod.rs:6237` it begins part-way through the construct above it, so those 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, `dll/src/desktop/shell2/linux/x11/mod.rs:6234` calls `Gpu`, `make_current` and `dll/src/desktop/shell2/windows/mod.rs:1961` 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–23 lines × 3) layout/src/solver3/fc.rs:1699 — layout/src/solver3/fc.rs:1699-1720 | layout/src/solver3/fc.rs:2444-2466 | layout/src/solver3/fc.rs:2530-2550 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/fc.rs:1699` it begins part-way through the construct above it, so those 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 (21–23 lines × 2) · ×2
  • Duplicated block (21–23 lines × 2) dll/src/desktop/shell2/common/event.rs:933 — dll/src/desktop/shell2/common/event.rs:933-953 | dll/src/desktop/shell2/common/event.rs:985-1007 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/common/event.rs:933` it begins part-way through the construct above it, so those exact lines 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–23 lines × 2) doc/src/codegen/v2/lang_haskell/types.rs:467 — doc/src/codegen/v2/lang_haskell/types.rs:467-489 | doc/src/codegen/v2/lang_ruby/wrappers.rs:631-651 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (22–23 lines × 2) · ×2
  • Duplicated block (22–23 lines × 2) doc/src/autofix/type_index.rs:1251 — doc/src/autofix/type_index.rs:1251-1273 | doc/src/autofix/type_index.rs:3133-3154 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/type_index.rs:1251` it begins part-way through the construct above it, so those exact lines 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–23 lines × 2) webrender/core/src/scene_building.rs:3793 — webrender/core/src/scene_building.rs:3793-3815 | webrender/core/src/scene_building.rs:4194-4215 — both copies are in the same file, so extract the 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.
D4 · Code Duplication · Duplicated block (21 lines × 5) · ×2
  • Duplicated block (21 lines × 5) layout/src/widgets/backstage.rs:256 — layout/src/widgets/backstage.rs:256-276 | layout/src/widgets/quick_access.rs:301-321 | layout/src/widgets/ribbon.rs:598-618 | layout/src/widgets/statusbar.rs:324-344 | layout/src/widgets/statusbar.rs:564-584 — before extracting anything, compare `layout/src/widgets/backstage.rs` and `layout/src/widgets/quick_access.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `layout/src/widgets/backstage.rs:256` it begins part-way through the construct above it, so those 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, `layout/src/widgets/ribbon.rs:621` calls `push_border_colors` and `layout/src/widgets/backstage.rs:277` 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 (21 lines × 5) webrender/core/src/picture.rs:6406 — webrender/core/src/picture.rs:6406-6426 | webrender/core/src/picture.rs:6436-6456 | webrender/core/src/picture.rs:6466-6486 | webrender/core/src/picture.rs:6502-6522 | webrender/core/src/picture.rs:6532-6552 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (18–21 lines × 2) · ×2
  • Duplicated block (18–21 lines × 2) core/src/xml.rs:8426 — core/src/xml.rs:8426-8443 | core/src/xml.rs:8712-8732 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/xml.rs:8426` it does not close everything it opens, so those exact lines 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–21 lines × 2) layout/src/cpurender/pixmap.rs:1339 — layout/src/cpurender/pixmap.rs:1339-1359 | layout/src/cpurender/pixmap.rs:1444-1461 — both copies are in the same file, so extract the 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–21 lines × 2) · ×2
  • Duplicated block (20–21 lines × 2) doc/src/autofix/mod.rs:4955 — doc/src/autofix/mod.rs:4955-4975 | doc/src/autofix/mod.rs:4994-5013 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (20–21 lines × 2) doc/src/autofix/workspace.rs:554 — doc/src/autofix/workspace.rs:554-574 | doc/src/autofix/workspace.rs:598-617 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/workspace.rs:554` it begins part-way through the construct above it, so those 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–21 lines × 2) · ×2
  • Duplicated block (14–21 lines × 2) doc/src/codegen/v2/lang_cpp/cpp11.rs:29 — doc/src/codegen/v2/lang_cpp/cpp11.rs:29-49 | doc/src/codegen/v2/lang_cpp/cpp14.rs:24-37 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp11.rs` and `doc/src/codegen/v2/lang_cpp/cpp14.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 164 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–21 lines × 2) doc/src/codegen/v2/lang_csharp/wrappers.rs:786 — doc/src/codegen/v2/lang_csharp/wrappers.rs:786-806 | doc/src/codegen/v2/lang_csharp/wrappers.rs:927-940 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_csharp/wrappers.rs:786` it begins part-way through the construct above it, so those 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–20 lines × 2) · ×2
  • Duplicated block (17–20 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:10428 — dll/src/desktop/shell2/linux/wayland/mod.rs:10428-10447 | dll/src/desktop/shell2/linux/wayland/mod.rs:10579-10595 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17–20 lines × 2) doc/src/codegen/v2/lang_python.rs:3482 — doc/src/codegen/v2/lang_python.rs:3482-3498 | doc/src/codegen/v2/lang_python.rs:3687-3706 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_python.rs:3482` it begins part-way through the construct above it, so those 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 × 6) · ×2
  • Duplicated block (19 lines × 6) doc/src/autofix/type_index.rs:2478 — doc/src/autofix/type_index.rs:2478-2496 | doc/src/autofix/type_index.rs:2519-2537 | doc/src/autofix/type_index.rs:2560-2578 | doc/src/autofix/type_index.rs:2601-2619 | doc/src/autofix/type_index.rs:2652-2670 | doc/src/autofix/type_index.rs:2791-2809 — 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 `doc/src/autofix/type_index.rs:2478` it begins part-way through the construct above it, so those exact lines 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 × 6) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:245 — webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:245-263 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:249-267 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:255-273 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:249-267 | webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:195-213 | webrender/swgl/src/shaders/composite_texture_rect_yuv.rs:192-210 — before extracting anything, compare `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs` and `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 334 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (13–19 lines × 2) · ×2
  • Duplicated block (13–19 lines × 2) doc/src/codegen/v2/lang_csharp/wrappers.rs:1445 — doc/src/codegen/v2/lang_csharp/wrappers.rs:1445-1457 | doc/src/codegen/v2/lang_java/wrappers.rs:1353-1371 — `doc/src/codegen/v2/lang_csharp/wrappers.rs` and `doc/src/codegen/v2/lang_java/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 167 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (13–19 lines × 2) layout/src/event_determination.rs:570 — layout/src/event_determination.rs:570-582 | layout/src/event_determination.rs:1046-1064 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/event_determination.rs:570` it begins part-way through the construct above it, so those 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 × 4) · ×2
  • Duplicated block (18 lines × 4) doc/src/codegen/v2/lang_cpp/cpp03.rs:555 — doc/src/codegen/v2/lang_cpp/cpp03.rs:555-572 | doc/src/codegen/v2/lang_cpp/cpp11.rs:475-492 | doc/src/codegen/v2/lang_cpp/cpp17.rs:664-681 | doc/src/codegen/v2/lang_cpp/cpp20.rs:363-380 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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, `doc/src/codegen/v2/lang_cpp/cpp11.rs:493` calls `push_str` and `doc/src/codegen/v2/lang_cpp/cpp03.rs:573` 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 (18 lines × 4) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:394 — webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:394-411 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:397-414 | webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:350-367 | webrender/swgl/src/shaders/composite_texture_rect_yuv.rs:348-365 — before extracting anything, compare `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs` and `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 334 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (18 lines × 3) · ×2
  • Duplicated block (18 lines × 3) doc/src/autofix/type_index.rs:2976 — doc/src/autofix/type_index.rs:2976-2993 | doc/src/autofix/type_index.rs:3002-3019 | doc/src/autofix/type_index.rs:3031-3048 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/type_index.rs:2976` it begins part-way through the construct above it, so those exact lines 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) doc/src/codegen/v2/lang_csharp/wrappers.rs:542 — doc/src/codegen/v2/lang_csharp/wrappers.rs:542-559 | doc/src/codegen/v2/lang_java/wrappers.rs:958-975 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:371-388 — `doc/src/codegen/v2/lang_csharp/wrappers.rs` and `doc/src/codegen/v2/lang_java/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 167 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (11–17 lines × 2) · ×2
  • Duplicated block (11–17 lines × 2) css/src/dynamic_selector.rs:2354 — css/src/dynamic_selector.rs:2354-2364 | css/src/dynamic_selector.rs:2425-2441 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `css/src/dynamic_selector.rs:2354` it does not close everything it opens, so those exact lines 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–17 lines × 2) doc/src/codegen/v2/lang_node/wrappers.rs:561 — doc/src/codegen/v2/lang_node/wrappers.rs:561-577 | doc/src/codegen/v2/lang_node/wrappers.rs:741-751 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_node/wrappers.rs:561` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (14–17 lines × 2) · ×2
  • Duplicated block (14–17 lines × 2) dll/src/desktop/shell2/common/event.rs:12904 — dll/src/desktop/shell2/common/event.rs:12904-12920 | dll/src/desktop/shell2/common/event.rs:13086-13099 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/common/event.rs:12904` it begins part-way through the construct above it, so those exact lines 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–17 lines × 2) layout/src/cpurender/raster.rs:3515 — layout/src/cpurender/raster.rs:3515-3528 | layout/src/cpurender/raster.rs:3792-3808 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (13–17 lines × 2) · ×2
  • Duplicated block (13–17 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:3882 — dll/src/desktop/shell2/linux/wayland/mod.rs:3882-3894 | dll/src/desktop/shell2/linux/x11/mod.rs:2119-2135 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:3882` 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–17 lines × 2) doc/src/codegen/v2/lang_rust.rs:2557 — doc/src/codegen/v2/lang_rust.rs:2557-2573 | doc/src/codegen/v2/rust/shared.rs:149-161 — before extracting anything, compare `doc/src/codegen/v2/lang_rust.rs` and `doc/src/codegen/v2/rust/shared.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 210 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 `doc/src/codegen/v2/lang_rust.rs:2557` it does not close everything it opens, so those 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 × 4) · ×2
  • Duplicated block (15–16 lines × 4) doc/src/autofix/type_index.rs:2506 — doc/src/autofix/type_index.rs:2506-2521 | doc/src/autofix/type_index.rs:2547-2562 | doc/src/autofix/type_index.rs:2588-2603 | doc/src/autofix/type_index.rs:2770-2784 — 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 `doc/src/autofix/type_index.rs:2506` it does not close everything it opens, so those 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 × 4) layout/src/solver3/fc.rs:1629 — layout/src/solver3/fc.rs:1629-1643 | layout/src/solver3/fc.rs:1703-1717 | layout/src/solver3/fc.rs:2449-2464 | layout/src/solver3/fc.rs:2535-2550 — 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 `layout/src/solver3/fc.rs:1629` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16 lines × 4) · ×2
  • Duplicated block (16 lines × 4) doc/src/codegen/v2/lang_cpp/cpp03.rs:629 — doc/src/codegen/v2/lang_cpp/cpp03.rs:629-644 | doc/src/codegen/v2/lang_cpp/cpp11.rs:551-566 | doc/src/codegen/v2/lang_cpp/cpp17.rs:743-758 | doc/src/codegen/v2/lang_cpp/cpp20.rs:858-873 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/codegen/v2/lang_cpp/cpp03.rs:629` it does not close everything it opens, so those exact lines 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 × 4) dll/src/desktop/display.rs:1120 — dll/src/desktop/display.rs:1120-1135 | dll/src/desktop/display.rs:1192-1207 | dll/src/desktop/display.rs:1278-1293 | dll/src/desktop/display.rs:1404-1419 — 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 `dll/src/desktop/display.rs:1120` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10–16 lines × 2) · ×2
  • Duplicated block (10–16 lines × 2) doc/src/autofix/module_map.rs:480 — doc/src/autofix/module_map.rs:480-495 | doc/src/autotest/mod.rs:260-269 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `path` to `&std::path::Path` in one and `&Path` 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, `doc/src/autotest/mod.rs:271` calls `contains` and `doc/src/autofix/module_map.rs:498` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10–16 lines × 2) layout/src/text3/cache.rs:13224 — layout/src/text3/cache.rs:13224-13233 | layout/src/text3/cache.rs:13364-13379 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/text3/cache.rs:13224` it does not close everything it opens, so those 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 × 3) · ×2
  • Duplicated block (14–15 lines × 3) core/src/xml.rs:8395 — core/src/xml.rs:8395-8409 | core/src/xml.rs:8481-8494 | core/src/xml.rs:8686-8699 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/xml.rs:8395` it begins part-way through the construct above it, so those exact lines 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) doc/src/reftest/autoreview.rs:1104 — doc/src/reftest/autoreview.rs:1104-1117 | doc/src/reftest/autoreview.rs:1540-1553 | doc/src/reftest/autoreview.rs:2044-2058 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `config` to `&AutoreviewConfig` in one and `AutoreviewConfig` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (11–15 lines × 2) · ×2
  • Duplicated block (11–15 lines × 2) doc/src/reftest/autodoc.rs:1571 — doc/src/reftest/autodoc.rs:1571-1581 | doc/src/reftest/pipeline.rs:278-292 — before extracting anything, compare `doc/src/reftest/autodoc.rs` and `doc/src/reftest/pipeline.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11–15 lines × 2) layout/src/widgets/text_input.rs:1027 — layout/src/widgets/text_input.rs:1027-1041 | layout/src/widgets/text_input.rs:1058-1068 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (12–14 lines × 5) · ×2
  • Duplicated block (12–14 lines × 5) dll/src/desktop/shell2/windows/mod.rs:4660 — dll/src/desktop/shell2/windows/mod.rs:4660-4671 | dll/src/desktop/shell2/windows/mod.rs:5009-5022 | dll/src/desktop/shell2/windows/mod.rs:5105-5118 | dll/src/desktop/shell2/windows/mod.rs:5155-5168 | dll/src/desktop/shell2/windows/mod.rs:5239-5251 — 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 `dll/src/desktop/shell2/windows/mod.rs:4660` 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, `dll/src/desktop/shell2/windows/mod.rs:5102` calls `arm_mouse_leave` and `dll/src/desktop/shell2/windows/mod.rs:5152` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12–14 lines × 5) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:381 — webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:381-393 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:377-388 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:370-381 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:370-382 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:335-348 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs` and `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 439 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:381` 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 lines × 5) · ×2
  • Duplicated block (12 lines × 5) layout/src/widgets/quick_access.rs:290 — layout/src/widgets/quick_access.rs:290-301 | layout/src/widgets/ribbon.rs:587-598 | layout/src/widgets/ribbon.rs:1282-1293 | layout/src/widgets/statusbar.rs:313-324 | layout/src/widgets/statusbar.rs:553-564 — before extracting anything, compare `layout/src/widgets/quick_access.rs` and `layout/src/widgets/ribbon.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 5) dll/src/desktop/extra/biometric/android.rs:140 — dll/src/desktop/extra/biometric/android.rs:140-151 | dll/src/desktop/extra/geolocation/android.rs:109-120 | dll/src/desktop/extra/keyring/android.rs:107-118 | dll/src/desktop/extra/permission/android.rs:147-158 | dll/src/desktop/extra/sensors/android.rs:81-92 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times. 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 (9–12 lines × 2) · ×2
  • Duplicated block (9–12 lines × 2) core/src/styled_dom.rs:1192 — core/src/styled_dom.rs:1192-1200 | core/src/styled_dom.rs:1523-1534 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/styled_dom.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.
  • Duplicated block (9–12 lines × 2) dll/src/desktop/shell2/android/mod.rs:2452 — dll/src/desktop/shell2/android/mod.rs:2452-2460 | dll/src/desktop/shell2/android/mod.rs:3105-3116 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/android/mod.rs:2452` it does not close everything it opens, so those 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 × 2) · ×2
  • Duplicated block (8–12 lines × 2) doc/src/codegen/v2/lang_cpp/common.rs:540 — doc/src/codegen/v2/lang_cpp/common.rs:540-551 | doc/src/codegen/v2/lang_cpp/common.rs:959-966 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_cpp/common.rs:540` it begins part-way through the construct above it, so those exact lines 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–12 lines × 2) doc/src/codegen/v2/lang_haskell/cshim.rs:260 — doc/src/codegen/v2/lang_haskell/cshim.rs:260-271 | doc/src/codegen/v2/lang_haskell/cshim.rs:522-529 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_haskell/cshim.rs:260` it does not close everything it opens, so those 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 × 3) · ×2
  • Duplicated block (9–11 lines × 3) doc/src/autofix/diff.rs:634 — doc/src/autofix/diff.rs:634-644 | doc/src/autofix/diff.rs:1861-1869 | doc/src/autofix/diff.rs:2255-2263 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/diff.rs:634` it does not close everything it opens, so those exact lines 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–11 lines × 3) core/src/xml.rs:3199 — core/src/xml.rs:3199-3208 | core/src/xml.rs:3254-3264 | core/src/xml.rs:3288-3296 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/xml.rs:3199` it does not close everything it opens, so those 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 × 8) · ×2
  • Duplicated block (10 lines × 8) doc/src/codegen/v2/lang_cpp/cpp03.rs:259 — doc/src/codegen/v2/lang_cpp/cpp03.rs:259-268 | doc/src/codegen/v2/lang_cpp/cpp03.rs:296-305 | doc/src/codegen/v2/lang_cpp/cpp11.rs:168-177 | doc/src/codegen/v2/lang_cpp/cpp11.rs:195-204 | doc/src/codegen/v2/lang_cpp/cpp17.rs:299-308 | doc/src/codegen/v2/lang_cpp/cpp17.rs:343-352 | doc/src/codegen/v2/lang_cpp/cpp20.rs:1012-1021 | doc/src/codegen/v2/lang_cpp/cpp20.rs:1039-1048 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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, `doc/src/codegen/v2/lang_cpp/cpp03.rs:295` calls `get_cpp_return_type`, `as_deref` and `doc/src/codegen/v2/lang_cpp/cpp03.rs:258` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 8) doc/src/codegen/v2/lang_cpp/cpp03.rs:333 — doc/src/codegen/v2/lang_cpp/cpp03.rs:333-342 | doc/src/codegen/v2/lang_cpp/cpp03.rs:693-702 | doc/src/codegen/v2/lang_cpp/cpp11.rs:240-249 | doc/src/codegen/v2/lang_cpp/cpp11.rs:615-624 | doc/src/codegen/v2/lang_cpp/cpp17.rs:397-406 | doc/src/codegen/v2/lang_cpp/cpp17.rs:825-834 | doc/src/codegen/v2/lang_cpp/cpp20.rs:949-958 | doc/src/codegen/v2/lang_cpp/cpp20.rs:1074-1083 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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, `doc/src/codegen/v2/lang_cpp/cpp20.rs:944` calls `get_cpp_return_type`, `as_deref`, `should_substitute_callbacks` and `doc/src/codegen/v2/lang_cpp/cpp03.rs:690` 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 lines × 7) · ×2
  • Duplicated block (10 lines × 7) dll/src/desktop/shell2/windows/mod.rs:4666 — dll/src/desktop/shell2/windows/mod.rs:4666-4675 | dll/src/desktop/shell2/windows/mod.rs:4876-4885 | dll/src/desktop/shell2/windows/mod.rs:5017-5026 | dll/src/desktop/shell2/windows/mod.rs:5113-5122 | dll/src/desktop/shell2/windows/mod.rs:5163-5172 | dll/src/desktop/shell2/windows/mod.rs:5218-5227 | dll/src/desktop/shell2/windows/mod.rs:5246-5255 — 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 `dll/src/desktop/shell2/windows/mod.rs:4666` it does not close everything it opens, so those exact lines 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 × 7) doc/src/autofix/type_index.rs:2463 — doc/src/autofix/type_index.rs:2463-2472 | doc/src/autofix/type_index.rs:2504-2513 | doc/src/autofix/type_index.rs:2545-2554 | doc/src/autofix/type_index.rs:2586-2595 | doc/src/autofix/type_index.rs:2629-2638 | doc/src/autofix/type_index.rs:2680-2689 | doc/src/autofix/type_index.rs:2768-2777 — 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 `doc/src/autofix/type_index.rs:2463` it does not close everything it opens, so those 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 (3–10 lines × 4) · ×2
  • Duplicated block (3–10 lines × 4) doc/src/codegen/v2/lang_csharp/wrappers.rs:83 — doc/src/codegen/v2/lang_csharp/wrappers.rs:83-92 | doc/src/codegen/v2/lang_java/types.rs:313-315 | doc/src/codegen/v2/lang_java/wrappers.rs:1240-1243 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:80-89 — `doc/src/codegen/v2/lang_csharp/wrappers.rs` and `doc/src/codegen/v2/lang_java/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 167 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_java/types.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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `doc/src/codegen/v2/lang_csharp/wrappers.rs:83` calls `Some` and `doc/src/codegen/v2/lang_java/types.rs:313` 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 (3–10 lines × 4) doc/src/codegen/v2/lang_csharp/wrappers.rs:110 — doc/src/codegen/v2/lang_csharp/wrappers.rs:110-119 | doc/src/codegen/v2/lang_java/wrappers.rs:1268-1270 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:107-116 | doc/src/codegen/v2/lang_ruby/types.rs:678-680 — `doc/src/codegen/v2/lang_csharp/wrappers.rs` and `doc/src/codegen/v2/lang_java/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 167 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_csharp/wrappers.rs:110` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8–9 lines × 5) · ×2
  • Duplicated block (8–9 lines × 5) layout/src/cpurender/compositor.rs:436 — layout/src/cpurender/compositor.rs:436-444 | layout/src/cpurender/compositor.rs:477-484 | layout/src/cpurender/compositor.rs:513-520 | layout/src/cpurender/compositor.rs:575-582 | layout/src/cpurender/compositor.rs:623-630 — 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 `layout/src/cpurender/compositor.rs:436` 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–9 lines × 5) webrender/swgl/src/shaders/ps_quad_conic_gradient.rs:114 — webrender/swgl/src/shaders/ps_quad_conic_gradient.rs:114-121 | webrender/swgl/src/shaders/ps_quad_mask.rs:242-249 | webrender/swgl/src/shaders/ps_quad_mask_fast_path.rs:178-185 | webrender/swgl/src/shaders/ps_quad_radial_gradient.rs:101-108 | webrender/swgl/src/shaders/ps_quad_textured.rs:225-233 — before extracting anything, compare `webrender/swgl/src/shaders/ps_quad_conic_gradient.rs` and `webrender/swgl/src/shaders/ps_quad_mask.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/swgl/src/shaders/ps_quad_conic_gradient.rs:114` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–9 lines × 4) · ×2
  • Duplicated block (8–9 lines × 4) doc/src/codegen/v2/lang_freebasic/types.rs:165 — doc/src/codegen/v2/lang_freebasic/types.rs:165-173 | doc/src/codegen/v2/lang_freebasic/types.rs:192-199 | doc/src/codegen/v2/lang_vb6/types.rs:183-191 | doc/src/codegen/v2/lang_vb6/types.rs:228-235 — `doc/src/codegen/v2/lang_freebasic/types.rs` and `doc/src/codegen/v2/lang_vb6/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 114 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (8–9 lines × 4) layout/src/text3/dense.rs:695 — layout/src/text3/dense.rs:695-703 | layout/src/text3/dense.rs:1224-1231 | layout/src/text3/dense.rs:1339-1346 | layout/src/text3/dense.rs:1506-1513 — 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 `layout/src/text3/dense.rs:695` 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: `layout/src/text3/dense.rs:695` is reached only past a guard at line 691 that tests `m.units_per_em` and leaves the function early, and `layout/src/text3/dense.rs:1224` reads `m.units_per_em` with no such check. What separates these copies is not which lines they run but which PRECONDITION they enforce, so one of them is operating on state the other one refuses. Decide which is intended BEFORE unifying them — extract the shared part and whichever copy is missing the check keeps running unchecked, and if the guard is the correct behaviour then that hole is already live.
D4 · Code Duplication · Duplicated block (8 lines × 7) · ×2
  • Duplicated block (8 lines × 7) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:287 — webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:287-294 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:286-293 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:275-282 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:227-234 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:255-262 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:194-201 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:187-194 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs` and `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 439 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:287` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 7) doc/src/codegen/v2/lang_algol68/types.rs:384 — doc/src/codegen/v2/lang_algol68/types.rs:384-391 | doc/src/codegen/v2/lang_crystal/mod.rs:405-412 | doc/src/codegen/v2/lang_d/mod.rs:482-489 | doc/src/codegen/v2/lang_julia/mod.rs:282-289 | doc/src/codegen/v2/lang_nim/types.rs:505-512 | doc/src/codegen/v2/lang_odin/mod.rs:231-238 | doc/src/codegen/v2/lang_v/mod.rs:256-263 — `doc/src/codegen/v2/lang_crystal/mod.rs` and `doc/src/codegen/v2/lang_julia/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 51 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (8 lines × 6) · ×2
  • Duplicated block (8 lines × 6) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:181 — webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:181-188 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:187-194 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:191-198 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:187-194 | webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:144-151 | webrender/swgl/src/shaders/composite_texture_rect_yuv.rs:143-150 — before extracting anything, compare `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs` and `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 334 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) doc/src/codegen/v2/lang_rust.rs:603 — doc/src/codegen/v2/lang_rust.rs:603-614 | doc/src/codegen/v2/lang_rust.rs:3027-3035 | doc/src/codegen/v2/lang_rust.rs:3170-3177 | doc/src/codegen/v2/lang_rust.rs:3241-3249 | doc/src/codegen/v2/lang_rust.rs:3293-3300 | doc/src/codegen/v2/lang_rust.rs:3332-3339 — 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 `doc/src/codegen/v2/lang_rust.rs:603` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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, `doc/src/codegen/v2/lang_rust.rs:3167` calls `line`, `dedent` and `doc/src/codegen/v2/lang_rust.rs:3331` 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 × 8) · ×2
  • Duplicated block (7 lines × 8) dll/src/desktop/shell2/windows/mod.rs:4671 — dll/src/desktop/shell2/windows/mod.rs:4671-4677 | dll/src/desktop/shell2/windows/mod.rs:4881-4887 | dll/src/desktop/shell2/windows/mod.rs:5022-5028 | dll/src/desktop/shell2/windows/mod.rs:5118-5124 | dll/src/desktop/shell2/windows/mod.rs:5168-5174 | dll/src/desktop/shell2/windows/mod.rs:5223-5229 | dll/src/desktop/shell2/windows/mod.rs:5251-5257 | dll/src/desktop/shell2/windows/mod.rs:5483-5489 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `dll/src/desktop/shell2/windows/mod.rs:5130` calls `mouse_state_mut`, `InWindow` and `dll/src/desktop/shell2/windows/mod.rs:5505` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 8) webrender/api/src/display_item.rs:69 — webrender/api/src/display_item.rs:69-75 | webrender/api/src/display_item.rs:973-979 | webrender/api/src/font.rs:236-242 | webrender/api/src/lib.rs:636-642 | webrender/api/src/lib.rs:728-734 | webrender/core/src/clip.rs:872-878 | webrender/core/src/gpu_types.rs:619-625 | webrender/core/src/segment.rs:87-93 — there are 8 copies across 6 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 8 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (7 lines × 6) · ×2
  • Duplicated block (7 lines × 6) doc/src/codegen/v2/lang_csharp/types.rs:430 — doc/src/codegen/v2/lang_csharp/types.rs:430-436 | doc/src/codegen/v2/lang_csharp/types.rs:466-472 | doc/src/codegen/v2/lang_java/types.rs:604-610 | doc/src/codegen/v2/lang_java/types.rs:647-653 | doc/src/codegen/v2/lang_kotlin/mod.rs:496-502 | doc/src/codegen/v2/lang_kotlin/mod.rs:533-539 — `doc/src/codegen/v2/lang_csharp/types.rs` and `doc/src/codegen/v2/lang_java/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 72 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_csharp/types.rs:430` it does not close everything it opens, so those 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, `doc/src/codegen/v2/lang_java/types.rs:612` calls `java_boxed` and `doc/src/codegen/v2/lang_csharp/types.rs:443` 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 × 6) layout/src/text3/cache.rs:10472 — layout/src/text3/cache.rs:10472-10478 | layout/src/text3/cache.rs:10573-10581 | layout/src/text3/dense.rs:694-700 | layout/src/text3/dense.rs:1223-1229 | layout/src/text3/dense.rs:1338-1344 | layout/src/text3/dense.rs:1505-1511 — before extracting anything, compare `layout/src/text3/cache.rs` and `layout/src/text3/dense.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (2–7 lines × 8) · ×2
  • Duplicated block (2–7 lines × 8) doc/src/codegen/v2/lang_csharp/types.rs:464 — doc/src/codegen/v2/lang_csharp/types.rs:464-465 | doc/src/codegen/v2/lang_csharp/wrappers.rs:114-120 | doc/src/codegen/v2/lang_java/types.rs:645-646 | doc/src/codegen/v2/lang_java/wrappers.rs:1274-1280 | doc/src/codegen/v2/lang_kotlin/mod.rs:531-532 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:111-117 | doc/src/codegen/v2/lang_node/wrappers.rs:1336-1337 | doc/src/codegen/v2/lang_ruby/types.rs:693-694 — `doc/src/codegen/v2/lang_csharp/types.rs` and `doc/src/codegen/v2/lang_java/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 72 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_csharp/types.rs:464` it does not close everything it opens, so those 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, `doc/src/codegen/v2/lang_csharp/wrappers.rs:120` calls `iter`, `find` and `doc/src/codegen/v2/lang_node/wrappers.rs:1337` 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–7 lines × 8) webrender/swgl/src/shaders/composite_texture_2d.rs:121 — webrender/swgl/src/shaders/composite_texture_2d.rs:121-123 | webrender/swgl/src/shaders/composite_texture_rect.rs:126-128 | webrender/swgl/src/shaders/cs_clip_box_shadow_texture_2d.rs:271-272 | webrender/swgl/src/shaders/cs_scale_texture_2d.rs:115-116 | webrender/swgl/src/shaders/cs_scale_texture_rect.rs:121-123 | webrender/swgl/src/shaders/debug_color.rs:90-96 | webrender/swgl/src/shaders/debug_font.rs:97-99 | webrender/swgl/src/shaders/ps_clear.rs:104-110 — before extracting anything, compare `webrender/swgl/src/shaders/composite_texture_2d.rs` and `webrender/swgl/src/shaders/composite_texture_rect.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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, `webrender/swgl/src/shaders/composite_texture_2d.rs:120` calls `add` and `webrender/swgl/src/shaders/debug_color.rs:90` 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 (4–6 lines × 6) · ×2
  • Duplicated block (4–6 lines × 6) dll/src/desktop/extra/camera/windows.rs:453 — dll/src/desktop/extra/camera/windows.rs:453-458 | dll/src/desktop/extra/capture_slot.rs:127-132 | dll/src/desktop/extra/screencap/windows.rs:361-366 | layout/src/cpurender/raster.rs:4623-4626 | layout/src/cpurender/raster.rs:4632-4637 | layout/src/cpurender/raster.rs:4640-4645 — there are 6 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/extra/camera/windows.rs:453` it begins part-way through the construct above it, so those 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 (4–6 lines × 6) layout/src/cpurender/pixmap.rs:1311 — layout/src/cpurender/pixmap.rs:1311-1314 | layout/src/cpurender/pixmap.rs:1423-1426 | layout/src/cpurender/raster.rs:2957-2964 | layout/src/cpurender/raster.rs:3832-3838 | layout/src/cpurender/raster.rs:4113-4117 | layout/src/cpurender/raster.rs:4244-4249 — there are 6 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/cpurender/raster.rs:2957` it does not close everything it opens, so those 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 (2–5 lines × 4) · ×2
  • Duplicated block (2–5 lines × 4) webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:358 — webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:358-362 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:286-287 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:276-280 | webrender/swgl/src/shaders/brush_image_texture_2d.rs:224-226 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs` and `webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 195 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `context` to `&ShaderContext) -> (vec4` in one and `&ShaderContext` 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, `webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:358` calls `clamp`, `xy`, `zw` and `webrender/swgl/src/shaders/brush_image_texture_2d.rs:224` 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–5 lines × 4) webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs:263 — webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs:263-267 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_texture_2d.rs:190-194 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_glyph_transform_texture_2d.rs:218-219 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_texture_2d.rs:259-260 — before extracting anything, compare `webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs` and `webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_texture_2d.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 107 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `context` to `&ShaderContext) -> (vec4` in one and `&ShaderContext` 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 (6 lines × 30) · ×2
  • Duplicated block (6 lines × 30) webrender/swgl/src/shaders/brush_blend.rs:496 — webrender/swgl/src/shaders/brush_blend.rs:496-501 | webrender/swgl/src/shaders/brush_blend_alpha_pass.rs:440-445 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:501-506 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:503-508 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:492-497 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:427-433 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:478-484 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:433-438 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:370-376 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:356-362 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:430-435 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:418-423 | webrender/swgl/src/shaders/brush_image_texture_2d.rs:288-294 | webrender/swgl/src/shaders/brush_image_texture_rect.rs:347-353 | webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs:353-359 | webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs:335-341 | webrender/swgl/src/shaders/brush_opacity_antialiasing.rs:318-323 | webrender/swgl/src/shaders/composite_fast_path_texture_2d.rs:221-226 | webrender/swgl/src/shaders/composite_fast_path_texture_rect.rs:213-218 | webrender/swgl/src/shaders/composite_texture_2d.rs:242-247 | webrender/swgl/src/shaders/composite_texture_rect.rs:256-262 | webrender/swgl/src/shaders/cs_blur_alpha_target.rs:330-335 | webrender/swgl/src/shaders/cs_scale_texture_2d.rs:217-222 | webrender/swgl/src/shaders/cs_scale_texture_rect.rs:233-238 | webrender/swgl/src/shaders/ps_copy.rs:195-201 | webrender/swgl/src/shaders/ps_split_composite.rs:281-286 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs:337-343 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_texture_2d.rs:281-286 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_glyph_transform_texture_2d.rs:295-301 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_texture_2d.rs:338-344 — before extracting anything, compare `webrender/swgl/src/shaders/brush_blend.rs` and `webrender/swgl/src/shaders/brush_blend_alpha_pass.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 30) dll/src/desktop/shell2/linux/wayland/defines.rs:763 — dll/src/desktop/shell2/linux/wayland/defines.rs:763-779 | dll/src/desktop/shell2/linux/wayland/defines.rs:804-825 | dll/src/desktop/shell2/linux/wayland/defines.rs:851-867 | dll/src/desktop/shell2/linux/wayland/defines.rs:944-960 | dll/src/desktop/shell2/linux/wayland/defines.rs:1059-1064 | dll/src/desktop/shell2/linux/wayland/defines.rs:1127-1143 | dll/src/desktop/shell2/linux/wayland/defines.rs:1168-1189 | dll/src/desktop/shell2/linux/wayland/defines.rs:1236-1241 | dll/src/desktop/shell2/linux/wayland/defines.rs:1293-1298 | dll/src/desktop/shell2/linux/wayland/defines.rs:1350-1355 | dll/src/desktop/shell2/linux/wayland/defines.rs:1469-1474 | dll/src/desktop/shell2/linux/wayland/defines.rs:1507-1523 | dll/src/desktop/shell2/linux/wayland/defines.rs:1625-1631 | dll/src/desktop/shell2/linux/wayland/defines.rs:1651-1668 | dll/src/desktop/shell2/linux/wayland/defines.rs:1959-1964 | dll/src/desktop/shell2/linux/wayland/defines.rs:2011-2016 | dll/src/desktop/shell2/linux/wayland/defines.rs:2042-2058 | dll/src/desktop/shell2/linux/wayland/defines.rs:2113-2118 | dll/src/desktop/shell2/linux/wayland/defines.rs:2185-2190 | dll/src/desktop/shell2/linux/wayland/defines.rs:2240-2245 | dll/src/desktop/shell2/linux/wayland/defines.rs:2367-2372 | dll/src/desktop/shell2/linux/wayland/defines.rs:2391-2412 | dll/src/desktop/shell2/linux/wayland/defines.rs:2426-2442 | dll/src/desktop/shell2/linux/wayland/defines.rs:2586-2602 | dll/src/desktop/shell2/linux/wayland/defines.rs:2629-2647 | dll/src/desktop/shell2/linux/wayland/defines.rs:2662-2683 | dll/src/desktop/shell2/linux/wayland/defines.rs:2865-2881 | dll/src/desktop/shell2/linux/wayland/defines.rs:2928-2950 | dll/src/desktop/shell2/linux/wayland/defines.rs:2982-2998 | dll/src/desktop/shell2/linux/wayland/defines.rs:3035-3040 — all 30 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/defines.rs:763` it does not close everything it opens, so those 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, `dll/src/desktop/shell2/linux/wayland/defines.rs:1507` calls `leak` and `dll/src/desktop/shell2/linux/wayland/defines.rs:1059` 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.
R10 · Code Duplication · Duplicated block (10 lines × 2 locations) · ×2
  • Duplicated block (10 lines × 2 locations) dll/src/desktop/shell2/common/debugger/debugger.js:2255 — dll/src/desktop/shell2/common/debugger/debugger.js:2255 · dll/src/desktop/shell2/common/debugger/debugger.js:2580 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (10 lines × 2 locations) dll/src/desktop/shell2/common/debugger/debugger.js:2572 — dll/src/desktop/shell2/common/debugger/debugger.js:2572 · dll/src/desktop/shell2/common/debugger/debugger.js:2929 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
AXI1 · Runtime container hardening · Container process runs as root · ×1
  • Container process runs as root: azul-telemetry-vm — 'azul-telemetry-vm' (docker.io/victoriametrics/victoria-metrics:v1.111.0) runs as uid 0 — no user was specified, or one resolving to root was. Observed on the running container, which is the only place the answer is settled: an image's own USER, a base image's inherited one and a compose override are all invisible to a REDACTED reader. Advisory evidence for CRA Annex I (2)(b).
D1 · Cyclomatic Complexity · BatchBuilder · ×1
  • BatchBuilder::add_prim_to_batch (cyclomatic 131) webrender/core/src/batch.rs:815 — BatchBuilder::add_prim_to_batch has cyclomatic complexity 131 (threshold 15). To reduce it, separate the cases: extract each independent 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 · HeadlessWindow · ×1
  • HeadlessWindow::run (cyclomatic 92) dll/src/desktop/shell2/headless/mod.rs:2258 — HeadlessWindow::run has cyclomatic complexity 92 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CpuBackend · ×1
  • CpuBackend::render_frame (cyclomatic 88) dll/src/desktop/shell2/headless/mod.rs:549 — CpuBackend::render_frame has cyclomatic complexity 88 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · RenderTaskKind · ×1
  • RenderTaskKind::write_gpu_blocks (cyclomatic 67) webrender/core/src/render_task.rs:761 — RenderTaskKind::write_gpu_blocks 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.
D1 · Cyclomatic Complexity · FilterGraphOpKey · ×1
  • FilterGraphOpKey::from (cyclomatic 58) webrender/core/src/prim_store/picture.rs:619 — FilterGraphOpKey::from has cyclomatic complexity 58 (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 · DisplayListItem · ×1
  • DisplayListItem::is_visually_equal (cyclomatic 55) layout/src/solver3/display_list.rs:1883 — DisplayListItem::is_visually_equal has cyclomatic complexity 55 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · CssProperty · ×1
  • CssProperty::interpolate (cyclomatic 50) css/src/props/property.rs:4900 — CssProperty::interpolate has cyclomatic complexity 50 (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: azul_css::props::property::parse_css_property (cyclomatic 195) 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 · PictureCompositeKey · ×1
  • PictureCompositeKey::from (cyclomatic 50) webrender/core/src/prim_store/picture.rs:1086 — PictureCompositeKey::from has cyclomatic complexity 50 (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 · azul-search.mount (cyclomatic 48) · ×1
  • azul-search.mount (cyclomatic 48) doc/templates/azul-search.js:559 — azul-search.mount has cyclomatic complexity 48 (threshold 15). Of this number, 25 points are the body's own statements and 23 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RenderTaskGraphBuilder · ×1
  • RenderTaskGraphBuilder::end_frame (cyclomatic 41) webrender/core/src/render_task_graph.rs:258 — RenderTaskGraphBuilder::end_frame has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Xml · ×1
  • Xml::scan_node (cyclomatic 37) core/src/xml.rs:414 — Xml::scan_node has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: azul_core::xml::tag_to_node_type (cyclomatic 170) 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 · LazilyCompiledShader · ×1
  • LazilyCompiledShader::get_internal (cyclomatic 37) webrender/core/src/renderer/shade.rs:180 — LazilyCompiledShader::get_internal has cyclomatic complexity 37 (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 · ModulePlan · ×1
  • ModulePlan::build (cyclomatic 33) doc/src/codegen/v2/module_plan.rs:84 — ModulePlan::build has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · A11ySnapshot · ×1
  • A11ySnapshot::build (cyclomatic 33) layout/src/managers/a11y_snapshot.rs:142 — A11ySnapshot::build has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · showComponentDetail (cyclomatic 33) · ×1
  • showComponentDetail (cyclomatic 33) dll/src/desktop/shell2/common/debugger/debugger.js:2265 — showComponentDetail has cyclomatic complexity 33 (threshold 15). Of this number, 26 points are the body's own statements and 7 belong to 18 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _renderTreeNode (cyclomatic 30) · ×1
  • _renderTreeNode (cyclomatic 30) dll/src/desktop/shell2/common/debugger/debugger.js:656 — _renderTreeNode has cyclomatic complexity 30 (threshold 15). Of this number, 29 points are the body's own statements and 1 belongs to 5 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · render (cyclomatic 30) · ×1
  • render (cyclomatic 30) dll/src/desktop/shell2/common/debugger/debugger.js:4113 — render has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 4 of the 30 points are its own statements and the rest belongs to 16 function items inside it that branch (buildNode, a function literal at line 4205, a function literal at line 4130, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · WaylandPopup · ×1
  • WaylandPopup::render_if_ready (cyclomatic 28) dll/src/desktop/shell2/linux/wayland/mod.rs:9622 — WaylandPopup::render_if_ready 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 · SurfaceBuilder · ×1
  • SurfaceBuilder::pop_surface (cyclomatic 28) webrender/core/src/surface.rs:306 — SurfaceBuilder::pop_surface 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.
D1 · Cyclomatic Complexity · CsSvgFilterNodeFrag · ×1
  • CsSvgFilterNodeFrag::main (cyclomatic 28) webrender/swgl/src/shaders/cs_svg_filter_node.rs:239 — CsSvgFilterNodeFrag::main 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.
D1 · Cyclomatic Complexity · TypeResolver · ×1
  • TypeResolver::check_type_c_compatibility_with_index (cyclomatic 27) doc/src/autofix/type_resolver.rs:434 — TypeResolver::check_type_c_compatibility_with_index has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · chrome_layout_extractor.allElements.forEach() (cyclomatic 27) · ×1
  • chrome_layout_extractor.allElements.forEach() (cyclomatic 27) doc/src/reftest/chrome_layout_extractor.js:22 — chrome_layout_extractor.allElements.forEach() has cyclomatic complexity 27 (threshold 15). Of this number, 23 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · azul-search.scoreEntry (cyclomatic 27) · ×1
  • azul-search.scoreEntry (cyclomatic 27) doc/templates/azul-search.js:61 — azul-search.scoreEntry has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _loop (cyclomatic 27) · ×1
  • _loop (cyclomatic 27) dll/src/desktop/shell2/common/debugger/debugger.js:4572 — _loop has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SceneBuilderThread · ×1
  • SceneBuilderThread::run (cyclomatic 26) webrender/core/src/scene_builder_thread.rs:304 — SceneBuilderThread::run 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 · BrushImageAdvancedBlendAlphaPassAntialiasingRepetitionTexture2DVert · ×1
  • BrushImageAdvancedBlendAlphaPassAntialiasingRepetitionTexture2DVert::brush_vs (cyclomatic 26) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:149 — BrushImageAdvancedBlendAlphaPassAntialiasingRepetitionTexture2DVert::brush_vs 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 · BrushImageAdvancedBlendAlphaPassAntialiasingRepetitionTextureRectVert · ×1
  • BrushImageAdvancedBlendAlphaPassAntialiasingRepetitionTextureRectVert::brush_vs (cyclomatic 26) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:151 — BrushImageAdvancedBlendAlphaPassAntialiasingRepetitionTextureRectVert::brush_vs 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 · BrushImageAdvancedBlendAlphaPassTexture2DVert · ×1
  • BrushImageAdvancedBlendAlphaPassTexture2DVert::brush_vs (cyclomatic 26) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:137 — BrushImageAdvancedBlendAlphaPassTexture2DVert::brush_vs 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 · Vert · ×1
  • Vert::brush_vs (cyclomatic 26) webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:142 — Vert::brush_vs 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 · BrushImageAlphaPassAntialiasingDualSourceBlendingRepetitionTextureRectVert · ×1
  • BrushImageAlphaPassAntialiasingDualSourceBlendingRepetitionTextureRectVert::brush_vs (cyclomatic 26) webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:127 — BrushImageAlphaPassAntialiasingDualSourceBlendingRepetitionTextureRectVert::brush_vs 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 · render (cyclomatic 26) · ×1
  • render (cyclomatic 26) dll/src/desktop/shell2/common/debugger/debugger.js:3449 — render 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 · webrender_build · ×1
  • webrender_build::shader_features::get_shader_features (cyclomatic 25) webrender/build/src/shader_features.rs:60 — webrender_build::shader_features::get_shader_features 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 · ComponentFieldType · ×1
  • ComponentFieldType::parse_depth (cyclomatic 24) core/src/xml.rs:1511 — ComponentFieldType::parse_depth has cyclomatic complexity 24 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: azul_core::xml::tag_to_node_type (cyclomatic 170) 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 · Ribbon · ×1
  • Ribbon::build_chrome (cyclomatic 24) layout/src/widgets/ribbon.rs:3210 — Ribbon::build_chrome 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 · TileNode · ×1
  • TileNode::maybe_merge_or_split (cyclomatic 24) webrender/core/src/picture.rs:7714 — TileNode::maybe_merge_or_split has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ctxCreateComponentFromSubtree (cyclomatic 24) · ×1
  • ctxCreateComponentFromSubtree (cyclomatic 24) dll/src/desktop/shell2/common/debugger/debugger.js:1943 — ctxCreateComponentFromSubtree has cyclomatic complexity 24 (threshold 15). Of this number, 16 points are the body's own statements and 8 belong to 8 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ConformancePlan · ×1
  • ConformancePlan::build (cyclomatic 23) doc/src/codegen/v2/conformance/mod.rs:147 — ConformancePlan::build 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 · Cpp17Generator · ×1
  • Cpp17Generator::generate_method_implementations (cyclomatic 23) doc/src/codegen/v2/lang_cpp/cpp17.rs:277 — Cpp17Generator::generate_method_implementations 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 · ParsedFont · ×1
  • ParsedFont::from_provider (cyclomatic 23) layout/src/font.rs:1011 — ParsedFont::from_provider has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DenseText · ×1
  • DenseText::from_unified_with_content (cyclomatic 23) layout/src/text3/dense.rs:223 — DenseText::from_unified_with_content 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 · Tile · ×1
  • Tile::post_update (cyclomatic 23) webrender/core/src/picture.rs:1117 — Tile::post_update 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. This is NOT this file's highest cyclomatic complexity: PictureCompositeMode::kind (cyclomatic 24) 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 · debugger._parseSlashCommand (cyclomatic 23) · ×1
  • debugger._parseSlashCommand (cyclomatic 23) dll/src/desktop/shell2/common/debugger/debugger.js:4753 — debugger._parseSlashCommand 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 · azul-search.renderResults (cyclomatic 23) · ×1
  • azul-search.renderResults (cyclomatic 23) doc/templates/azul-search.js:501 — azul-search.renderResults 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 · SegmentBuilder · ×1
  • SegmentBuilder::build (cyclomatic 22) webrender/core/src/segment.rs:458 — SegmentBuilder::build 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 · renderNodeDetail (cyclomatic 22) · ×1
  • renderNodeDetail (cyclomatic 22) dll/src/desktop/shell2/common/debugger/debugger.js:795 — renderNodeDetail has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _loadComponentPreview (cyclomatic 22) · ×1
  • _loadComponentPreview (cyclomatic 22) dll/src/desktop/shell2/common/debugger/debugger.js:2590 — _loadComponentPreview has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · open (cyclomatic 22) · ×1
  • open (cyclomatic 22) dll/src/desktop/shell2/common/debugger/debugger.js:4400 — open has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 8 of the 22 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 4452, 4507, 4417, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · PixelValue · ×1
  • PixelValue::resolve_with_context (cyclomatic 21) css/src/props/basic/pixel.rs:609 — PixelValue::resolve_with_context 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 · SymbolTable · ×1
  • SymbolTable::assign_synthetic_addresses (cyclomatic 21) dll/src/web/symbol_table.rs:756 — SymbolTable::assign_synthetic_addresses has cyclomatic complexity 21 (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 · CPUView · ×1
  • CPUView::update_framebuffer (cyclomatic 21) dll/src/desktop/shell2/macos/mod.rs:2650 — CPUView::update_framebuffer has cyclomatic complexity 21 (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: azul_dll::desktop::shell2::macos::macos_event_name (cyclomatic 24) 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 · init (cyclomatic 21) · ×1
  • init (cyclomatic 21) dll/src/desktop/shell2/common/debugger/debugger.js:196 — init has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Cpp03Generator · ×1
  • Cpp03Generator::generate_method_implementations (cyclomatic 20) doc/src/codegen/v2/lang_cpp/cpp03.rs:236 — Cpp03Generator::generate_method_implementations 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 · TextShapingCache · ×1
  • TextShapingCache::measure_intrinsic_widths (cyclomatic 20) layout/src/text3/cache.rs:8146 — TextShapingCache::measure_intrinsic_widths 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 · BrushImageAntialiasingRepetitionTexture2DVert · ×1
  • BrushImageAntialiasingRepetitionTexture2DVert::brush_vs (cyclomatic 20) webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:147 — BrushImageAntialiasingRepetitionTexture2DVert::brush_vs 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 · BrushImageAntialiasingRepetitionTextureRectVert · ×1
  • BrushImageAntialiasingRepetitionTextureRectVert::brush_vs (cyclomatic 20) webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:147 — BrushImageAntialiasingRepetitionTextureRectVert::brush_vs 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 · azul-search.resolveDefaults (cyclomatic 20) · ×1
  • azul-search.resolveDefaults (cyclomatic 20) doc/templates/azul-search.js:459 — azul-search.resolveDefaults has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, 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 · _loadNodeClipInfo (cyclomatic 20) · ×1
  • _loadNodeClipInfo (cyclomatic 20) dll/src/desktop/shell2/common/debugger/debugger.js:1313 — _loadNodeClipInfo has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · _addCollapsible (cyclomatic 20) · ×1
  • _addCollapsible (cyclomatic 20) dll/src/desktop/shell2/common/debugger/debugger.js:3335 — _addCollapsible has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GlShader · ×1
  • GlShader::draw (cyclomatic 19) core/src/gl.rs:4236 — GlShader::draw 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 · GenE2eOptions · ×1
  • GenE2eOptions::parse (cyclomatic 19) doc/src/gene2e.rs:175 — GenE2eOptions::parse 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.
D1 · Cyclomatic Complexity · StyleProperties · ×1
  • StyleProperties::apply_override (cyclomatic 19) layout/src/text3/cache.rs:4979 — StyleProperties::apply_override has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ImageData · ×1
  • ImageData::update (cyclomatic 19) webrender/core/src/prim_store/image.rs:121 — ImageData::update 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 · report_template.html.createTestCard (cyclomatic 19) · ×1
  • report_template.html.createTestCard (cyclomatic 19) doc/src/reftest/report_template.html:519 — report_template.html.createTestCard has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · exportCode (cyclomatic 19) · ×1
  • exportCode (cyclomatic 19) dll/src/desktop/shell2/common/debugger/debugger.js:1588 — exportCode 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 · PathParser · ×1
  • PathParser::parse_number (cyclomatic 18) core/src/path_parser.rs:131 — PathParser::parse_number 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 · TransientWindowConfig · ×1
  • TransientWindowConfig::apply_attr (cyclomatic 18) core/src/transient.rs:286 — TransientWindowConfig::apply_attr 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.
D1 · Cyclomatic Complexity · Cpp11Generator · ×1
  • Cpp11Generator::generate_method_implementations (cyclomatic 18) doc/src/codegen/v2/lang_cpp/cpp11.rs:146 — Cpp11Generator::generate_method_implementations 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 · WorkspaceIndex · ×1
  • WorkspaceIndex::build_with_verbosity (cyclomatic 18) doc/src/patch/index.rs:519 — WorkspaceIndex::build_with_verbosity has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · FluentLocaleBundle · ×1
  • FluentLocaleBundle::format (cyclomatic 18) layout/src/fluent.rs:218 — FluentLocaleBundle::format 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.
D1 · Cyclomatic Complexity · PrimitiveComparer · ×1
  • PrimitiveComparer::compare_prim (cyclomatic 18) webrender/core/src/picture.rs:7450 — PrimitiveComparer::compare_prim 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: PictureCompositeMode::kind (cyclomatic 24) 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 · Profiler · ×1
  • Profiler::append_to_ui (cyclomatic 18) webrender/core/src/profiler.rs:1341 — Profiler::append_to_ui has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent 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 · azul-search.mount.onGlobalKey (cyclomatic 18) · ×1
  • azul-search.mount.onGlobalKey (cyclomatic 18) doc/templates/azul-search.js:785 — azul-search.mount.onGlobalKey has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _loadNodeBoxModel (cyclomatic 18) · ×1
  • _loadNodeBoxModel (cyclomatic 18) dll/src/desktop/shell2/common/debugger/debugger.js:1204 — _loadNodeBoxModel has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: render (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · SystemStyleDependencies · ×1
  • SystemStyleDependencies::dom_depends_on_change (cyclomatic 17) core/src/callbacks.rs:1217 — SystemStyleDependencies::dom_depends_on_change has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · StyledDom · ×1
  • StyledDom::restyle_on_state_change (cyclomatic 17) core/src/styled_dom.rs:2153 — StyledDom::restyle_on_state_change 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 · VecContents · ×1
  • VecContents::insert_from_css_property (cyclomatic 17) css/src/codegen/format.rs:207 — VecContents::insert_from_css_property 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: azul_css::codegen::format::format_style_filter (cyclomatic 22) 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 · AndroidAccessibilityAdapter · ×1
  • AndroidAccessibilityAdapter::describe_node (cyclomatic 17) dll/src/desktop/shell2/android/accessibility.rs:166 — AndroidAccessibilityAdapter::describe_node has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TypeDefinition · ×1
  • TypeDefinition::expand_macro_generated (cyclomatic 17) doc/src/autofix/type_index.rs:205 — TypeDefinition::expand_macro_generated 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 · A11yTreeMirror · ×1
  • A11yTreeMirror::apply (cyclomatic 17) layout/src/managers/a11y.rs:178 — A11yTreeMirror::apply has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: A11yManager::node_type_to_role (cyclomatic 74) 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 · TransientWindowManager · ×1
  • TransientWindowManager::reconcile (cyclomatic 17) layout/src/transient.rs:836 — TransientWindowManager::reconcile 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 · update (cyclomatic 17) · ×1
  • update (cyclomatic 17) dll/src/desktop/shell2/common/debugger/debugger.js:4004 — update has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: render (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · DxgiCapture · ×1
  • DxgiCapture::read (cyclomatic 16) dll/src/desktop/extra/screencap/windows.rs:286 — DxgiCapture::read has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · VtDecoder · ×1
  • VtDecoder::decode (cyclomatic 16) dll/src/desktop/extra/video_codec/videotoolbox.rs:903 — VtDecoder::decode has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EnhancedXmlParser · ×1
  • EnhancedXmlParser::extract_head_metadata (cyclomatic 16) doc/src/reftest/mod.rs:1219 — EnhancedXmlParser::extract_head_metadata 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 · VirtualViewState · ×1
  • VirtualViewState::scroll_demand (cyclomatic 16) layout/src/managers/virtual_view.rs:613 — VirtualViewState::scroll_demand has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · debugger._extractBase64Image (cyclomatic 16) · ×1
  • debugger._extractBase64Image (cyclomatic 16) dll/src/desktop/shell2/common/debugger/debugger.js:4737 — debugger._extractBase64Image has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · azul-search.compositeAdapter.load (cyclomatic 16) · ×1
  • azul-search.compositeAdapter.load (cyclomatic 16) doc/templates/azul-search.js:331 — azul-search.compositeAdapter.load has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 344, 362, 369, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · updateStepParamsForm (cyclomatic 16) · ×1
  • updateStepParamsForm (cyclomatic 16) dll/src/desktop/shell2/common/debugger/debugger.js:1095 — updateStepParamsForm has cyclomatic complexity 16 (threshold 15). Of this number, 8 points are the body's own statements and 8 belong to 6 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: render (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _buildPlaceholderTree (cyclomatic 16) · ×1
  • _buildPlaceholderTree (cyclomatic 16) dll/src/desktop/shell2/common/debugger/debugger.js:2682 — _buildPlaceholderTree has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 2686). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest. This is NOT this file's highest cyclomatic complexity: render (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · render (cyclomatic 16) · ×1
  • render (cyclomatic 16) dll/src/desktop/shell2/common/debugger/debugger.js:4269 — render has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 4275, 4303). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest. This is NOT this file's highest cyclomatic complexity: render (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D12 · Dependency Hygiene · No Gemfile.lock committed by an application · ×1
  • No Gemfile.lock committed by an application — This repository declares 1 gem(s) across 1 Bundler manifest(s) and ships no application `.gemspec`, so it is an APPLICATION — but no `Gemfile.lock` is committed. Nothing records the versions a working build resolved to, so `bundle install` re-resolves against whatever rubygems.org serves today and two deploys of this commit are not guaranteed to be the same deploy. Run `bundle install` and commit the resulting `Gemfile.lock`. (A published GEM correctly omits its lock, which is why this is asked only of a repository that ships no .gemspec.)
D2 · Cognitive Complexity · BatchBuilder · ×1
  • BatchBuilder::add_prim_to_batch (cognitive 257) webrender/core/src/batch.rs:815 — BatchBuilder::add_prim_to_batch has cognitive complexity 257 (threshold 15). Drivers by points: if/else 71 (125 pts), match/switch 28 (77 pts), loops 14 (43 pts), boolean chains 12 (nesting depth added 132). To reduce it, split the body into named stages: move each independent 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 · HeadlessWindow · ×1
  • HeadlessWindow::run (cognitive 220) dll/src/desktop/shell2/headless/mod.rs:2258 — HeadlessWindow::run has cognitive complexity 220 (threshold 15). Drivers by points: if/else 59 (185 pts), match/switch 8 (25 pts), loops 4 (7 pts), boolean chains 3 (nesting depth added 146). To reduce it, split the body into named stages: move each independent 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 · CpuBackend · ×1
  • CpuBackend::render_frame (cognitive 118) dll/src/desktop/shell2/headless/mod.rs:549 — CpuBackend::render_frame has cognitive complexity 118 (threshold 15). Drivers by points: if/else 50 (66 pts), match/switch 13 (25 pts), boolean chains 20, loops 3 (7 pts) (nesting depth added 32). 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 · RenderTaskGraphBuilder · ×1
  • RenderTaskGraphBuilder::end_frame (cognitive 94) webrender/core/src/render_task_graph.rs:258 — RenderTaskGraphBuilder::end_frame has cognitive complexity 94 (threshold 15). Drivers by points: if/else 16 (49 pts), loops 15 (27 pts), match/switch 4 (16 pts), boolean chains 2 (nesting depth added 57). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · A11ySnapshot · ×1
  • A11ySnapshot::build (cognitive 78) layout/src/managers/a11y_snapshot.rs:142 — A11ySnapshot::build has cognitive complexity 78 (threshold 15). Drivers by points: if/else 15 (45 pts), loops 7 (16 pts), match/switch 4 (15 pts), boolean chains 2 (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 · RenderTask · ×1
  • RenderTask::new_svg_filter_graph (cognitive 75) webrender/core/src/render_task.rs:1643 — RenderTask::new_svg_filter_graph has cognitive complexity 75 (threshold 15). Drivers by points: if/else 20 (49 pts), match/switch 5 (10 pts), loops 4 (9 pts), boolean chains 7 (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.
D2 · Cognitive Complexity · SurfaceBuilder · ×1
  • SurfaceBuilder::pop_surface (cognitive 70) webrender/core/src/surface.rs:306 — SurfaceBuilder::pop_surface has cognitive complexity 70 (threshold 15). Drivers by points: match/switch 11 (38 pts), loops 7 (23 pts), if/else 4 (9 pts) (nesting depth added 48). 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 · WaylandPopup · ×1
  • WaylandPopup::render_if_ready (cognitive 62) dll/src/desktop/shell2/linux/wayland/mod.rs:9622 — WaylandPopup::render_if_ready has cognitive complexity 62 (threshold 15). Drivers by points: if/else 25 (49 pts), loops 1 (6 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ModulePlan · ×1
  • ModulePlan::build (cognitive 62) doc/src/codegen/v2/module_plan.rs:84 — ModulePlan::build has cognitive complexity 62 (threshold 15). Drivers by points: if/else 13 (34 pts), loops 15 (21 pts), match/switch 2 (4 pts), boolean chains 3 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Xml · ×1
  • Xml::scan_node (cognitive 59) core/src/xml.rs:414 — Xml::scan_node has cognitive complexity 59 (threshold 15). Drivers by points: if/else 27 (49 pts), loops 3 (8 pts), boolean chains 1, match/switch 1 (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 · azul-search.mount (cognitive 57) · ×1
  • azul-search.mount (cognitive 57) doc/templates/azul-search.js:559 — azul-search.mount has cognitive complexity 57 (threshold 15). Drivers by points: if/else 30 (42 pts), boolean chains 12, ternaries 2, loops 1 (nesting depth added 12). Of this number, 22 points are the body's own statements and 35 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · debugger._parseSlashCommand (cognitive 48) · ×1
  • debugger._parseSlashCommand (cognitive 48) dll/src/desktop/shell2/common/debugger/debugger.js:4753 — debugger._parseSlashCommand has cognitive complexity 48 (threshold 15). Drivers by points: if/else 17 (28 pts), error handling 2 (10 pts), loops 3 (5 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RenderTaskKind · ×1
  • RenderTaskKind::write_gpu_blocks (cognitive 47) webrender/core/src/render_task.rs:761 — RenderTaskKind::write_gpu_blocks has cognitive complexity 47 (threshold 15). Drivers by points: if/else 11 (34 pts), loops 2 (8 pts), match/switch 3 (5 pts) (nesting depth added 31). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · BrushImageAdvancedBlendAlphaPassAntialiasingRepetitionTexture2DVert · ×1
  • BrushImageAdvancedBlendAlphaPassAntialiasingRepetitionTexture2DVert::brush_vs (cognitive 43) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:149 — BrushImageAdvancedBlendAlphaPassAntialiasingRepetitionTexture2DVert::brush_vs has cognitive complexity 43 (threshold 15). Drivers by points: if/else 19 (39 pts), boolean chains 2, match/switch 2 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · BrushImageAdvancedBlendAlphaPassAntialiasingRepetitionTextureRectVert · ×1
  • BrushImageAdvancedBlendAlphaPassAntialiasingRepetitionTextureRectVert::brush_vs (cognitive 43) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:151 — BrushImageAdvancedBlendAlphaPassAntialiasingRepetitionTextureRectVert::brush_vs has cognitive complexity 43 (threshold 15). Drivers by points: if/else 19 (39 pts), boolean chains 2, match/switch 2 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · BrushImageAdvancedBlendAlphaPassTexture2DVert · ×1
  • BrushImageAdvancedBlendAlphaPassTexture2DVert::brush_vs (cognitive 43) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:137 — BrushImageAdvancedBlendAlphaPassTexture2DVert::brush_vs has cognitive complexity 43 (threshold 15). Drivers by points: if/else 19 (39 pts), boolean chains 2, match/switch 2 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Vert · ×1
  • Vert::brush_vs (cognitive 43) webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:142 — Vert::brush_vs has cognitive complexity 43 (threshold 15). Drivers by points: if/else 19 (39 pts), boolean chains 2, match/switch 2 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · BrushImageAlphaPassAntialiasingDualSourceBlendingRepetitionTextureRectVert · ×1
  • BrushImageAlphaPassAntialiasingDualSourceBlendingRepetitionTextureRectVert::brush_vs (cognitive 43) webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:127 — BrushImageAlphaPassAntialiasingDualSourceBlendingRepetitionTextureRectVert::brush_vs has cognitive complexity 43 (threshold 15). Drivers by points: if/else 19 (39 pts), boolean chains 2, match/switch 2 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Cpp03Generator · ×1
  • Cpp03Generator::generate_method_implementations (cognitive 42) doc/src/codegen/v2/lang_cpp/cpp03.rs:236 — Cpp03Generator::generate_method_implementations has cognitive complexity 42 (threshold 15). Drivers by points: if/else 19 (33 pts), boolean chains 6, loops 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _addCollapsible (cognitive 42) · ×1
  • _addCollapsible (cognitive 42) dll/src/desktop/shell2/common/debugger/debugger.js:3335 — _addCollapsible has cognitive complexity 42 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 4 (14 pts), ternaries 8 (11 pts), boolean chains 1 (nesting depth added 20). Of this number, 35 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BrushImageAntialiasingRepetitionTexture2DVert · ×1
  • BrushImageAntialiasingRepetitionTexture2DVert::brush_vs (cognitive 41) webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:147 — BrushImageAntialiasingRepetitionTexture2DVert::brush_vs has cognitive complexity 41 (threshold 15). Drivers by points: if/else 19 (39 pts), boolean chains 2 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · BrushImageAntialiasingRepetitionTextureRectVert · ×1
  • BrushImageAntialiasingRepetitionTextureRectVert::brush_vs (cognitive 41) webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:147 — BrushImageAntialiasingRepetitionTextureRectVert::brush_vs has cognitive complexity 41 (threshold 15). Drivers by points: if/else 19 (39 pts), boolean chains 2 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · showComponentDetail (cognitive 40) · ×1
  • showComponentDetail (cognitive 40) dll/src/desktop/shell2/common/debugger/debugger.js:2265 — showComponentDetail has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 15, ternaries 1 (2 pts) (nesting depth added 8). Of this number, 28 points are the body's own statements and 12 belong to 18 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImageData · ×1
  • ImageData::update (cognitive 39) webrender/core/src/prim_store/image.rs:121 — ImageData::update has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (30 pts), loops 2 (5 pts), boolean chains 2, match/switch 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CPUView · ×1
  • CPUView::update_framebuffer (cognitive 38) dll/src/desktop/shell2/macos/mod.rs:2650 — CPUView::update_framebuffer has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 5 (15 pts), boolean chains 7 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _renderTreeNode (cognitive 37) · ×1
  • _renderTreeNode (cognitive 37) dll/src/desktop/shell2/common/debugger/debugger.js:656 — _renderTreeNode has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 10, ternaries 5 (6 pts) (nesting depth added 6). Of this number, 34 points are the body's own statements and 3 belong to 5 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · PathParser · ×1
  • PathParser::parse_number (cognitive 36) core/src/path_parser.rs:131 — PathParser::parse_number has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (27 pts), loops 3 (6 pts), boolean chains 3 (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 · EnhancedXmlParser · ×1
  • EnhancedXmlParser::extract_head_metadata (cognitive 36) doc/src/reftest/mod.rs:1219 — EnhancedXmlParser::extract_head_metadata has cognitive complexity 36 (threshold 15). Drivers by points: if/else 5 (20 pts), match/switch 4 (12 pts), loops 2 (4 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TransientWindowManager · ×1
  • TransientWindowManager::reconcile (cognitive 36) layout/src/transient.rs:836 — TransientWindowManager::reconcile has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (30 pts), boolean chains 4, loops 2 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PrimitiveComparer · ×1
  • PrimitiveComparer::compare_prim (cognitive 36) webrender/core/src/picture.rs:7450 — PrimitiveComparer::compare_prim has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (33 pts), match/switch 1 (2 pts), loops 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 · SegmentBuilder · ×1
  • SegmentBuilder::build (cognitive 36) webrender/core/src/segment.rs:458 — SegmentBuilder::build has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 5 (8 pts), boolean chains 4, match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · azul-search.resolveDefaults (cognitive 36) · ×1
  • azul-search.resolveDefaults (cognitive 36) doc/templates/azul-search.js:459 — azul-search.resolveDefaults has cognitive complexity 36 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 5 (12 pts), boolean chains 8, ternaries 1 (nesting depth added 16). Of this number, 34 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ApiTypeExtractor · ×1
  • ApiTypeExtractor::extract_from_fn_args_array (cognitive 35) doc/src/autofix/analysis/extractor.rs:58 — ApiTypeExtractor::extract_from_fn_args_array has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (29 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Ribbon · ×1
  • Ribbon::build_chrome (cognitive 35) layout/src/widgets/ribbon.rs:3210 — Ribbon::build_chrome has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (27 pts), match/switch 3 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SceneSpatialTree · ×1
  • SceneSpatialTree::find_scroll_root (cognitive 35) webrender/core/src/spatial_tree.rs:331 — SceneSpatialTree::find_scroll_root has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (24 pts), match/switch 3 (8 pts), boolean chains 2, loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Cpp11Generator · ×1
  • Cpp11Generator::generate_method_implementations (cognitive 34) doc/src/codegen/v2/lang_cpp/cpp11.rs:146 — Cpp11Generator::generate_method_implementations has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 6, loops 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Tile · ×1
  • Tile::post_update (cognitive 34) webrender/core/src/picture.rs:1117 — Tile::post_update has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (21 pts), match/switch 4 (8 pts), boolean chains 4, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConformancePlan · ×1
  • ConformancePlan::build (cognitive 33) doc/src/codegen/v2/conformance/mod.rs:147 — ConformancePlan::build has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 8, match/switch 3 (6 pts), boolean chains 3 (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 · webrender_build · ×1
  • webrender_build::shader_features::get_shader_features (cognitive 33) webrender/build/src/shader_features.rs:60 — webrender_build::shader_features::get_shader_features has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (22 pts), loops 10 (11 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · init (cognitive 33) · ×1
  • init (cognitive 33) dll/src/desktop/shell2/common/debugger/debugger.js:196 — init has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (28 pts), error handling 2 (3 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · azul-search.scoreEntry (cognitive 32) · ×1
  • azul-search.scoreEntry (cognitive 32) doc/templates/azul-search.js:61 — azul-search.scoreEntry has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 6, loops 2 (4 pts), ternaries 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeDefinition · ×1
  • TypeDefinition::expand_macro_generated (cognitive 31) doc/src/autofix/type_index.rs:205 — TypeDefinition::expand_macro_generated has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (28 pts), match/switch 2 (3 pts) (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ClipNodeInfo · ×1
  • ClipNodeInfo::create_instance (cognitive 30) webrender/core/src/clip.rs:979 — ClipNodeInfo::create_instance has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (9 pts), boolean chains 2 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · FrameBuilder · ×1
  • FrameBuilder::render_minimap (cognitive 30) webrender/core/src/frame_builder.rs:720 — FrameBuilder::render_minimap has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (29 pts), boolean chains 1 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · chrome_layout_extractor.allElements.forEach() (cognitive 30) · ×1
  • chrome_layout_extractor.allElements.forEach() (cognitive 30) doc/src/reftest/chrome_layout_extractor.js:22 — chrome_layout_extractor.allElements.forEach() has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 17, if/else 3 (4 pts), error handling 1 (3 pts), loops 1 (3 pts), ternaries 3 (nesting depth added 5). Of this number, 21 points are the body's own statements and 9 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · CpuHitTester · ×1
  • CpuHitTester::rebuild_from_layout_with_gpu (cognitive 28) layout/src/headless.rs:794 — CpuHitTester::rebuild_from_layout_with_gpu has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 4 (6 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PictureCompositeMode · ×1
  • PictureCompositeMode::get_coverage_target_svgfe (cognitive 28) webrender/core/src/picture.rs:4634 — PictureCompositeMode::get_coverage_target_svgfe has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (18 pts), match/switch 2 (5 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QuadTileClassifier · ×1
  • QuadTileClassifier::classify (cognitive 28) webrender/core/src/quad.rs:1188 — QuadTileClassifier::classify has cognitive complexity 28 (threshold 15). Drivers by points: if/else 3 (12 pts), match/switch 3 (9 pts), loops 4 (7 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · renderNodeDetail (cognitive 28) · ×1
  • renderNodeDetail (cognitive 28) dll/src/desktop/shell2/common/debugger/debugger.js:795 — renderNodeDetail has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 4, ternaries 1 (4 pts) (nesting depth added 6). Of this number, 24 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ctxCreateComponentFromSubtree (cognitive 28) · ×1
  • ctxCreateComponentFromSubtree (cognitive 28) dll/src/desktop/shell2/common/debugger/debugger.js:1943 — ctxCreateComponentFromSubtree has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 8, error handling 2 (3 pts) (nesting depth added 4). Of this number, 20 points are the body's own statements and 8 belong to 8 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · GpuStateManager · ×1
  • GpuStateManager::update_scrollbar_transforms (cognitive 27) layout/src/managers/gpu_state.rs:261 — GpuStateManager::update_scrollbar_transforms has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (26 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _loop (cognitive 27) · ×1
  • _loop (cognitive 27) dll/src/desktop/shell2/common/debugger/debugger.js:4572 — _loop has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 9, error handling 1, ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DisplayListItem · ×1
  • DisplayListItem::is_visually_equal (cognitive 26) layout/src/solver3/display_list.rs:1883 — DisplayListItem::is_visually_equal has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 24, if/else 1, match/switch 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · BreakCursor · ×1
  • BreakCursor::peek_next_unit (cognitive 26) layout/src/text3/cache.rs:13779 — BreakCursor::peek_next_unit has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · updateStepParamsForm (cognitive 26) · ×1
  • updateStepParamsForm (cognitive 26) dll/src/desktop/shell2/common/debugger/debugger.js:1095 — updateStepParamsForm has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 3 (8 pts), boolean chains 7 (nesting depth added 8). Most of this is not in the body itself: 8 of the 26 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 1132, 1107, 1120, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · open (cognitive 26) · ×1
  • open (cognitive 26) dll/src/desktop/shell2/common/debugger/debugger.js:4400 — open has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 8 (nesting depth added 5). Most of this is not in the body itself: 7 of the 26 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 4452, 4507, 4417, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · TileCacheBuilder · ×1
  • TileCacheBuilder::add_prim (cognitive 25) webrender/core/src/tile_cache.rs:289 — TileCacheBuilder::add_prim has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 1 (5 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · MapCss · ×1
  • MapCss::parse (cognitive 24) dll/src/desktop/extra/map/svg.rs:107 — MapCss::parse has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AutofixMessages · ×1
  • AutofixMessages::print_report (cognitive 24) doc/src/autofix/message.rs:213 — AutofixMessages::print_report has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 3 (6 pts), boolean chains 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · A11yTreeMirror · ×1
  • A11yTreeMirror::apply (cognitive 24) layout/src/managers/a11y.rs:178 — A11yTreeMirror::apply has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 5 (6 pts), boolean chains 2, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _showTreeContextMenu (cognitive 24) · ×1
  • _showTreeContextMenu (cognitive 24) dll/src/desktop/shell2/common/debugger/debugger.js:2778 — _showTreeContextMenu has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 12). Most of this is not in the body itself: 2 of the 24 points are its own statements and the rest belongs to 7 function items inside it that branch (action::insertAfter, action::removeNode, action, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · Json · ×1
  • Json::jq_all_recursive_depth (cognitive 23) core/src/json.rs:813 — Json::jq_all_recursive_depth has cognitive complexity 23 (threshold 15). Drivers by points: loops 3 (9 pts), if/else 4 (7 pts), match/switch 3 (7 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Surface · ×1
  • Surface::build (cognitive 23) doc/src/lint_examples.rs:341 — Surface::build has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 4 (10 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CssWarningCollector · ×1
  • CssWarningCollector::validate_property (cognitive 23) doc/src/reftest/mod.rs:1444 — CssWarningCollector::validate_property has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (22 pts), match/switch 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · exportCode (cognitive 23) · ×1
  • exportCode (cognitive 23) dll/src/desktop/shell2/common/debugger/debugger.js:1588 — exportCode has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 8, error handling 3, ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · update (cognitive 23) · ×1
  • update (cognitive 23) dll/src/desktop/shell2/common/debugger/debugger.js:4004 — update has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 5 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PatchSummary · ×1
  • PatchSummary::print (cognitive 22) doc/src/autofix/message.rs:357 — PatchSummary::print has cognitive complexity 22 (threshold 15). Drivers by points: loops 6 (13 pts), if/else 5, match/switch 1 (4 pts) (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · CsBorderSegmentFrag · ×1
  • CsBorderSegmentFrag::main (cognitive 22) webrender/swgl/src/shaders/cs_border_segment.rs:301 — CsBorderSegmentFrag::main has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 1, 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 · report_template.html.createTestCard (cognitive 22) · ×1
  • report_template.html.createTestCard (cognitive 22) doc/src/reftest/report_template.html:519 — report_template.html.createTestCard has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 11, ternaries 4 (8 pts), if/else 3 (nesting depth added 4). Of this number, 14 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · _loadNodeClipInfo (cognitive 22) · ×1
  • _loadNodeClipInfo (cognitive 22) dll/src/desktop/shell2/common/debugger/debugger.js:1313 — _loadNodeClipInfo has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 10, if/else 6 (8 pts), ternaries 2 (3 pts), error handling 1 (nesting depth added 3). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · terminalKeydown (cognitive 22) · ×1
  • terminalKeydown (cognitive 22) dll/src/desktop/shell2/common/debugger/debugger.js:3011 — terminalKeydown has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (22 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 · VtDecoder · ×1
  • VtDecoder::decode (cognitive 21) dll/src/desktop/extra/video_codec/videotoolbox.rs:903 — VtDecoder::decode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, match/switch 2 (3 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TypeIndex · ×1
  • TypeIndex::resolve (cognitive 21) doc/src/autofix/type_index.rs:854 — TypeIndex::resolve has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (18 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Ctx · ×1
  • Ctx::plan_classes (cognitive 21) doc/src/codegen/v2/lang_fortran/wrappers.rs:293 — Ctx::plan_classes has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (4 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.
D2 · Cognitive Complexity · OpaqueBatchList · ×1
  • OpaqueBatchList::set_params_and_get_batch (cognitive 21) webrender/core/src/batch.rs:432 — OpaqueBatchList::set_params_and_get_batch has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SpatialTree · ×1
  • SpatialTree::apply_updates (cognitive 21) webrender/core/src/spatial_tree.rs:873 — SpatialTree::apply_updates has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (17 pts), match/switch 2 (3 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · azul-search.renderResults (cognitive 21) · ×1
  • azul-search.renderResults (cognitive 21) doc/templates/azul-search.js:501 — azul-search.renderResults has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 6 (12 pts), boolean chains 5, if/else 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 · _loadComponentPreview (cognitive 21) · ×1
  • _loadComponentPreview (cognitive 21) dll/src/desktop/shell2/common/debugger/debugger.js:2590 — _loadComponentPreview has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 8, error handling 1, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · RawImage · ×1
  • RawImage::paint_dot (cognitive 20) core/src/resources.rs:2324 — RawImage::paint_dot has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), match/switch 2, 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 · SvgNode · ×1
  • SvgNode::is_closed (cognitive 20) core/src/svg.rs:692 — SvgNode::is_closed has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 4 (9 pts), match/switch 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · DxgiCapture · ×1
  • DxgiCapture::read (cognitive 20) dll/src/desktop/extra/screencap/windows.rs:286 — DxgiCapture::read has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 2 (3 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · InputChannel · ×1
  • InputChannel::start (cognitive 20) doc/src/reftest/telegram.rs:336 — InputChannel::start has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HoverManager · ×1
  • HoverManager::remap_node_ids (cognitive 20) layout/src/managers/hover.rs:484 — HoverManager::remap_node_ids has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (13 pts), loops 3 (7 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 · CompactShapedEntry · ×1
  • CompactShapedEntry::build (cognitive 20) layout/src/text3/cache.rs:7057 — CompactShapedEntry::build has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AlphaBatchList · ×1
  • AlphaBatchList::set_params_and_get_batch (cognitive 20) webrender/core/src/batch.rs:329 — AlphaBatchList::set_params_and_get_batch has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 2 (5 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompositeState · ×1
  • CompositeState::push_surface (cognitive 20) webrender/core/src/composite.rs:734 — CompositeState::push_surface has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 4 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Profiler · ×1
  • Profiler::append_to_ui (cognitive 20) webrender/core/src/profiler.rs:1341 — Profiler::append_to_ui has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). Of this number, 19 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent 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 · MfCamera · ×1
  • MfCamera::read (cognitive 19) dll/src/desktop/extra/camera/windows.rs:369 — MfCamera::read has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (17 pts), match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DpiFunctions · ×1
  • DpiFunctions::hwnd_dpi (cognitive 19) dll/src/desktop/shell2/windows/dpi.rs:220 — DpiFunctions::hwnd_dpi has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (17 pts), match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GestureAndDragManager · ×1
  • GestureAndDragManager::detect_click_count_for (cognitive 19) layout/src/managers/gesture.rs:1810 — GestureAndDragManager::detect_click_count_for has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PatchState · ×1
  • PatchState::build (cognitive 19) layout/src/solver3/display_list.rs:3787 — PatchState::build has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · azul-search.mount.onGlobalKey (cognitive 19) · ×1
  • azul-search.mount.onGlobalKey (cognitive 19) doc/templates/azul-search.js:785 — azul-search.mount.onGlobalKey has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 7 (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 · FluentLocalizerHandle · ×1
  • FluentLocalizerHandle::load_from_zip_with_locale (cognitive 18) layout/src/fluent.rs:505 — FluentLocalizerHandle::load_from_zip_with_locale has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 3 (5 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContentOverlay · ×1
  • ContentOverlay::gc_converged_text (cognitive 18) layout/src/overlay.rs:476 — ContentOverlay::gc_converged_text has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (3 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ResolvedContent · ×1
  • ResolvedContent::children_for_node (cognitive 18) layout/src/overlay.rs:593 — ResolvedContent::children_for_node has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 3 (7 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · StyleProperties · ×1
  • StyleProperties::apply_override (cognitive 18) layout/src/text3/cache.rs:4979 — StyleProperties::apply_override has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ClipItemKind · ×1
  • ClipItemKind::get_clip_result (cognitive 18) webrender/core/src/clip.rs:1938 — ClipItemKind::get_clip_result has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 6 (9 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.
D2 · Cognitive Complexity · SwCompositeThread · ×1
  • SwCompositeThread::take_job (cognitive 18) webrender/core/src/compositor/sw_compositor.rs:652 — SwCompositeThread::take_job has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (17 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 · ConicGradientTemplate · ×1
  • ConicGradientTemplate::from (cognitive 18) webrender/core/src/prim_store/gradient/conic.rs:147 — ConicGradientTemplate::from has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LinearGradientTemplate · ×1
  • LinearGradientTemplate::from (cognitive 18) webrender/core/src/prim_store/gradient/linear.rs:358 — LinearGradientTemplate::from has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GradientGpuBlockBuilder · ×1
  • GradientGpuBlockBuilder::build (cognitive 18) webrender/core/src/prim_store/gradient/mod.rs:177 — GradientGpuBlockBuilder::build has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (5 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TextRunPrimitive · ×1
  • TextRunPrimitive::update_font_instance (cognitive 18) webrender/core/src/prim_store/text_run.rs:227 — TextRunPrimitive::update_font_instance has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SceneBuilderThread · ×1
  • SceneBuilderThread::forward_built_transactions (cognitive 18) webrender/core/src/scene_builder_thread.rs:676 — SceneBuilderThread::forward_built_transactions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · azul-search.compositeAdapter.load (cognitive 18) · ×1
  • azul-search.compositeAdapter.load (cognitive 18) doc/templates/azul-search.js:331 — azul-search.compositeAdapter.load has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, if/else 4 (6 pts), loops 3 (4 pts) (nesting depth added 3). None of this is in the body itself: all 18 points belong to 5 function literals inside it that branch (lines 344, 362, 369, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · render · ×1
  • render::buildNode (cognitive 18) dll/src/desktop/shell2/common/debugger/debugger.js:4121 — render::buildNode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 4, ternaries 2 (4 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · runAllServerSide (cognitive 18) · ×1
  • runAllServerSide (cognitive 18) dll/src/desktop/shell2/common/debugger/debugger.js:4687 — runAllServerSide has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, ternaries 1 (2 pts), error handling 1 (nesting depth added 8). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 4698, 4693, 4701, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · CssMatcher · ×1
  • CssMatcher::matches (cognitive 17) core/src/xml.rs:7047 — CssMatcher::matches has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VtEncoder · ×1
  • VtEncoder::encode (cognitive 17) dll/src/desktop/extra/video_codec/videotoolbox.rs:633 — VtEncoder::encode has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), loops 3 (5 pts), boolean chains 2, match/switch 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · WindowsMenuBar · ×1
  • WindowsMenuBar::recursive_construct_menu (cognitive 17) dll/src/desktop/shell2/windows/menu.rs:58 — WindowsMenuBar::recursive_construct_menu has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 2 (6 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RenderContext · ×1
  • RenderContext::build_node_attrs (cognitive 17) dll/src/web/html_render.rs:394 — RenderContext::build_node_attrs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 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 · ChromeCdp · ×1
  • ChromeCdp::send_command (cognitive 17) doc/src/reftest/autodebug.rs:246 — ChromeCdp::send_command has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ScrollbarState · ×1
  • ScrollbarState::hit_test_component (cognitive 17) layout/src/managers/scroll_state.rs:275 — ScrollbarState::hit_test_component has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, match/switch 1 (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · DisplayListBuilder · ×1
  • DisplayListBuilder::push_inline_backgrounds_and_border (cognitive 17) layout/src/solver3/display_list.rs:2898 — DisplayListBuilder::push_inline_backgrounds_and_border has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InstrumentKey · ×1
  • InstrumentKey::with_labels (cognitive 17) layout/src/telemetry/metrics.rs:215 — InstrumentKey::with_labels has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (4 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 · UploadTexturePool · ×1
  • UploadTexturePool::end_frame (cognitive 17) webrender/core/src/renderer/upload.rs:764 — UploadTexturePool::end_frame has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4 (6 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SystemStyleDependencies · ×1
  • SystemStyleDependencies::dom_depends_on_change (cognitive 16) core/src/callbacks.rs:1217 — SystemStyleDependencies::dom_depends_on_change has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, if/else 7. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ChangeAccumulator · ×1
  • ChangeAccumulator::classify_change_scope (cognitive 16) core/src/diff.rs:1929 — ChangeAccumulator::classify_change_scope has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · NodeData · ×1
  • NodeData::calculate_structural_hash (cognitive 16) core/src/dom.rs:3578 — NodeData::calculate_structural_hash has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 2 (4 pts), loops 3 (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 · DragContext · ×1
  • DragContext::remap_node_ids (cognitive 16) core/src/drag.rs:708 — DragContext::remap_node_ids has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 1 (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · GlShader · ×1
  • GlShader::draw (cognitive 16) core/src/gl.rs:4236 — GlShader::draw has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 4 (6 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 · ColorU · ×1
  • ColorU::apca_contrast (cognitive 16) css/src/props/basic/color.rs:777 — ColorU::apca_contrast has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14 (16 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · EglBackend · ×1
  • EglBackend::init (cognitive 16) dll/src/desktop/extra/screencap/dmabuf.rs:238 — EglBackend::init has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 1, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · VideoDecoder · ×1
  • VideoDecoder::flush (cognitive 16) dll/src/desktop/extra/video_codec/mod.rs:730 — VideoDecoder::flush has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (6 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 · AndroidAccessibilityAdapter · ×1
  • AndroidAccessibilityAdapter::describe_node (cognitive 16) dll/src/desktop/shell2/android/accessibility.rs:166 — AndroidAccessibilityAdapter::describe_node has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · KdeIni · ×1
  • KdeIni::parse (cognitive 16) dll/src/desktop/shell2/linux/system_style.rs:897 — KdeIni::parse has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GlContext · ×1
  • GlContext::new (cognitive 16) dll/src/desktop/shell2/linux/wayland/gl.rs:54 — GlContext::new has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TypeParser · ×1
  • TypeParser::parse_inner (cognitive 16) doc/src/autofix/types/parser.rs:190 — TypeParser::parse_inner has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · MethodPlan · ×1
  • MethodPlan::implementation (cognitive 16) doc/src/codegen/v2/lang_ocaml/wrappers.rs:623 — MethodPlan::implementation has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Plan · ×1
  • Plan::header (cognitive 16) doc/src/codegen/v2/lang_swift/wrappers.rs:3746 — Plan::header has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (15 pts), match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SymbolHierarchy · ×1
  • SymbolHierarchy::format (cognitive 16) doc/src/patch/parser.rs:815 — SymbolHierarchy::format has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DebugData · ×1
  • DebugData::format (cognitive 16) doc/src/reftest/mod.rs:1668 — DebugData::format has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · VirtualViewState · ×1
  • VirtualViewState::scroll_demand (cognitive 16) layout/src/managers/virtual_view.rs:613 — VirtualViewState::scroll_demand has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, if/else 7. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ShapeBoundary · ×1
  • ShapeBoundary::from_css_shape (cognitive 16) layout/src/text3/cache.rs:4232 — ShapeBoundary::from_css_shape has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 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 · ClusterFlags · ×1
  • ClusterFlags::classify (cognitive 16) layout/src/text3/cache.rs:5322 — ClusterFlags::classify has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClipBatcher · ×1
  • ClipBatcher::add (cognitive 16) webrender/core/src/batch.rs:3871 — ClipBatcher::add has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Occluders · ×1
  • Occluders::area (cognitive 16) webrender/core/src/composite.rs:1408 — Occluders::area has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (5 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 · Texture · ×1
  • Texture::evict_old_blocks (cognitive 16) webrender/core/src/gpu_cache.rs:546 — Texture::evict_old_blocks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 2 (7 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PictureCompositeKey · ×1
  • PictureCompositeKey::from (cognitive 16) webrender/core/src/prim_store/picture.rs:1086 — PictureCompositeKey::from has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 5 (10 pts), loops 2 (6 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.
D2 · Cognitive Complexity · TextureCache · ×1
  • TextureCache::evict_items_from_cache_if_required (cognitive 16) webrender/core/src/texture_cache.rs:1273 — TextureCache::evict_items_from_cache_if_required has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PsQuadConicGradientVert · ×1
  • PsQuadConicGradientVert::quad_primive_info (cognitive 16) webrender/swgl/src/shaders/ps_quad_conic_gradient.rs:102 — PsQuadConicGradientVert::quad_primive_info has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PsQuadMaskVert · ×1
  • PsQuadMaskVert::quad_primive_info (cognitive 16) webrender/swgl/src/shaders/ps_quad_mask.rs:230 — PsQuadMaskVert::quad_primive_info has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PsQuadRadialGradientVert · ×1
  • PsQuadRadialGradientVert::quad_primitive_info (cognitive 16) webrender/swgl/src/shaders/ps_quad_radial_gradient.rs:86 — PsQuadRadialGradientVert::quad_primitive_info has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _loadNodeBoxModel (cognitive 16) · ×1
  • _loadNodeBoxModel (cognitive 16) dll/src/desktop/shell2/common/debugger/debugger.js:1204 — _loadNodeBoxModel has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 12, if/else 2, error handling 1, ternaries 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · _loadNodeCssProperties (cognitive 16) · ×1
  • _loadNodeCssProperties (cognitive 16) dll/src/desktop/shell2/common/debugger/debugger.js:1266 — _loadNodeCssProperties has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 4, boolean chains 3, error handling 1 (nesting depth added 4). Of this number, 8 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _autoResolvePointers (cognitive 16) · ×1
  • _autoResolvePointers (cognitive 16) dll/src/desktop/shell2/common/debugger/debugger.js:1351 — _autoResolvePointers has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 3, error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 5). Of this number, 11 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 (15 members, 19 shared lines) · ×1
  • Near-duplicate member family (15 members, 19 shared lines) css/src/system.rs:2213 — css/src/system.rs:2213-2261 | css/src/system.rs:2265-2313 | css/src/system.rs:2317-2365 | css/src/system.rs:2369-2417 | css/src/system.rs:2423-2470 | css/src/system.rs:2474-2528 | css/src/system.rs:2532-2577 | css/src/system.rs:2583-2629 | css/src/system.rs:2633-2679 | css/src/system.rs:2683-2728 | css/src/system.rs:2740-2806 | css/src/system.rs:2816-2884 | css/src/system.rs:2890-2935 | css/src/system.rs:2939-2984 | css/src/system.rs:2988-3031 — These 15 members are variants of one another: a block of 19 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 15 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 15 times.
D4 · Code Duplication · Near-duplicate member family (9 members, 29 shared lines) · ×1
  • Near-duplicate member family (9 members, 29 shared lines) dll/src/desktop/shell2/linux/wayland/defines.rs:1920 — dll/src/desktop/shell2/linux/wayland/defines.rs:1920-1971 | dll/src/desktop/shell2/linux/wayland/defines.rs:1972-2023 | dll/src/desktop/shell2/linux/wayland/defines.rs:2024-2065 | dll/src/desktop/shell2/linux/wayland/defines.rs:2126-2197 | dll/src/desktop/shell2/linux/wayland/defines.rs:2253-2379 | dll/src/desktop/shell2/linux/wayland/defines.rs:2532-2566 | dll/src/desktop/shell2/linux/wayland/defines.rs:2568-2609 | dll/src/desktop/shell2/linux/wayland/defines.rs:2611-2654 | dll/src/desktop/shell2/linux/wayland/defines.rs:2959-3005 — These 9 members are variants of one another: a block of 29 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 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
D4 · Code Duplication · Near-duplicate member family (8 members, 23 shared lines) · ×1
  • Near-duplicate member family (8 members, 23 shared lines) dll/src/desktop/shell2/linux/wayland/defines.rs:880 — dll/src/desktop/shell2/linux/wayland/defines.rs:880-925 | dll/src/desktop/shell2/linux/wayland/defines.rs:999-1071 | dll/src/desktop/shell2/linux/wayland/defines.rs:1077-1110 | dll/src/desktop/shell2/linux/wayland/defines.rs:1198-1248 | dll/src/desktop/shell2/linux/wayland/defines.rs:1307-1362 | dll/src/desktop/shell2/linux/wayland/defines.rs:1364-1481 | dll/src/desktop/shell2/linux/wayland/defines.rs:1483-1530 | dll/src/desktop/shell2/linux/wayland/defines.rs:1537-1638 — These 8 members are variants of one another: a block of 23 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication · Near-duplicate member family (6 members, 43 shared lines) · ×1
  • Near-duplicate member family (6 members, 43 shared lines) doc/src/codegen/v2/lang_cpp/cpp03.rs:27 — doc/src/codegen/v2/lang_cpp/cpp03.rs:27-124 | doc/src/codegen/v2/lang_cpp/cpp11.rs:28-134 | doc/src/codegen/v2/lang_cpp/cpp14.rs:23-120 | doc/src/codegen/v2/lang_cpp/cpp17.rs:26-138 | doc/src/codegen/v2/lang_cpp/cpp20.rs:36-145 | doc/src/codegen/v2/lang_cpp/cpp20.rs:432-526 — These 6 members are variants of one another: a block of 43 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Near-duplicate member family (5 members, 28 shared lines) · ×1
  • Near-duplicate member family (5 members, 28 shared lines) dll/src/desktop/shell2/android/mod.rs:441 — dll/src/desktop/shell2/android/mod.rs:441-532 | dll/src/desktop/shell2/ios/mod.rs:1893-1998 | dll/src/desktop/shell2/linux/wayland/mod.rs:6444-6536 | dll/src/desktop/shell2/linux/x11/mod.rs:6172-6276 | dll/src/desktop/shell2/windows/mod.rs:1817-1931 — These 5 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 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Near-duplicate member family (5 members, 15 shared lines) · ×1
  • Near-duplicate member family (5 members, 15 shared lines) layout/src/callbacks.rs:3459 — layout/src/callbacks.rs:3459-3480 | layout/src/callbacks.rs:3484-3505 | layout/src/callbacks.rs:3509-3530 | layout/src/callbacks.rs:3534-3555 | layout/src/callbacks.rs:3559-3580 — These 5 members are variants of one another: a block of 15 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Near-duplicate member family (5 members, 14 shared lines) · ×1
  • Near-duplicate member family (5 members, 14 shared lines) doc/src/codegen/v2/lang_crystal/types.rs:160 — doc/src/codegen/v2/lang_crystal/types.rs:160-209 | doc/src/codegen/v2/lang_d/types.rs:130-166 | doc/src/codegen/v2/lang_julia/types.rs:198-242 | doc/src/codegen/v2/lang_odin/types.rs:144-186 | doc/src/codegen/v2/lang_v/types.rs:149-192 — These 5 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 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Near-duplicate member family (4 members, 113 shared lines) · ×1
  • Near-duplicate member family (4 members, 113 shared lines) doc/src/reftest/autodoc.rs:994 — doc/src/reftest/autodoc.rs:994-1186 | doc/src/reftest/autoreview.rs:614-830 | doc/src/reftest/autoreview.rs:843-1065 | doc/src/reftest/autoreview.rs:1767-1966 — These 4 members are variants of one another: a block of 113 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, 30 shared lines) · ×1
  • Near-duplicate member family (4 members, 30 shared lines) doc/src/codegen/v2/lang_cpp/cpp03.rs:627 — doc/src/codegen/v2/lang_cpp/cpp03.rs:627-670 | doc/src/codegen/v2/lang_cpp/cpp11.rs:549-592 | doc/src/codegen/v2/lang_cpp/cpp17.rs:741-802 | doc/src/codegen/v2/lang_cpp/cpp20.rs:857-898 — These 4 members are variants of one another: a block of 30 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, 27 shared lines) · ×1
  • Near-duplicate member family (4 members, 27 shared lines) doc/src/codegen/v2/lang_cpp/cpp03.rs:132 — doc/src/codegen/v2/lang_cpp/cpp03.rs:132-234 | doc/src/codegen/v2/lang_cpp/cpp11.rs:650-763 | doc/src/codegen/v2/lang_cpp/cpp17.rs:146-275 | doc/src/codegen/v2/lang_cpp/cpp20.rs:623-745 — These 4 members are variants of one another: a block of 27 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, 22 shared lines) · ×1
  • Near-duplicate member family (4 members, 22 shared lines) dll/src/desktop/shell2/linux/wayland/defines.rs:2066 — dll/src/desktop/shell2/linux/wayland/defines.rs:2066-2125 | dll/src/desktop/shell2/linux/wayland/defines.rs:2198-2252 | dll/src/desktop/shell2/linux/wayland/defines.rs:2380-2419 | dll/src/desktop/shell2/linux/wayland/defines.rs:2890-2920 — These 4 members are variants of one another: a block of 22 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, 18 shared lines) · ×1
  • Near-duplicate member family (4 members, 18 shared lines) doc/src/reftest/autodebug.rs:2145 — doc/src/reftest/autodebug.rs:2145-2273 | doc/src/reftest/autodoc.rs:892-985 | doc/src/reftest/autoreview.rs:1100-1215 | doc/src/reftest/autoreview.rs:1536-1654 — 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, 12 shared lines) · ×1
  • Near-duplicate member family (4 members, 12 shared lines) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:336 — webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:336-365 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:339-368 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:345-374 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:338-367 — These 4 members are variants of one another: a block of 12 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Near-duplicate member family (3 members, 49 shared lines) · ×1
  • Near-duplicate member family (3 members, 49 shared lines) doc/src/codegen/v2/lang_node/wrappers.rs:418 — doc/src/codegen/v2/lang_node/wrappers.rs:418-629 | doc/src/codegen/v2/lang_node/wrappers.rs:635-786 | doc/src/codegen/v2/lang_node/wrappers.rs:1102-1267 — These 3 members are variants of one another: a block of 49 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication · Near-duplicate member family (3 members, 34 shared lines) · ×1
  • Near-duplicate member family (3 members, 34 shared lines) doc/src/codegen/v2/lang_csharp/wrappers.rs:72 — doc/src/codegen/v2/lang_csharp/wrappers.rs:72-134 | doc/src/codegen/v2/lang_java/wrappers.rs:1228-1294 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:69-131 — These 3 members are variants of one another: a block of 34 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication · Near-duplicate member family (3 members, 17 shared lines) · ×1
  • Near-duplicate member family (3 members, 17 shared lines) dll/src/desktop/shell2/linux/wayland/mod.rs:4618 — dll/src/desktop/shell2/linux/wayland/mod.rs:4618-4682 | dll/src/desktop/shell2/linux/wayland/mod.rs:5639-5746 | dll/src/desktop/shell2/linux/wayland/mod.rs:5824-5900 — These 3 members are variants of one another: a block of 17 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication · Near-duplicate member family (3 members, 10 shared lines) · ×1
  • Near-duplicate member family (3 members, 10 shared lines) doc/src/codegen/v2/lang_java/managed.rs:949 — doc/src/codegen/v2/lang_java/managed.rs:949-997 | doc/src/codegen/v2/lang_lua/managed.rs:170-210 | doc/src/codegen/v2/lang_zig/boundary.rs:78-94 — These 3 members are variants of one another: a block of 10 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 (205 shared lines) · ×1
  • Near-duplicate member pair (205 shared lines) dll/src/desktop/shell2/linux/wayland/mod.rs:10845 — dll/src/desktop/shell2/linux/wayland/mod.rs:10845-11091 | dll/src/desktop/shell2/linux/x11/mod.rs:8606-8842 — These two members are variants of one another: 205 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 (111 shared lines) · ×1
  • Near-duplicate member pair (111 shared lines) layout/src/widgets/themes/flat.rs:567 — layout/src/widgets/themes/flat.rs:567-696 | layout/src/widgets/themes/flora.rs:789-957 — These two members are variants of one another: 111 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 (105 shared lines) · ×1
  • Near-duplicate member pair (105 shared lines) doc/src/codegen/v2/lang_java/types.rs:130 — doc/src/codegen/v2/lang_java/types.rs:130-365 | doc/src/codegen/v2/lang_java/types.rs:480-735 — These two members are variants of one another: 105 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 (104 shared lines) · ×1
  • Near-duplicate member pair (104 shared lines) doc/src/api.rs:2009 — doc/src/api.rs:2009-2216 | doc/src/api.rs:2281-2482 — These two members are variants of one another: 104 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 (89 shared lines) · ×1
  • Near-duplicate member pair (89 shared lines) doc/src/codegen/v2/lang_rust.rs:2739 — doc/src/codegen/v2/lang_rust.rs:2739-2961 | doc/src/codegen/v2/lang_rust.rs:2969-3353 — These two members are variants of one another: 89 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 (77 shared lines) · ×1
  • Near-duplicate member pair (77 shared lines) doc/src/reftest/regression.rs:961 — doc/src/reftest/regression.rs:961-1214 | doc/src/reftest/regression.rs:1751-2012 — These two members are variants of one another: 77 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 (64 shared lines) · ×1
  • Near-duplicate member pair (64 shared lines) layout/src/widgets/themes/flat.rs:777 — layout/src/widgets/themes/flat.rs:777-913 | layout/src/widgets/themes/flora.rs:1037-1185 — These two members are variants of one another: 64 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 (62 shared lines) · ×1
  • Near-duplicate member pair (62 shared lines) layout/src/widgets/themes/flat.rs:701 — layout/src/widgets/themes/flat.rs:701-768 | layout/src/widgets/themes/flora.rs:962-1028 — These two members are variants of one another: 62 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (55 shared lines) · ×1
  • Near-duplicate member pair (55 shared lines) layout/src/widgets/pagination.rs:202 — layout/src/widgets/pagination.rs:202-333 | layout/src/widgets/segmented.rs:178-302 — These two members are variants of one another: 55 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (53 shared lines) · ×1
  • Near-duplicate member pair (53 shared lines) dll/src/desktop/shell2/linux/wayland/mod.rs:3337 — dll/src/desktop/shell2/linux/wayland/mod.rs:3337-3447 | dll/src/desktop/shell2/linux/x11/mod.rs:4340-4480 — 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 (52 shared lines) · ×1
  • Near-duplicate member pair (52 shared lines) doc/src/codegen/v2/lang_rust.rs:2594 — doc/src/codegen/v2/lang_rust.rs:2594-2680 | doc/src/codegen/v2/rust/shared.rs:177-234 — These two members are variants of one another: 52 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (49 shared lines) · ×1
  • Near-duplicate member pair (49 shared lines) dll/src/desktop/shell2/linux/x11/mod.rs:4217 — dll/src/desktop/shell2/linux/x11/mod.rs:4217-4297 | dll/src/desktop/shell2/windows/mod.rs:7636-7711 — These two members are variants of one another: 49 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (46 shared lines) · ×1
  • Near-duplicate member pair (46 shared lines) webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs:98 — webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs:98-179 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_glyph_transform_texture_2d.rs:81-162 — These two members are variants of one another: 46 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (44 shared lines) · ×1
  • Near-duplicate member pair (44 shared lines) doc/src/codegen/v2/lang_lua/wrappers.rs:1078 — doc/src/codegen/v2/lang_lua/wrappers.rs:1078-1146 | doc/src/codegen/v2/lang_lua/wrappers.rs:1150-1206 — These two members are variants of one another: 44 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (41 shared lines) · ×1
  • Near-duplicate member pair (41 shared lines) doc/src/codegen/v2/lang_rust.rs:2519 — doc/src/codegen/v2/lang_rust.rs:2519-2586 | doc/src/codegen/v2/rust/shared.rs:128-174 — These two members are variants of one another: 41 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (37 shared lines) · ×1
  • Near-duplicate member pair (37 shared lines) core/src/resources.rs:2775 — core/src/resources.rs:2775-2824 | core/src/resources.rs:2926-2975 — These two members are variants of one another: 37 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (36 shared lines) · ×1
  • Near-duplicate member pair (36 shared lines) layout/src/text3/cache.rs:6462 — layout/src/text3/cache.rs:6462-6525 | layout/src/text3/cache.rs:6532-6595 — These two members are variants of one another: 36 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (35 shared lines) · ×1
  • Near-duplicate member pair (35 shared lines) doc/src/codegen/v2/lang_ruby/types.rs:990 — doc/src/codegen/v2/lang_ruby/types.rs:990-1052 | doc/src/codegen/v2/lang_ruby/types.rs:1062-1122 — These two members are variants of one another: 35 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (31 shared lines) · ×1
  • Near-duplicate member pair (31 shared lines) doc/src/codegen/v2/lang_kotlin/wrappers.rs:197 — doc/src/codegen/v2/lang_kotlin/wrappers.rs:197-252 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:261-303 — These two members are variants of one another: 31 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (29 shared lines) · ×1
  • Near-duplicate member pair (29 shared lines) webrender/swgl/src/shaders/brush_blend.rs:204 — webrender/swgl/src/shaders/brush_blend.rs:204-265 | webrender/swgl/src/shaders/brush_blend_alpha_pass.rs:124-186 — These two members are variants of one another: 29 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Edited copy of a member (97 corresponding lines) · ×1
  • Edited copy of a member (97 corresponding lines) doc/src/patch/parser.rs:279 — doc/src/patch/parser.rs:279-399 | doc/src/patch/parser.rs:401-511 — These two members are one piece of code written twice and then edited apart: 97 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Members sharing a duplicated core (38 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (38 members, 50+ identical tokens) webrender/swgl/src/shaders/brush_blend.rs:277 — webrender/swgl/src/shaders/brush_blend.rs:277-289 | webrender/swgl/src/shaders/brush_blend_alpha_pass.rs:230-239 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:326-340 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:325-337 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:314-326 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:266-278 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:317-329 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:288-297 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:227-236 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:220-229 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:287-299 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:279-291 | webrender/swgl/src/shaders/brush_image_texture_2d.rs:172-181 | webrender/swgl/src/shaders/brush_image_texture_rect.rs:212-226 | webrender/swgl/src/shaders/brush_linear_gradient.rs:177-186 | webrender/swgl/src/shaders/brush_linear_gradient_alpha_pass.rs:178-187 | webrender/swgl/src/shaders/brush_mix_blend.rs:289-298 | webrender/swgl/src/shaders/brush_mix_blend_alpha_pass.rs:181-190 | webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs:186-202 | webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs:182-196 | webrender/swgl/src/shaders/brush_opacity_antialiasing.rs:179-193 | webrender/swgl/src/shaders/brush_solid.rs:171-185 | webrender/swgl/src/shaders/brush_solid_alpha_pass.rs:161-175 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:285-294 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:289-298 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:295-304 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:289-298 | webrender/swgl/src/shaders/cs_blur_alpha_target.rs:173-200 | webrender/swgl/src/shaders/ps_quad_conic_gradient.rs:197-206 | webrender/swgl/src/shaders/ps_quad_mask.rs:354-369 | webrender/swgl/src/shaders/ps_quad_mask_fast_path.rs:330-345 | webrender/swgl/src/shaders/ps_quad_radial_gradient.rs:198-207 | webrender/swgl/src/shaders/ps_quad_textured.rs:308-317 | webrender/swgl/src/shaders/ps_split_composite.rs:164-173 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs:214-223 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_texture_2d.rs:143-152 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_glyph_transform_texture_2d.rs:168-177 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_texture_2d.rs:205-214 — These 38 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 38 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 38 times.
D4 · Code Duplication · Members sharing a duplicated core (29 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (29 members, 50+ identical tokens) webrender/swgl/src/shaders/brush_blend.rs:99 — webrender/swgl/src/shaders/brush_blend.rs:99-155 | webrender/swgl/src/shaders/brush_blend_alpha_pass.rs:91-122 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:94-147 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:96-149 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:93-135 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:96-149 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:87-140 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:93-125 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:86-109 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:86-109 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:92-145 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:92-145 | webrender/swgl/src/shaders/brush_image_texture_2d.rs:83-108 | webrender/swgl/src/shaders/brush_image_texture_rect.rs:92-136 | webrender/swgl/src/shaders/brush_linear_gradient.rs:92-123 | webrender/swgl/src/shaders/brush_linear_gradient_alpha_pass.rs:93-124 | webrender/swgl/src/shaders/brush_mix_blend.rs:243-257 | webrender/swgl/src/shaders/brush_mix_blend_alpha_pass.rs:109-140 | webrender/swgl/src/shaders/brush_opacity.rs:91-133 | webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs:92-143 | webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs:90-139 | webrender/swgl/src/shaders/brush_opacity_antialiasing.rs:91-135 | webrender/swgl/src/shaders/brush_solid.rs:99-150 | webrender/swgl/src/shaders/brush_solid_alpha_pass.rs:86-137 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:124-166 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:132-174 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:142-176 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:141-174 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_texture_2d.rs:71-137 — These 29 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 29 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 29 times.
D4 · Code Duplication · Members sharing a duplicated core (27 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (27 members, 50+ identical tokens) webrender/swgl/src/shaders/brush_blend.rs:296 — webrender/swgl/src/shaders/brush_blend.rs:296-305 | webrender/swgl/src/shaders/brush_blend_alpha_pass.rs:241-250 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:347-357 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:344-354 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:333-343 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:285-295 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:336-346 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:299-309 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:238-248 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:231-241 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:306-316 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:298-308 | webrender/swgl/src/shaders/brush_image_texture_2d.rs:183-193 | webrender/swgl/src/shaders/brush_image_texture_rect.rs:233-243 | webrender/swgl/src/shaders/brush_opacity.rs:186-198 | webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs:209-223 | webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs:203-213 | webrender/swgl/src/shaders/brush_opacity_antialiasing.rs:200-210 | webrender/swgl/src/shaders/composite_fast_path_texture_2d.rs:126-136 | webrender/swgl/src/shaders/composite_texture_2d.rs:143-153 | webrender/swgl/src/shaders/cs_blur_alpha_target.rs:202-211 | webrender/swgl/src/shaders/cs_blur_color_target.rs:191-201 | webrender/swgl/src/shaders/cs_scale_texture_2d.rs:125-135 | webrender/swgl/src/shaders/cs_scale_texture_rect.rs:134-144 | webrender/swgl/src/shaders/ps_split_composite.rs:175-184 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_texture_2d.rs:154-164 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_texture_2d.rs:216-226 — These 27 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 27 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 27 times.
D4 · Code Duplication · Members sharing a duplicated core (20 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (20 members, 50+ identical tokens) doc/src/codegen/v2/lang_ada/functions.rs:64 — doc/src/codegen/v2/lang_ada/functions.rs:64-125 | doc/src/codegen/v2/lang_algol68/functions.rs:64-125 | doc/src/codegen/v2/lang_cobol/functions.rs:70-131 | doc/src/codegen/v2/lang_csharp/functions.rs:125-188 | doc/src/codegen/v2/lang_fortran/functions.rs:85-147 | doc/src/codegen/v2/lang_freebasic/functions.rs:47-108 | doc/src/codegen/v2/lang_haskell/functions.rs:422-475 | doc/src/codegen/v2/lang_java/functions.rs:158-220 | doc/src/codegen/v2/lang_julia/mod.rs:409-470 | doc/src/codegen/v2/lang_kotlin/mod.rs:182-240 | doc/src/codegen/v2/lang_lisp/functions.rs:48-109 | doc/src/codegen/v2/lang_nim/functions.rs:49-110 | doc/src/codegen/v2/lang_ocaml/functions.rs:61-123 | doc/src/codegen/v2/lang_odin/mod.rs:330-391 | doc/src/codegen/v2/lang_pascal/functions.rs:94-156 | doc/src/codegen/v2/lang_racket/functions.rs:48-109 | doc/src/codegen/v2/lang_red/mod.rs:339-396 | doc/src/codegen/v2/lang_smalltalk/functions.rs:104-165 | doc/src/codegen/v2/lang_v/mod.rs:362-423 | doc/src/codegen/v2/lang_vb6/functions.rs:62-123 — These 20 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 20 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 20 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) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:160 — webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:160-314 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:162-313 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:148-302 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:162-254 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:153-305 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:138-282 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:122-221 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:122-214 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:158-275 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:158-267 | webrender/swgl/src/shaders/brush_image_texture_2d.rs:121-166 | webrender/swgl/src/shaders/brush_image_texture_rect.rs:150-206 | webrender/swgl/src/shaders/ps_split_composite.rs:109-158 — These 13 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 13 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 13 times.
D4 · Code Duplication · Members sharing a duplicated core (12 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (12 members, 50+ identical tokens) css/src/props/basic/color.rs:899 — css/src/props/basic/color.rs:899-907 | css/src/props/basic/color.rs:911-919 | css/src/props/basic/color.rs:923-931 | css/src/props/basic/color.rs:935-943 | css/src/props/basic/color.rs:947-955 | css/src/props/basic/color.rs:959-967 | css/src/props/basic/color.rs:971-979 | css/src/props/basic/color.rs:983-991 | css/src/props/basic/color.rs:995-1003 | css/src/props/basic/color.rs:1007-1015 | css/src/props/basic/color.rs:1019-1027 | css/src/props/basic/color.rs:1031-1039 — These 12 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 12 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 12 times.
D4 · Code Duplication · Members sharing a duplicated core (10 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (10 members, 50+ identical tokens) doc/src/codegen/v2/lang_csharp/mod.rs:286 — doc/src/codegen/v2/lang_csharp/mod.rs:286-300 | doc/src/codegen/v2/lang_freebasic/mod.rs:328-342 | doc/src/codegen/v2/lang_go/mod.rs:410-424 | doc/src/codegen/v2/lang_haskell/wrappers.rs:2362-2376 | doc/src/codegen/v2/lang_nim/mod.rs:376-390 | doc/src/codegen/v2/lang_ocaml/mod.rs:1022-1036 | doc/src/codegen/v2/lang_pascal/mod.rs:506-520 | doc/src/codegen/v2/lang_powershell/cmdlets.rs:369-386 | doc/src/codegen/v2/lang_smalltalk/wrappers.rs:435-449 | doc/src/codegen/v2/lang_vb6/mod.rs:393-407 — These 10 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 10 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 10 times.
D4 · Code Duplication · Edited copy of a member (297 corresponding lines) · ×1
  • Edited copy of a member (297 corresponding lines) layout/src/widgets/themes/flat.rs:1036 — layout/src/widgets/themes/flat.rs:1036-1332 | layout/src/widgets/themes/flora.rs:1308-1724 — These two members are one piece of code written twice and then edited apart: 297 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (151 corresponding lines) · ×1
  • Edited copy of a member (151 corresponding lines) dll/src/desktop/shell2/common/event.rs:1957 — dll/src/desktop/shell2/common/event.rs:1957-2107 | dll/src/desktop/shell2/linux/x11/events.rs:1755-1920 — These two members are one piece of code written twice and then edited apart: 151 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (174 corresponding lines) · ×1
  • Edited copy of a member (174 corresponding lines) doc/src/codegen/v2/lang_csharp/types.rs:329 — doc/src/codegen/v2/lang_csharp/types.rs:329-502 | doc/src/codegen/v2/lang_kotlin/mod.rs:392-592 — These two members are one piece of code written twice and then edited apart: 174 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (119 corresponding lines) · ×1
  • Edited copy of a member (119 corresponding lines) doc/src/codegen/v2/lang_d/wrappers.rs:2636 — doc/src/codegen/v2/lang_d/wrappers.rs:2636-2754 | doc/src/codegen/v2/lang_swift/wrappers.rs:2685-2840 — These two members are one piece of code written twice and then edited apart: 119 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (134 corresponding lines) · ×1
  • Edited copy of a member (134 corresponding lines) webrender/core/src/picture.rs:4315 — webrender/core/src/picture.rs:4315-4448 | webrender/core/src/picture.rs:4450-4589 — These two members are one piece of code written twice and then edited apart: 134 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (136 corresponding lines) · ×1
  • Edited copy of a member (136 corresponding lines) doc/src/codegen/v2/lang_rust.rs:1242 — doc/src/codegen/v2/lang_rust.rs:1242-1377 | doc/src/codegen/v2/lang_rust.rs:1893-2057 — These two members are one piece of code written twice and then edited apart: 136 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (82 corresponding lines) · ×1
  • Edited copy of a member (82 corresponding lines) doc/src/codegen/v2/lang_d/wrappers.rs:2756 — doc/src/codegen/v2/lang_d/wrappers.rs:2756-2837 | doc/src/codegen/v2/lang_swift/wrappers.rs:3033-3136 — These two members are one piece of code written twice and then edited apart: 82 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (103 corresponding lines) · ×1
  • Edited copy of a member (103 corresponding lines) layout/src/widgets/themes/flat.rs:1364 — layout/src/widgets/themes/flat.rs:1364-1466 | layout/src/widgets/themes/flora.rs:1756-1873 — These two members are one piece of code written twice and then edited apart: 103 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (76 corresponding lines) · ×1
  • Edited copy of a member (76 corresponding lines) doc/src/codegen/v2/lang_lisp/mod.rs:451 — doc/src/codegen/v2/lang_lisp/mod.rs:451-567 | doc/src/codegen/v2/lang_racket/mod.rs:303-378 — These two members are one piece of code written twice and then edited apart: 76 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (102 corresponding lines) · ×1
  • Edited copy of a member (102 corresponding lines) doc/src/codegen/v2/lang_java/wrappers.rs:1937 — doc/src/codegen/v2/lang_java/wrappers.rs:1937-2052 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:1980-2081 — These two members are one piece of code written twice and then edited apart: 102 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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, 1+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 1+ corresponding lines) core/src/callbacks.rs:185 — core/src/callbacks.rs:185-185 | core/src/events.rs:4540-4540 | layout/src/solver3/pagination.rs:93-93 | layout/src/thread.rs:471-471 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 1 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, 1+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 1+ corresponding lines) core/src/callbacks.rs:255 — core/src/callbacks.rs:255-255 | core/src/callbacks.rs:312-312 | core/src/dom.rs:2460-2460 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 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, 97+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 97+ corresponding lines) layout/src/widgets/alert.rs:256 — layout/src/widgets/alert.rs:256-352 | layout/src/widgets/popover.rs:181-281 | layout/src/widgets/toast.rs:279-385 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 97 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 (72 corresponding lines) · ×1
  • Edited copy of a member (72 corresponding lines) doc/src/codegen/v2/lang_lisp/types.rs:41 — doc/src/codegen/v2/lang_lisp/types.rs:41-113 | doc/src/codegen/v2/lang_racket/types.rs:35-106 — These two members are one piece of code written twice and then edited apart: 72 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (92 corresponding lines) · ×1
  • Edited copy of a member (92 corresponding lines) doc/src/codegen/v2/lang_csharp/mod.rs:171 — doc/src/codegen/v2/lang_csharp/mod.rs:171-262 | doc/src/codegen/v2/lang_java/mod.rs:195-294 — These two members are one piece of code written twice and then edited apart: 92 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (99 corresponding lines) · ×1
  • Edited copy of a member (99 corresponding lines) layout/src/glyph_cache.rs:341 — layout/src/glyph_cache.rs:341-470 | layout/src/glyph_cache.rs:506-604 — These two members are one piece of code written twice and then edited apart: 99 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (77 corresponding lines) · ×1
  • Edited copy of a member (77 corresponding lines) doc/src/autofix/type_index.rs:1116 — doc/src/autofix/type_index.rs:1116-1210 | doc/src/autofix/type_index.rs:1306-1382 — These two members are one piece of code written twice and then edited apart: 77 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (75 corresponding lines) · ×1
  • Edited copy of a member (75 corresponding lines) doc/src/codegen/v2/lang_python.rs:1662 — doc/src/codegen/v2/lang_python.rs:1662-1736 | doc/src/codegen/v2/lang_python.rs:1743-1817 — These two members are one piece of code written twice and then edited apart: 75 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (60 corresponding lines) · ×1
  • Edited copy of a member (60 corresponding lines) doc/src/codegen/v2/lang_haskell/mod.rs:510 — doc/src/codegen/v2/lang_haskell/mod.rs:510-569 | doc/src/codegen/v2/lang_haskell/mod.rs:593-659 — These two members are one piece of code written twice and then edited apart: 60 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 35+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 35+ corresponding lines) doc/src/codegen/v2/lang_crystal/model.rs:510 — doc/src/codegen/v2/lang_crystal/model.rs:510-544 | doc/src/codegen/v2/lang_d/model.rs:806-842 | doc/src/codegen/v2/lang_swift/model.rs:812-851 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 35 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (58 corresponding lines) · ×1
  • Edited copy of a member (58 corresponding lines) layout/src/text3/edit.rs:1122 — layout/src/text3/edit.rs:1122-1180 | layout/src/text3/edit.rs:1187-1244 — These two members are one piece of code written twice and then edited apart: 58 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (91 corresponding lines) · ×1
  • Edited copy of a member (91 corresponding lines) doc/src/codegen/v2/lang_pascal/mod.rs:82 — doc/src/codegen/v2/lang_pascal/mod.rs:82-178 | doc/src/codegen/v2/lang_ruby/mod.rs:54-144 — These two members are one piece of code written twice and then edited apart: 91 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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, 45+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 45+ corresponding lines) layout/src/widgets/avatar.rs:137 — layout/src/widgets/avatar.rs:137-181 | layout/src/widgets/badge.rs:161-214 | layout/src/widgets/chip.rs:271-322 | layout/src/widgets/switch.rs:178-224 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 45 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (40 corresponding lines) · ×1
  • Edited copy of a member (40 corresponding lines) dll/src/desktop/shell2/ios/mod.rs:991 — dll/src/desktop/shell2/ios/mod.rs:991-1036 | dll/src/desktop/shell2/ios/mod.rs:1463-1502 — 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 (56 corresponding lines) · ×1
  • Edited copy of a member (56 corresponding lines) doc/src/autofix/type_index.rs:1623 — doc/src/autofix/type_index.rs:1623-1683 | doc/src/autofix/type_index.rs:1691-1746 — These two members are one piece of code written twice and then edited apart: 56 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 50+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 50+ corresponding lines) css/src/props/style/border.rs:576 — css/src/props/style/border.rs:576-625 | css/src/props/style/border.rs:646-695 | css/src/props/style/border.rs:716-765 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 50 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, 53+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 53+ corresponding lines) doc/src/codegen/v2/lang_csharp/types.rs:702 — doc/src/codegen/v2/lang_csharp/types.rs:702-754 | doc/src/codegen/v2/lang_java/types.rs:924-976 | doc/src/codegen/v2/lang_kotlin/mod.rs:982-1034 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 53 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 33+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 33+ corresponding lines) dll/src/desktop/shell2/linux/system_style.rs:836 — dll/src/desktop/shell2/linux/system_style.rs:836-871 | dll/src/desktop/shell2/macos/system_style.rs:554-586 | dll/src/desktop/shell2/windows/system_style.rs:374-409 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 33 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (38 corresponding lines) · ×1
  • Edited copy of a member (38 corresponding lines) doc/src/codegen/v2/lang_ocaml/wrappers.rs:1518 — doc/src/codegen/v2/lang_ocaml/wrappers.rs:1518-1555 | doc/src/codegen/v2/lang_ocaml/wrappers.rs:1787-1836 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 31+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 31+ corresponding lines) doc/src/codegen/v2/lang_node/managed.rs:127 — doc/src/codegen/v2/lang_node/managed.rs:127-173 | doc/src/codegen/v2/lang_pascal/managed.rs:256-286 | doc/src/codegen/v2/lang_ruby/managed.rs:473-520 — These 3 members are one piece of code written 3 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 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (42 corresponding lines) · ×1
  • Edited copy of a member (42 corresponding lines) dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:37 — dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:37-78 | dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:86-127 — 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 copies of one member (3 members, 21+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 21+ corresponding lines) layout/src/widgets/ribbon.rs:876 — layout/src/widgets/ribbon.rs:876-907 | layout/src/widgets/ribbon.rs:909-934 | layout/src/widgets/ribbon.rs:1325-1345 — 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 (3 members, 37+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 37+ corresponding lines) doc/src/codegen/v2/lang_csharp/functions.rs:190 — doc/src/codegen/v2/lang_csharp/functions.rs:190-233 | doc/src/codegen/v2/lang_java/functions.rs:222-262 | doc/src/codegen/v2/lang_kotlin/mod.rs:307-343 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 37 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 27+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 27+ corresponding lines) layout/src/widgets/alert.rs:544 — layout/src/widgets/alert.rs:544-570 | layout/src/widgets/chip.rs:556-582 | layout/src/widgets/modal.rs:567-595 | layout/src/widgets/toast.rs:572-599 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 22+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 22+ corresponding lines) doc/src/codegen/v2/lang_crystal/types.rs:231 — doc/src/codegen/v2/lang_crystal/types.rs:231-254 | doc/src/codegen/v2/lang_freebasic/types.rs:295-325 | doc/src/codegen/v2/lang_julia/types.rs:271-292 | doc/src/codegen/v2/lang_odin/types.rs:192-214 | doc/src/codegen/v2/lang_v/types.rs:198-222 | doc/src/codegen/v2/lang_vb6/types.rs:287-317 — These 6 members are one piece of code written 6 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 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 23+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 23+ corresponding lines) dll/src/desktop/shell2/ios/mod.rs:889 — dll/src/desktop/shell2/ios/mod.rs:889-911 | dll/src/desktop/shell2/ios/mod.rs:938-962 | dll/src/desktop/shell2/ios/mod.rs:964-986 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 26+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 26+ corresponding lines) core/src/xml.rs:4242 — core/src/xml.rs:4242-4268 | core/src/xml.rs:4329-4354 | core/src/xml.rs:4419-4446 — 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 (4 members, 29+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 29+ corresponding lines) dll/src/desktop/shell2/linux/x11/events.rs:1539 — dll/src/desktop/shell2/linux/x11/events.rs:1539-1573 | dll/src/desktop/shell2/macos/events.rs:1523-1554 | dll/src/desktop/shell2/macos/mod.rs:7453-7482 | dll/src/desktop/shell2/windows/mod.rs:7580-7608 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 29 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 29+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 29+ corresponding lines) dll/src/web/transpiler_remill.rs:6957 — dll/src/web/transpiler_remill.rs:6957-7001 | dll/src/web/transpiler_remill.rs:7003-7032 | dll/src/web/transpiler_remill.rs:7034-7062 | dll/src/web/transpiler_remill.rs:7064-7092 | dll/src/web/transpiler_remill.rs:7094-7122 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 29 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 20+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 20+ corresponding lines) doc/src/codegen/v2/lang_crystal/model.rs:53 — doc/src/codegen/v2/lang_crystal/model.rs:53-72 | doc/src/codegen/v2/lang_d/model.rs:60-83 | doc/src/codegen/v2/lang_swift/model.rs:63-82 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 19+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 19+ corresponding lines) doc/src/codegen/v2/lang_crystal/functions.rs:32 — doc/src/codegen/v2/lang_crystal/functions.rs:32-54 | doc/src/codegen/v2/lang_d/functions.rs:28-49 | doc/src/codegen/v2/lang_julia/functions.rs:28-46 | doc/src/codegen/v2/lang_odin/functions.rs:30-51 | doc/src/codegen/v2/lang_v/functions.rs:32-53 — These 5 members are one piece of code written 5 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 5 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) dll/src/desktop/shell2/android/mod.rs:578 — dll/src/desktop/shell2/android/mod.rs:578-594 | dll/src/desktop/shell2/ios/mod.rs:2024-2042 | dll/src/desktop/shell2/linux/wayland/mod.rs:1569-1587 | dll/src/desktop/shell2/linux/x11/mod.rs:7830-7848 | dll/src/desktop/shell2/windows/mod.rs:7321-7339 — 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 (5 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 14+ corresponding lines) doc/src/reftest/apply_midlevel.rs:1729 — doc/src/reftest/apply_midlevel.rs:1729-1742 | doc/src/reftest/apply_midlevel.rs:2074-2088 | doc/src/reftest/apply_midlevel.rs:3361-3374 | doc/src/reftest/autodoc.rs:774-787 | doc/src/reftest/autoreview.rs:2626-2640 — 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 (5 members, 16+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 16+ corresponding lines) layout/src/solver3/getters.rs:6522 — layout/src/solver3/getters.rs:6522-6537 | layout/src/solver3/getters.rs:6545-6560 | layout/src/solver3/getters.rs:6661-6676 | layout/src/solver3/getters.rs:6689-6706 | layout/src/solver3/getters.rs:7055-7071 — 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 (6 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 13+ corresponding lines) layout/src/solver3/getters.rs:3468 — layout/src/solver3/getters.rs:3468-3480 | layout/src/solver3/getters.rs:3486-3498 | layout/src/solver3/getters.rs:3728-3740 | layout/src/solver3/getters.rs:3744-3756 | layout/src/solver3/getters.rs:3760-3772 | layout/src/solver3/getters.rs:3779-3791 — These 6 members are one piece of code written 6 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 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 11+ corresponding lines) doc/src/mobile/device.rs:332 — doc/src/mobile/device.rs:332-342 | doc/src/mobile/device.rs:378-391 | doc/src/mobile/device.rs:631-645 | doc/src/mobile/device.rs:647-658 — 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, 7+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 7+ corresponding lines) doc/src/codegen/v2/lang_crystal/types.rs:256 — doc/src/codegen/v2/lang_crystal/types.rs:256-262 | doc/src/codegen/v2/lang_fortran/types.rs:648-655 | doc/src/codegen/v2/lang_julia/types.rs:294-300 | doc/src/codegen/v2/lang_odin/types.rs:216-222 | doc/src/codegen/v2/lang_pascal/types.rs:519-526 | doc/src/codegen/v2/lang_v/types.rs:224-230 — 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, 7+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 7+ corresponding lines) doc/src/codegen/v2/lang_crystal/wrappers.rs:1454 — doc/src/codegen/v2/lang_crystal/wrappers.rs:1454-1461 | doc/src/codegen/v2/lang_crystal/wrappers.rs:1463-1470 | doc/src/codegen/v2/lang_d/wrappers.rs:2386-2392 | doc/src/codegen/v2/lang_swift/wrappers.rs:2362-2372 — 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 (5 members, 7+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 7+ corresponding lines) dll/src/desktop/extra/iroh/loadbalancer.rs:138 — dll/src/desktop/extra/iroh/loadbalancer.rs:138-144 | dll/src/desktop/extra/iroh/mod.rs:62-68 | dll/src/desktop/extra/zip/mod.rs:63-69 | layout/src/resource_handles.rs:96-105 | layout/src/resource_handles.rs:167-177 — These 5 members are one piece of code written 5 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 5 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) doc/src/autofix/diff.rs:489 — doc/src/autofix/diff.rs:489-498 | doc/src/autofix/type_index.rs:1425-1440 | doc/src/autofix/utils.rs:266-281 | doc/src/patch/mod.rs:742-755 — 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 (3 members, 4+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 4+ corresponding lines) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:216 — webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:216-219 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:216-219 | webrender/swgl/src/shaders/composite_texture_rect_yuv.rs:168-171 — 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 (121 lines × 3) · ×1
  • Duplicated block (121 lines × 3) webrender/core/src/batch.rs:2903 — webrender/core/src/batch.rs:2903-3023 | webrender/core/src/batch.rs:3030-3150 | webrender/core/src/batch.rs:3157-3277 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/core/src/batch.rs:2903` 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 (112–119 lines × 2) · ×1
  • Duplicated block (112–119 lines × 2) doc/src/codegen/v2/rust/dynamic_binding.rs:152 — doc/src/codegen/v2/rust/dynamic_binding.rs:152-270 | doc/src/codegen/v2/rust/dynamic_binding.rs:281-392 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/rust/dynamic_binding.rs:152` 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 (94 lines × 2) · ×1
  • Duplicated block (94 lines × 2) doc/src/patch/parser.rs:297 — doc/src/patch/parser.rs:297-390 | doc/src/patch/parser.rs:406-499 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `i` to `&'ast ItemFn` in one and `&'ast syn::ImplItemFn` 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, `doc/src/patch/parser.rs:391` calls `get_span_lines` and `doc/src/patch/parser.rs:502` 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 (89–90 lines × 2) · ×1
  • Duplicated block (89–90 lines × 2) webrender/core/src/picture.rs:4351 — webrender/core/src/picture.rs:4351-4439 | webrender/core/src/picture.rs:4490-4579 — both copies are in the same file, so extract the 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 (83 lines × 2) · ×1
  • Duplicated block (83 lines × 2) layout/src/widgets/alert.rs:112 — layout/src/widgets/alert.rs:112-194 | layout/src/widgets/toast.rs:133-215 — before extracting anything, compare `layout/src/widgets/alert.rs` and `layout/src/widgets/toast.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (80 lines × 3) · ×1
  • Duplicated block (80 lines × 3) layout/src/widgets/node_graph.rs:1502 — layout/src/widgets/node_graph.rs:1502-1581 | layout/src/widgets/node_graph.rs:1591-1670 | layout/src/widgets/node_graph.rs:1929-2008 — all 3 copies are in the same file, so extract the block into one function there and call 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 (78–79 lines × 2) · ×1
  • Duplicated block (78–79 lines × 2) doc/src/codegen/v2/lang_kotlin/wrappers.rs:1654 — doc/src/codegen/v2/lang_kotlin/wrappers.rs:1654-1732 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:1896-1973 — both copies are in the same file, so extract the 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, `doc/src/codegen/v2/lang_kotlin/wrappers.rs:1894` calls `line` and `doc/src/codegen/v2/lang_kotlin/wrappers.rs:1652` 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 (74–76 lines × 2) · ×1
  • Duplicated block (74–76 lines × 2) dll/src/desktop/shell2/linux/wayland/gl.rs:175 — dll/src/desktop/shell2/linux/wayland/gl.rs:175-248 | dll/src/desktop/shell2/linux/x11/gl.rs:189-264 — `dll/src/desktop/shell2/linux/wayland/gl.rs` and `dll/src/desktop/shell2/linux/x11/gl.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 133 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (74 lines × 2) · ×1
  • Duplicated block (74 lines × 2) layout/src/widgets/themes/flat.rs:589 — layout/src/widgets/themes/flat.rs:589-662 | layout/src/widgets/themes/flora.rs:811-884 — before extracting anything, compare `layout/src/widgets/themes/flat.rs` and `layout/src/widgets/themes/flora.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 927 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `layout/src/widgets/themes/flat.rs:589` it begins part-way through the construct above it, so those 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 (65–70 lines × 2) · ×1
  • Duplicated block (65–70 lines × 2) layout/src/widgets/themes/flat.rs:1365 — layout/src/widgets/themes/flat.rs:1365-1429 | layout/src/widgets/themes/flora.rs:1757-1826 — before extracting anything, compare `layout/src/widgets/themes/flat.rs` and `layout/src/widgets/themes/flora.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 927 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `layout/src/widgets/themes/flat.rs:1365` it does not close everything it opens, so those 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 (65 lines × 2) · ×1
  • Duplicated block (65 lines × 2) webrender/core/src/render_task.rs:2429 — webrender/core/src/render_task.rs:2429-2493 | webrender/core/src/render_task.rs:2557-2621 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/core/src/render_task.rs:2429` 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 (62–63 lines × 2) · ×1
  • Duplicated block (62–63 lines × 2) layout/src/widgets/themes/flat.rs:1077 — layout/src/widgets/themes/flat.rs:1077-1138 | layout/src/widgets/themes/flora.rs:1441-1503 — before extracting anything, compare `layout/src/widgets/themes/flat.rs` and `layout/src/widgets/themes/flora.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 927 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `layout/src/widgets/themes/flat.rs:1077` it begins part-way through the construct above it, so those 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 (62 lines × 7) · ×1
  • Duplicated block (62 lines × 7) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:178 — webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:178-239 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:181-242 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:166-227 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:172-233 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:155-216 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:177-238 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:177-238 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs` and `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 439 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.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.
D4 · Code Duplication · Duplicated block (58–59 lines × 3) · ×1
  • Duplicated block (58–59 lines × 3) doc/src/codegen/v2/lang_cpp/cpp11.rs:328 — doc/src/codegen/v2/lang_cpp/cpp11.rs:328-386 | doc/src/codegen/v2/lang_cpp/cpp17.rs:508-565 | doc/src/codegen/v2/lang_cpp/cpp20.rs:194-252 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp11.rs` and `doc/src/codegen/v2/lang_cpp/cpp17.rs` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 669 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/codegen/v2/lang_cpp/cpp11.rs:328` 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 (50–57 lines × 2) · ×1
  • Duplicated block (50–57 lines × 2) doc/src/codegen/v2/lang_lisp/types.rs:44 — doc/src/codegen/v2/lang_lisp/types.rs:44-100 | doc/src/codegen/v2/lang_racket/types.rs:42-91 — `doc/src/codegen/v2/lang_lisp/types.rs` and `doc/src/codegen/v2/lang_racket/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 84 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_lisp/types.rs:44` it does not close everything it opens, so those 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 (55–57 lines × 2) · ×1
  • Duplicated block (55–57 lines × 2) doc/src/codegen/v2/rust/static_binding.rs:239 — doc/src/codegen/v2/rust/static_binding.rs:239-295 | doc/src/codegen/v2/rust/static_binding.rs:306-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 `doc/src/codegen/v2/rust/static_binding.rs:239` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (45–56 lines × 2) · ×1
  • Duplicated block (45–56 lines × 2) dll/src/desktop/shell2/android/mod.rs:1711 — dll/src/desktop/shell2/android/mod.rs:1711-1766 | dll/src/desktop/shell2/android/mod.rs:1918-1962 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/android/mod.rs:1711` it begins part-way through the construct above it, so those 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 (46–53 lines × 2) · ×1
  • Duplicated block (46–53 lines × 2) dll/src/web/transpiler_remill.rs:1345 — dll/src/web/transpiler_remill.rs:1345-1397 | dll/src/web/transpiler_remill.rs:6700-6745 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/web/transpiler_remill.rs:6700` it begins part-way through the construct above it, so those 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 (44–52 lines × 3) · ×1
  • Duplicated block (44–52 lines × 3) doc/src/codegen/v2/lang_cpp/cpp11.rs:651 — doc/src/codegen/v2/lang_cpp/cpp11.rs:651-694 | doc/src/codegen/v2/lang_cpp/cpp17.rs:147-198 | doc/src/codegen/v2/lang_cpp/cpp20.rs:624-667 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp11.rs` and `doc/src/codegen/v2/lang_cpp/cpp17.rs` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 669 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (47–51 lines × 2) · ×1
  • Duplicated block (47–51 lines × 2) core/src/xml.rs:7241 — core/src/xml.rs:7241-7287 | core/src/xml.rs:7497-7547 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/xml.rs:7497` it begins part-way through the construct above it, so those 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 (42–51 lines × 2) · ×1
  • Duplicated block (42–51 lines × 2) layout/src/solver3/fc.rs:8890 — layout/src/solver3/fc.rs:8890-8931 | layout/src/solver3/fc.rs:9419-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. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/fc.rs:9419` it begins part-way through the construct above it, so those 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 (45–50 lines × 2) · ×1
  • Duplicated block (45–50 lines × 2) doc/src/main.rs:1358 — doc/src/main.rs:1358-1402 | doc/src/main.rs:1433-1482 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (49 lines × 2) · ×1
  • Duplicated block (49 lines × 2) dll/src/desktop/shell2/linux/wayland/gl.rs:104 — dll/src/desktop/shell2/linux/wayland/gl.rs:104-152 | dll/src/desktop/shell2/linux/x11/gl.rs:102-150 — `dll/src/desktop/shell2/linux/wayland/gl.rs` and `dll/src/desktop/shell2/linux/x11/gl.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 133 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (47–48 lines × 2) · ×1
  • Duplicated block (47–48 lines × 2) doc/src/codegen/v2/lang_csharp/wrappers.rs:1838 — doc/src/codegen/v2/lang_csharp/wrappers.rs:1838-1884 | doc/src/codegen/v2/lang_csharp/wrappers.rs:1886-1933 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_csharp/wrappers.rs:1886` it begins part-way through the construct above it, so those 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 (40–47 lines × 2) · ×1
  • Duplicated block (40–47 lines × 2) doc/src/codegen/v2/lang_crystal/types.rs:45 — doc/src/codegen/v2/lang_crystal/types.rs:45-91 | doc/src/codegen/v2/lang_d/types.rs:43-82 — `doc/src/codegen/v2/lang_crystal/types.rs` and `doc/src/codegen/v2/lang_d/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 67 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_crystal/types.rs:45` it does not close everything it opens, so those 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 (47 lines × 2) · ×1
  • Duplicated block (47 lines × 2) layout/src/xml/svg.rs:1341 — layout/src/xml/svg.rs:1341-1387 | layout/src/xml/svg.rs:1401-1447 — both copies are in the same file, so extract the 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 `nodes` to `&[TessellatedSvgNode]` in one and `&[TessellatedColoredSvgNode]` 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 (46 lines × 2) · ×1
  • Duplicated block (46 lines × 2) doc/src/codegen/v2/lang_odin/types.rs:39 — doc/src/codegen/v2/lang_odin/types.rs:39-84 | doc/src/codegen/v2/lang_v/types.rs:39-84 — `doc/src/codegen/v2/lang_odin/types.rs` and `doc/src/codegen/v2/lang_v/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 16 separate duplicated blocks between them, totalling at least 175 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_odin/types.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.
D4 · Code Duplication · Duplicated block (41–46 lines × 2) · ×1
  • Duplicated block (41–46 lines × 2) layout/src/text3/cache.rs:7981 — layout/src/text3/cache.rs:7981-8026 | layout/src/text3/cache.rs:8184-8224 — both copies are in the same file, so extract the 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, `layout/src/text3/cache.rs:8030` calls `span` and `layout/src/text3/cache.rs:8228` 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 (38–45 lines × 2) · ×1
  • Duplicated block (38–45 lines × 2) core/src/diff.rs:383 — core/src/diff.rs:383-427 | core/src/diff.rs:1448-1485 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/diff.rs:383` 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 (25–45 lines × 2) · ×1
  • Duplicated block (25–45 lines × 2) dll/src/desktop/shell2/headless/mod.rs:1751 — dll/src/desktop/shell2/headless/mod.rs:1751-1795 | dll/src/desktop/shell2/headless/mod.rs:1916-1940 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/headless/mod.rs:1751` 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, `dll/src/desktop/shell2/headless/mod.rs:1738` calls `rebuild_cpu_hit_tester` and `dll/src/desktop/shell2/headless/mod.rs:1911` 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–45 lines × 2) · ×1
  • Duplicated block (44–45 lines × 2) layout/src/text3/cache.rs:7224 — layout/src/text3/cache.rs:7224-7267 | layout/src/text3/dense.rs:765-809 — before extracting anything, compare `layout/src/text3/cache.rs` and `layout/src/text3/dense.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (41–44 lines × 3) · ×1
  • Duplicated block (41–44 lines × 3) doc/src/codegen/v2/lang_cpp/cpp11.rs:703 — doc/src/codegen/v2/lang_cpp/cpp11.rs:703-743 | doc/src/codegen/v2/lang_cpp/cpp17.rs:214-255 | doc/src/codegen/v2/lang_cpp/cpp20.rs:679-722 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp11.rs` and `doc/src/codegen/v2/lang_cpp/cpp17.rs` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 669 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/codegen/v2/lang_cpp/cpp11.rs:703` it begins part-way through the construct above it, so those 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 (39–42 lines × 2) · ×1
  • Duplicated block (39–42 lines × 2) dll/src/desktop/shell2/linux/x11/mod.rs:6948 — dll/src/desktop/shell2/linux/x11/mod.rs:6948-6989 | dll/src/desktop/shell2/windows/mod.rs:1660-1698 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 450 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 `dll/src/desktop/shell2/linux/x11/mod.rs:6948` 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 (41–42 lines × 2) · ×1
  • Duplicated block (41–42 lines × 2) doc/src/codegen/v2/lang_rust.rs:2470 — doc/src/codegen/v2/lang_rust.rs:2470-2511 | doc/src/codegen/v2/rust/shared.rs:85-125 — before extracting anything, compare `doc/src/codegen/v2/lang_rust.rs` and `doc/src/codegen/v2/rust/shared.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 210 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 (38–41 lines × 2) · ×1
  • Duplicated block (38–41 lines × 2) doc/src/codegen/v2/lang_freebasic/types.rs:45 — doc/src/codegen/v2/lang_freebasic/types.rs:45-85 | doc/src/codegen/v2/lang_vb6/types.rs:66-103 — `doc/src/codegen/v2/lang_freebasic/types.rs` and `doc/src/codegen/v2/lang_vb6/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 114 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_freebasic/types.rs:45` it does not close everything it opens, so those 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 (40–41 lines × 2) · ×1
  • Duplicated block (40–41 lines × 2) webrender/core/src/batch.rs:2410 — webrender/core/src/batch.rs:2410-2449 | webrender/core/src/batch.rs:2541-2581 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/core/src/batch.rs:2410` it begins part-way through the construct above it, so those 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–39 lines × 2) · ×1
  • Duplicated block (23–39 lines × 2) core/src/styled_dom.rs:1985 — core/src/styled_dom.rs:1985-2007 | core/src/styled_dom.rs:2167-2205 — both copies are in the same file, so extract the 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 (33–39 lines × 2) · ×1
  • Duplicated block (33–39 lines × 2) dll/src/desktop/shell2/macos/mod.rs:4266 — dll/src/desktop/shell2/macos/mod.rs:4266-4304 | dll/src/desktop/shell2/macos/mod.rs:4351-4383 — both copies are in the same file, so extract the 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 (38–39 lines × 2) · ×1
  • Duplicated block (38–39 lines × 2) layout/src/cpurender/compositor.rs:3127 — layout/src/cpurender/compositor.rs:3127-3164 | layout/src/cpurender/compositor.rs:3195-3233 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/cpurender/compositor.rs:3127` 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 (38 lines × 4) · ×1
  • Duplicated block (38 lines × 4) doc/src/codegen/v2/lang_cpp/cpp03.rs:491 — doc/src/codegen/v2/lang_cpp/cpp03.rs:491-528 | doc/src/codegen/v2/lang_cpp/cpp11.rs:394-431 | doc/src/codegen/v2/lang_cpp/cpp17.rs:573-610 | doc/src/codegen/v2/lang_cpp/cpp20.rs:260-297 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (36–38 lines × 3) · ×1
  • Duplicated block (36–38 lines × 3) doc/src/reftest/autoreview.rs:618 — doc/src/reftest/autoreview.rs:618-653 | doc/src/reftest/autoreview.rs:847-884 | doc/src/reftest/autoreview.rs:1771-1807 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/reftest/autoreview.rs:618` it does not close everything it opens, so those 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 (41 lines × 2) · ×1
  • Duplicated block (41 lines × 2) doc/src/reftest/regression.rs:1218 — doc/src/reftest/regression.rs:1218-1258 | doc/src/reftest/regression.rs:1313-1353 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/reftest/regression.rs:1218` it does not close everything it opens, so those 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 (36–37 lines × 3) · ×1
  • Duplicated block (36–37 lines × 3) dll/src/desktop/shell2/linux/wayland/mod.rs:5004 — dll/src/desktop/shell2/linux/wayland/mod.rs:5004-5039 | dll/src/desktop/shell2/linux/x11/events.rs:942-977 | dll/src/desktop/shell2/windows/mod.rs:5600-5636 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/events.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 263 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 `dll/src/desktop/shell2/linux/wayland/mod.rs:5004` 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 (35–37 lines × 2) · ×1
  • Duplicated block (35–37 lines × 2) doc/src/autofix/function_diff.rs:1437 — doc/src/autofix/function_diff.rs:1437-1473 | doc/src/autofix/function_diff.rs:1507-1541 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/function_diff.rs:1437` it begins part-way through the construct above it, so those 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 (35–36 lines × 5) · ×1
  • Duplicated block (35–36 lines × 5) layout/src/widgets/node_graph.rs:3623 — layout/src/widgets/node_graph.rs:3623-3658 | layout/src/widgets/node_graph.rs:3672-3707 | layout/src/widgets/node_graph.rs:3721-3756 | layout/src/widgets/node_graph.rs:3770-3804 | layout/src/widgets/node_graph.rs:3818-3853 — 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 `layout/src/widgets/node_graph.rs:3623` it does not close everything it opens, so those 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 (36 lines × 5) · ×1
  • Duplicated block (36 lines × 5) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:278 — webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:278-313 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:267-302 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:219-254 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:186-221 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:179-214 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs` and `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 376 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:278` 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, `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:274` calls `zw`, `xy` and `webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:176` 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 (26–36 lines × 4) · ×1
  • Duplicated block (26–36 lines × 4) doc/src/codegen/v2/lang_cpp/cpp03.rs:319 — doc/src/codegen/v2/lang_cpp/cpp03.rs:319-346 | doc/src/codegen/v2/lang_cpp/cpp11.rs:218-253 | doc/src/codegen/v2/lang_cpp/cpp17.rs:383-410 | doc/src/codegen/v2/lang_cpp/cpp20.rs:1062-1087 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/codegen/v2/lang_cpp/cpp03.rs:319` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (36 lines × 3) · ×1
  • Duplicated block (36 lines × 3) dll/src/desktop/compositor2.rs:1659 — dll/src/desktop/compositor2.rs:1659-1694 | dll/src/desktop/compositor2.rs:1848-1883 | dll/src/desktop/compositor2.rs:1970-2005 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/compositor2.rs:1659` 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 (3–36 lines × 3) · ×1
  • Duplicated block (3–36 lines × 3) core/src/window.rs:2585 — core/src/window.rs:2585-2587 | css/src/props/property.rs:1576-1592 | css/src/props/property.rs:1801-1836 — 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 `core/src/window.rs:2585` 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 (36 lines × 2) · ×1
  • Duplicated block (36 lines × 2) doc/src/codegen/v2/lang_go/wrappers.rs:363 — doc/src/codegen/v2/lang_go/wrappers.rs:363-398 | doc/src/codegen/v2/lang_go/wrappers.rs:458-493 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_go/wrappers.rs:363` it does not close everything it opens, so those 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 (34–35 lines × 2) · ×1
  • Duplicated block (34–35 lines × 2) dll/src/desktop/shell2/headless/mod.rs:1719 — dll/src/desktop/shell2/headless/mod.rs:1719-1753 | dll/src/desktop/shell2/ios/mod.rs:1936-1969 — `dll/src/desktop/shell2/headless/mod.rs` and `dll/src/desktop/shell2/ios/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 158 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/headless/mod.rs:1719` 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–35 lines × 2) · ×1
  • Duplicated block (26–35 lines × 2) dll/src/web/transpiler_remill.rs:10935 — dll/src/web/transpiler_remill.rs:10935-10960 | dll/src/web/transpiler_remill.rs:11066-11100 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/web/transpiler_remill.rs:10935` it does not close everything it opens, so those 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 (36–40 lines × 2) · ×1
  • Duplicated block (36–40 lines × 2) doc/src/reftest/autoreview.rs:1462 — doc/src/reftest/autoreview.rs:1462-1501 | doc/src/reftest/autoreview.rs:1991-2026 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/reftest/autoreview.rs:1462` it does not close everything it opens, so those 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–35 lines × 2) · ×1
  • Duplicated block (31–35 lines × 2) layout/src/widgets/node_graph.rs:873 — layout/src/widgets/node_graph.rs:873-907 | layout/src/widgets/node_graph.rs:966-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 `layout/src/widgets/node_graph.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. 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 (184 lines × 2) · ×1
  • Duplicated block (184 lines × 2) layout/src/widgets/themes/flat.rs:1149 — layout/src/widgets/themes/flat.rs:1149-1332 | layout/src/widgets/themes/flora.rs:1541-1724 — before extracting anything, compare `layout/src/widgets/themes/flat.rs` and `layout/src/widgets/themes/flora.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 927 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `layout/src/widgets/themes/flat.rs:1149` it begins part-way through the construct above it, so those 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 (34 lines × 3) · ×1
  • Duplicated block (34 lines × 3) doc/src/codegen/v2/lang_cpp/cpp03.rs:679 — doc/src/codegen/v2/lang_cpp/cpp03.rs:679-712 | doc/src/codegen/v2/lang_cpp/cpp11.rs:601-634 | doc/src/codegen/v2/lang_cpp/cpp17.rs:811-844 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/codegen/v2/lang_cpp/cpp03.rs:679` it does not close everything it opens, so those 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 (33–34 lines × 2) · ×1
  • Duplicated block (33–34 lines × 2) doc/src/codegen/v2/lang_swift/wrappers.rs:1035 — doc/src/codegen/v2/lang_swift/wrappers.rs:1035-1067 | doc/src/codegen/v2/lang_swift/wrappers.rs:3172-3205 — both copies are in the same file, so extract the 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 (34 lines × 2) · ×1
  • Duplicated block (34 lines × 2) layout/src/widgets/themes/flat.rs:1470 — layout/src/widgets/themes/flat.rs:1470-1503 | layout/src/widgets/themes/flora.rs:1877-1910 — before extracting anything, compare `layout/src/widgets/themes/flat.rs` and `layout/src/widgets/themes/flora.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 927 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `layout/src/widgets/themes/flat.rs:1470` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16–33 lines × 8) · ×1
  • Duplicated block (16–33 lines × 8) dll/src/desktop/shell2/linux/wayland/defines.rs:1923 — dll/src/desktop/shell2/linux/wayland/defines.rs:1923-1938 | dll/src/desktop/shell2/linux/wayland/defines.rs:1975-1990 | dll/src/desktop/shell2/linux/wayland/defines.rs:2027-2054 | dll/src/desktop/shell2/linux/wayland/defines.rs:2129-2144 | dll/src/desktop/shell2/linux/wayland/defines.rs:2256-2271 | dll/src/desktop/shell2/linux/wayland/defines.rs:2571-2598 | dll/src/desktop/shell2/linux/wayland/defines.rs:2614-2643 | dll/src/desktop/shell2/linux/wayland/defines.rs:2962-2994 — 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 `dll/src/desktop/shell2/linux/wayland/defines.rs:1923` it does not close everything it opens, so those 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 (30–33 lines × 2) · ×1
  • Duplicated block (30–33 lines × 2) doc/src/api.rs:2022 — doc/src/api.rs:2022-2054 | doc/src/api.rs:2295-2324 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/api.rs:2022` it begins part-way through the construct above it, so those 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–33 lines × 2) · ×1
  • Duplicated block (32–33 lines × 2) layout/src/solver3/fc.rs:8856 — layout/src/solver3/fc.rs:8856-8887 | layout/src/solver3/fc.rs:9380-9412 — both copies are in the same file, so extract the 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 (31–34 lines × 2) · ×1
  • Duplicated block (31–34 lines × 2) layout/src/widgets/camera.rs:452 — layout/src/widgets/camera.rs:452-485 | layout/src/widgets/screencap.rs:401-431 — before extracting anything, compare `layout/src/widgets/camera.rs` and `layout/src/widgets/screencap.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 108 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `layout/src/widgets/camera.rs:452` 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 (27–32 lines × 4) · ×1
  • Duplicated block (27–32 lines × 4) doc/src/codegen/v2/lang_cpp/cpp11.rs:74 — doc/src/codegen/v2/lang_cpp/cpp11.rs:74-103 | doc/src/codegen/v2/lang_cpp/cpp14.rs:59-85 | doc/src/codegen/v2/lang_cpp/cpp17.rs:73-104 | doc/src/codegen/v2/lang_cpp/cpp20.rs:83-111 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp11.rs` and `doc/src/codegen/v2/lang_cpp/cpp14.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 164 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/codegen/v2/lang_cpp/cpp11.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.
D4 · Code Duplication · Duplicated block (28–32 lines × 2) · ×1
  • Duplicated block (28–32 lines × 2) dll/src/desktop/shell2/run.rs:1315 — dll/src/desktop/shell2/run.rs:1315-1346 | dll/src/desktop/shell2/run.rs:1497-1524 — both copies are in the same file, so extract the 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 (62 lines × 2) · ×1
  • Duplicated block (62 lines × 2) doc/src/autofix/debug.rs:1172 — doc/src/autofix/debug.rs:1172-1233 | doc/src/autofix/debug.rs:1237-1298 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/debug.rs:1172` it begins part-way through the construct above it, so those 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 (30–32 lines × 2) · ×1
  • Duplicated block (30–32 lines × 2) doc/src/codegen/v2/lang_cpp/cpp17.rs:624 — doc/src/codegen/v2/lang_cpp/cpp17.rs:624-655 | doc/src/codegen/v2/lang_cpp/cpp20.rs:325-354 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp17.rs` and `doc/src/codegen/v2/lang_cpp/cpp20.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 616 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/codegen/v2/lang_cpp/cpp17.rs:624` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (27–32 lines × 2) · ×1
  • Duplicated block (27–32 lines × 2) doc/src/codegen/v2/lang_node/wrappers.rs:453 — doc/src/codegen/v2/lang_node/wrappers.rs:453-484 | doc/src/codegen/v2/lang_node/wrappers.rs:1145-1171 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_node/wrappers.rs:453` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (31–32 lines × 2) · ×1
  • Duplicated block (31–32 lines × 2) doc/src/codegen/v2/lang_rust.rs:2431 — doc/src/codegen/v2/lang_rust.rs:2431-2462 | doc/src/codegen/v2/rust/shared.rs:47-77 — before extracting anything, compare `doc/src/codegen/v2/lang_rust.rs` and `doc/src/codegen/v2/rust/shared.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 210 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 (23–32 lines × 2) · ×1
  • Duplicated block (23–32 lines × 2) layout/src/solver3/cache.rs:2055 — layout/src/solver3/cache.rs:2055-2086 | layout/src/solver3/cache.rs:2196-2218 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/cache.rs:2055` it begins part-way through the construct above it, so those 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) layout/src/widgets/themes/flat.rs:1784 — layout/src/widgets/themes/flat.rs:1784-1815 | layout/src/widgets/themes/flora.rs:2202-2233 — before extracting anything, compare `layout/src/widgets/themes/flat.rs` and `layout/src/widgets/themes/flora.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 927 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (28–31 lines × 3) · ×1
  • Duplicated block (28–31 lines × 3) webrender/core/src/prepare.rs:837 — webrender/core/src/prepare.rs:837-864 | webrender/core/src/prepare.rs:893-920 | webrender/core/src/prepare.rs:949-979 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/core/src/prepare.rs:837` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (31 lines × 2) · ×1
  • Duplicated block (31 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:10916 — dll/src/desktop/shell2/linux/wayland/mod.rs:10916-10946 | dll/src/desktop/shell2/linux/x11/mod.rs:8673-8703 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:10916` it begins part-way through the construct above it, so those 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 (29–31 lines × 2) · ×1
  • Duplicated block (29–31 lines × 2) doc/src/codegen/v2/ir_builder.rs:571 — doc/src/codegen/v2/ir_builder.rs:571-599 | doc/src/codegen/v2/ir_builder.rs:637-667 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/ir_builder.rs:571` it begins part-way through the construct above it, so those 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–31 lines × 2) · ×1
  • Duplicated block (26–31 lines × 2) webrender/core/src/quad.rs:210 — webrender/core/src/quad.rs:210-240 | webrender/core/src/quad.rs:635-660 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/core/src/quad.rs:210` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (26–30 lines × 4) · ×1
  • Duplicated block (26–30 lines × 4) doc/src/reftest/autodoc.rs:1065 — doc/src/reftest/autodoc.rs:1065-1090 | doc/src/reftest/autoreview.rs:700-729 | doc/src/reftest/autoreview.rs:936-965 | doc/src/reftest/autoreview.rs:1841-1868 — before extracting anything, compare `doc/src/reftest/autodoc.rs` and `doc/src/reftest/autoreview.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 212 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/reftest/autodoc.rs:1065` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (28–30 lines × 3) · ×1
  • Duplicated block (28–30 lines × 3) doc/src/reftest/regression.rs:900 — doc/src/reftest/regression.rs:900-927 | doc/src/reftest/regression.rs:1004-1033 | doc/src/reftest/regression.rs:1797-1826 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/reftest/regression.rs:900` it does not close everything it opens, so those 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 (29 lines × 4) · ×1
  • Duplicated block (29 lines × 4) doc/src/codegen/v2/lang_cpp/cpp03.rs:287 — doc/src/codegen/v2/lang_cpp/cpp03.rs:287-315 | doc/src/codegen/v2/lang_cpp/cpp11.rs:186-214 | doc/src/codegen/v2/lang_cpp/cpp17.rs:334-362 | doc/src/codegen/v2/lang_cpp/cpp20.rs:1030-1058 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/codegen/v2/lang_cpp/cpp03.rs:287` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (28–29 lines × 2) · ×1
  • Duplicated block (28–29 lines × 2) doc/src/api.rs:1848 — doc/src/api.rs:1848-1876 | doc/src/api.rs:1896-1923 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/api.rs:1848` it does not close everything it opens, so those 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 × 3) · ×1
  • Duplicated block (28 lines × 3) doc/src/codegen/v2/lang_cpp/cpp11.rs:479 — doc/src/codegen/v2/lang_cpp/cpp11.rs:479-506 | doc/src/codegen/v2/lang_cpp/cpp17.rs:668-695 | doc/src/codegen/v2/lang_cpp/cpp20.rs:367-394 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp11.rs` and `doc/src/codegen/v2/lang_cpp/cpp17.rs` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 669 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/codegen/v2/lang_cpp/cpp11.rs:479` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `doc/src/codegen/v2/lang_cpp/cpp17.rs:698` calls `emit_option_to_std_optional` and `doc/src/codegen/v2/lang_cpp/cpp11.rs:507` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (25–28 lines × 3) · ×1
  • Duplicated block (25–28 lines × 3) doc/src/reftest/autodoc.rs:1142 — doc/src/reftest/autodoc.rs:1142-1166 | doc/src/reftest/autoreview.rs:782-809 | doc/src/reftest/autoreview.rs:1921-1946 — before extracting anything, compare `doc/src/reftest/autodoc.rs` and `doc/src/reftest/autoreview.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 212 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/reftest/autodoc.rs:1142` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (25–28 lines × 2) · ×1
  • Duplicated block (25–28 lines × 2) doc/src/codegen/v2/lang_java/types.rs:336 — doc/src/codegen/v2/lang_java/types.rs:336-360 | doc/src/codegen/v2/lang_java/types.rs:705-732 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_java/types.rs:336` 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 (23–27 lines × 10) · ×1
  • Duplicated block (23–27 lines × 10) dll/src/desktop/shell2/macos/mod.rs:300 — dll/src/desktop/shell2/macos/mod.rs:300-323 | dll/src/desktop/shell2/macos/mod.rs:347-369 | dll/src/desktop/shell2/macos/mod.rs:376-398 | dll/src/desktop/shell2/macos/mod.rs:406-428 | dll/src/desktop/shell2/macos/mod.rs:669-695 | dll/src/desktop/shell2/macos/mod.rs:703-725 | dll/src/desktop/shell2/macos/mod.rs:733-755 | dll/src/desktop/shell2/macos/mod.rs:762-784 | dll/src/desktop/shell2/macos/mod.rs:791-813 | dll/src/desktop/shell2/macos/mod.rs:820-842 — 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 `dll/src/desktop/shell2/macos/mod.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.
D4 · Code Duplication · Duplicated block (26–27 lines × 6) · ×1
  • Duplicated block (26–27 lines × 6) doc/src/codegen/v2/lang_cpp/cpp03.rs:83 — doc/src/codegen/v2/lang_cpp/cpp03.rs:83-109 | doc/src/codegen/v2/lang_cpp/cpp11.rs:93-119 | doc/src/codegen/v2/lang_cpp/cpp14.rs:75-100 | doc/src/codegen/v2/lang_cpp/cpp17.rs:94-120 | doc/src/codegen/v2/lang_cpp/cpp20.rs:101-127 | doc/src/codegen/v2/lang_cpp/cpp20.rs:485-510 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/codegen/v2/lang_cpp/cpp03.rs:83` 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, `doc/src/codegen/v2/lang_cpp/cpp11.rs:87` calls `push_str`, `generate_template_reflection`, `generate_refany_freefn_downcasts` and `doc/src/codegen/v2/lang_cpp/cpp03.rs:80` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (25–27 lines × 3) · ×1
  • Duplicated block (25–27 lines × 3) doc/src/reftest/apply_midlevel.rs:379 — doc/src/reftest/apply_midlevel.rs:379-405 | doc/src/reftest/apply_midlevel.rs:1413-1437 | doc/src/reftest/apply_midlevel.rs:1615-1639 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (20–27 lines × 2) · ×1
  • Duplicated block (20–27 lines × 2) core/src/styled_dom.rs:1782 — core/src/styled_dom.rs:1782-1801 | core/src/styled_dom.rs:2322-2348 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (19–27 lines × 2) · ×1
  • Duplicated block (19–27 lines × 2) css/src/props/basic/font.rs:803 — css/src/props/basic/font.rs:803-821 | layout/src/text3/default.rs:258-284 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (17–27 lines × 2) · ×1
  • Duplicated block (17–27 lines × 2) doc/src/codegen/v2/lang_rust.rs:2634 — doc/src/codegen/v2/lang_rust.rs:2634-2660 | doc/src/codegen/v2/rust/shared.rs:198-214 — before extracting anything, compare `doc/src/codegen/v2/lang_rust.rs` and `doc/src/codegen/v2/rust/shared.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 210 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 `doc/src/codegen/v2/lang_rust.rs:2634` it does not close everything it opens, so those 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–27 lines × 2) · ×1
  • Duplicated block (26–27 lines × 2) layout/src/window.rs:19500 — layout/src/window.rs:19500-19526 | layout/src/window.rs:19602-19627 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/window.rs:19500` it begins part-way through the construct above it, so those 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 (25–26 lines × 5) · ×1
  • Duplicated block (25–26 lines × 5) webrender/core/src/batch.rs:2424 — webrender/core/src/batch.rs:2424-2449 | webrender/core/src/batch.rs:2556-2581 | webrender/core/src/batch.rs:2955-2979 | webrender/core/src/batch.rs:3082-3106 | webrender/core/src/batch.rs:3209-3233 — 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 `webrender/core/src/batch.rs:2424` it begins part-way through the construct above it, so those 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 (26 lines × 4) · ×1
  • Duplicated block (26 lines × 4) webrender/core/src/picture.rs:6409 — webrender/core/src/picture.rs:6409-6434 | webrender/core/src/picture.rs:6439-6464 | webrender/core/src/picture.rs:6469-6494 | webrender/core/src/picture.rs:6505-6530 — 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 `webrender/core/src/picture.rs:6409` 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 (25–26 lines × 2) · ×1
  • Duplicated block (25–26 lines × 2) doc/src/autofix/type_resolver.rs:624 — doc/src/autofix/type_resolver.rs:624-648 | doc/src/autofix/type_resolver.rs:678-703 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/type_resolver.rs:624` it begins part-way through the construct above it, so those 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–26 lines × 2) · ×1
  • Duplicated block (17–26 lines × 2) layout/src/solver3/sizing.rs:2527 — layout/src/solver3/sizing.rs:2527-2552 | layout/src/solver3/sizing.rs:2686-2702 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/sizing.rs:2527` it begins part-way through the construct above it, so those 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–26 lines × 2) · ×1
  • Duplicated block (21–26 lines × 2) layout/src/widgets/text_area.rs:656 — layout/src/widgets/text_area.rs:656-676 | layout/src/widgets/text_input.rs:1029-1054 — before extracting anything, compare `layout/src/widgets/text_area.rs` and `layout/src/widgets/text_input.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `layout/src/widgets/text_area.rs:656` it begins part-way through the construct above it, so those 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–25 lines × 5) · ×1
  • Duplicated block (9–25 lines × 5) dll/src/desktop/shell2/android/mod.rs:414 — dll/src/desktop/shell2/android/mod.rs:414-424 | dll/src/desktop/shell2/headless/mod.rs:1748-1772 | dll/src/desktop/shell2/headless/mod.rs:1913-1921 | dll/src/desktop/shell2/ios/mod.rs:1813-1821 | dll/src/desktop/shell2/ios/mod.rs:1964-1974 — `dll/src/desktop/shell2/android/mod.rs` and `dll/src/desktop/shell2/headless/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 106 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/android/mod.rs:414` it does not close everything it opens, so those 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, `dll/src/desktop/shell2/headless/mod.rs:1738` calls `rebuild_cpu_hit_tester` and `dll/src/desktop/shell2/headless/mod.rs:1911` 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 (25 lines × 4) · ×1
  • Duplicated block (25 lines × 4) webrender/core/src/batch.rs:2839 — webrender/core/src/batch.rs:2839-2863 | webrender/core/src/batch.rs:2964-2988 | webrender/core/src/batch.rs:3091-3115 | webrender/core/src/batch.rs:3218-3242 — 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 `webrender/core/src/batch.rs:2839` it begins part-way through the construct above it, so those 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–25 lines × 3) · ×1
  • Duplicated block (21–25 lines × 3) doc/src/codegen/v2/lang_rust.rs:4854 — doc/src/codegen/v2/lang_rust.rs:4854-4878 | doc/src/codegen/v2/lang_rust.rs:4909-4933 | doc/src/codegen/v2/rust/static_binding.rs:535-555 — before extracting anything, compare `doc/src/codegen/v2/lang_rust.rs` and `doc/src/codegen/v2/rust/static_binding.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 100 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 `doc/src/codegen/v2/lang_rust.rs:4854` it does not close everything it opens, so those 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 (25 lines × 3) · ×1
  • Duplicated block (25 lines × 3) webrender/core/src/batch.rs:1584 — webrender/core/src/batch.rs:1584-1608 | webrender/core/src/batch.rs:2235-2259 | webrender/core/src/batch.rs:2278-2302 — all 3 copies are in the same file, so extract the block into one function there and call 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 (3–25 lines × 4) · ×1
  • Duplicated block (3–25 lines × 4) webrender/swgl/src/shaders/ps_quad_conic_gradient.rs:118 — webrender/swgl/src/shaders/ps_quad_conic_gradient.rs:118-136 | webrender/swgl/src/shaders/ps_quad_mask.rs:254-256 | webrender/swgl/src/shaders/ps_quad_mask_fast_path.rs:182-198 | webrender/swgl/src/shaders/ps_quad_radial_gradient.rs:105-129 — before extracting anything, compare `webrender/swgl/src/shaders/ps_quad_conic_gradient.rs` and `webrender/swgl/src/shaders/ps_quad_mask.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/swgl/src/shaders/ps_quad_conic_gradient.rs:118` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (20–25 lines × 2) · ×1
  • Duplicated block (20–25 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:3531 — dll/src/desktop/shell2/linux/wayland/mod.rs:3531-3555 | dll/src/desktop/shell2/linux/wayland/mod.rs:5348-5367 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:3531` it begins part-way through the construct above it, so those 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–25 lines × 2) · ×1
  • Duplicated block (22–25 lines × 2) doc/src/autofix/type_index.rs:3394 — doc/src/autofix/type_index.rs:3394-3418 | doc/src/autotest/extract.rs:353-374 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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 (18–25 lines × 2) · ×1
  • Duplicated block (18–25 lines × 2) layout/src/form.rs:72 — layout/src/form.rs:72-96 | layout/src/form.rs:308-325 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/form.rs:72` it does not close everything it opens, so those 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 × 18) · ×1
  • Duplicated block (24 lines × 18) doc/src/codegen/v2/lang_ada/functions.rs:102 — doc/src/codegen/v2/lang_ada/functions.rs:102-125 | doc/src/codegen/v2/lang_algol68/functions.rs:102-125 | doc/src/codegen/v2/lang_cobol/functions.rs:108-131 | doc/src/codegen/v2/lang_csharp/functions.rs:165-188 | doc/src/codegen/v2/lang_fortran/functions.rs:124-147 | doc/src/codegen/v2/lang_freebasic/functions.rs:85-108 | doc/src/codegen/v2/lang_haskell/functions.rs:452-475 | doc/src/codegen/v2/lang_java/functions.rs:197-220 | doc/src/codegen/v2/lang_julia/mod.rs:447-470 | doc/src/codegen/v2/lang_lisp/functions.rs:86-109 | doc/src/codegen/v2/lang_nim/functions.rs:87-110 | doc/src/codegen/v2/lang_ocaml/functions.rs:100-123 | doc/src/codegen/v2/lang_odin/mod.rs:368-391 | doc/src/codegen/v2/lang_pascal/functions.rs:133-156 | doc/src/codegen/v2/lang_racket/functions.rs:86-109 | doc/src/codegen/v2/lang_smalltalk/functions.rs:142-165 | doc/src/codegen/v2/lang_v/mod.rs:400-423 | doc/src/codegen/v2/lang_vb6/functions.rs:100-123 — `doc/src/codegen/v2/lang_freebasic/functions.rs` and `doc/src/codegen/v2/lang_pascal/functions.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_ada/functions.rs:102` 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 (23–24 lines × 4) · ×1
  • Duplicated block (23–24 lines × 4) doc/src/reftest/autodoc.rs:1092 — doc/src/reftest/autodoc.rs:1092-1114 | doc/src/reftest/autoreview.rs:731-754 | doc/src/reftest/autoreview.rs:967-990 | doc/src/reftest/autoreview.rs:1870-1893 — before extracting anything, compare `doc/src/reftest/autodoc.rs` and `doc/src/reftest/autoreview.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 212 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/reftest/autodoc.rs:1092` it begins part-way through the construct above it, so those 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–24 lines × 2) · ×1
  • Duplicated block (20–24 lines × 2) dll/src/desktop/shell2/linux/wayland/events.rs:2571 — dll/src/desktop/shell2/linux/wayland/events.rs:2571-2590 | dll/src/desktop/shell2/linux/x11/mod.rs:1503-1526 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/events.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 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 (21–24 lines × 2) · ×1
  • Duplicated block (21–24 lines × 2) doc/src/reftest/autodoc.rs:1030 — doc/src/reftest/autodoc.rs:1030-1050 | doc/src/reftest/autoreview.rs:1803-1826 — before extracting anything, compare `doc/src/reftest/autodoc.rs` and `doc/src/reftest/autoreview.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 212 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/reftest/autodoc.rs:1030` it begins part-way through the construct above it, so those 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) · ×1
  • Duplicated block (26 lines × 2) layout/src/desktop/dialogs.rs:542 — layout/src/desktop/dialogs.rs:542-567 | layout/src/desktop/dialogs.rs:623-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 `layout/src/desktop/dialogs.rs:542` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (39 lines × 2) · ×1
  • Duplicated block (39 lines × 2) layout/src/widgets/themes/flat.rs:730 — layout/src/widgets/themes/flat.rs:730-768 | layout/src/widgets/themes/flora.rs:990-1028 — before extracting anything, compare `layout/src/widgets/themes/flat.rs` and `layout/src/widgets/themes/flora.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 927 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `layout/src/widgets/themes/flat.rs:730` it begins part-way through the construct above it, so those 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–23 lines × 20) · ×1
  • Duplicated block (20–23 lines × 20) doc/src/codegen/v2/lang_ada/functions.rs:81 — doc/src/codegen/v2/lang_ada/functions.rs:81-100 | doc/src/codegen/v2/lang_algol68/functions.rs:81-100 | doc/src/codegen/v2/lang_cobol/functions.rs:87-106 | doc/src/codegen/v2/lang_csharp/functions.rs:142-164 | doc/src/codegen/v2/lang_fortran/functions.rs:102-123 | doc/src/codegen/v2/lang_freebasic/functions.rs:64-83 | doc/src/codegen/v2/lang_haskell/functions.rs:430-451 | doc/src/codegen/v2/lang_java/functions.rs:175-196 | doc/src/codegen/v2/lang_julia/mod.rs:426-445 | doc/src/codegen/v2/lang_kotlin/mod.rs:199-220 | doc/src/codegen/v2/lang_lisp/functions.rs:65-84 | doc/src/codegen/v2/lang_nim/functions.rs:66-85 | doc/src/codegen/v2/lang_ocaml/functions.rs:78-99 | doc/src/codegen/v2/lang_odin/mod.rs:347-366 | doc/src/codegen/v2/lang_pascal/functions.rs:111-132 | doc/src/codegen/v2/lang_racket/functions.rs:65-84 | doc/src/codegen/v2/lang_red/mod.rs:356-375 | doc/src/codegen/v2/lang_smalltalk/functions.rs:121-140 | doc/src/codegen/v2/lang_v/mod.rs:379-398 | doc/src/codegen/v2/lang_vb6/functions.rs:79-98 — `doc/src/codegen/v2/lang_freebasic/functions.rs` and `doc/src/codegen/v2/lang_pascal/functions.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_ada/functions.rs:81` it does not close everything it opens, so those 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–23 lines × 14) · ×1
  • Duplicated block (6–23 lines × 14) dll/src/desktop/shell2/linux/wayland/defines.rs:1921 — dll/src/desktop/shell2/linux/wayland/defines.rs:1921-1937 | dll/src/desktop/shell2/linux/wayland/defines.rs:1973-1989 | dll/src/desktop/shell2/linux/wayland/defines.rs:2025-2041 | dll/src/desktop/shell2/linux/wayland/defines.rs:2127-2143 | dll/src/desktop/shell2/linux/wayland/defines.rs:2254-2270 | dll/src/desktop/shell2/linux/wayland/defines.rs:2421-2437 | dll/src/desktop/shell2/linux/wayland/defines.rs:2533-2549 | dll/src/desktop/shell2/linux/wayland/defines.rs:2569-2585 | dll/src/desktop/shell2/linux/wayland/defines.rs:2612-2628 | dll/src/desktop/shell2/linux/wayland/defines.rs:2657-2678 | dll/src/desktop/shell2/linux/wayland/defines.rs:2860-2876 | dll/src/desktop/shell2/linux/wayland/defines.rs:2923-2945 | dll/src/desktop/shell2/linux/wayland/defines.rs:2960-2981 | dll/src/desktop/shell2/linux/wayland/defines.rs:3009-3014 — 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 `dll/src/desktop/shell2/linux/wayland/defines.rs:1921` it does not close everything it opens, so those 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 (21–23 lines × 5) · ×1
  • Duplicated block (21–23 lines × 5) dll/src/desktop/shell2/android/mod.rs:459 — dll/src/desktop/shell2/android/mod.rs:459-479 | dll/src/desktop/shell2/headless/mod.rs:1692-1714 | dll/src/desktop/shell2/ios/mod.rs:1911-1931 | dll/src/desktop/shell2/macos/mod.rs:6017-6039 | dll/src/desktop/shell2/windows/mod.rs:1829-1851 — `dll/src/desktop/shell2/android/mod.rs` and `dll/src/desktop/shell2/headless/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 106 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/android/mod.rs:459` 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 (23 lines × 4) · ×1
  • Duplicated block (23 lines × 4) webrender/core/src/batch.rs:1584 — webrender/core/src/batch.rs:1584-1606 | webrender/core/src/batch.rs:1710-1732 | webrender/core/src/batch.rs:2235-2257 | webrender/core/src/batch.rs:2278-2300 — 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 `webrender/core/src/batch.rs:1584` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15–23 lines × 3) · ×1
  • Duplicated block (15–23 lines × 3) dll/src/desktop/shell2/linux/wayland/mod.rs:6296 — dll/src/desktop/shell2/linux/wayland/mod.rs:6296-6310 | dll/src/desktop/shell2/linux/x11/events.rs:1437-1451 | dll/src/desktop/shell2/macos/events.rs:1115-1137 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/events.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 263 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (23 lines × 3) · ×1
  • Duplicated block (23 lines × 3) webrender/swgl/src/shaders/brush_blend.rs:114 — webrender/swgl/src/shaders/brush_blend.rs:114-136 | webrender/swgl/src/shaders/brush_solid.rs:115-137 | webrender/swgl/src/shaders/brush_solid_alpha_pass.rs:102-124 — before extracting anything, compare `webrender/swgl/src/shaders/brush_blend.rs` and `webrender/swgl/src/shaders/brush_solid.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 193 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_blend.rs:114` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–23 lines × 2) · ×1
  • Duplicated block (14–23 lines × 2) dll/src/desktop/extra/gamepad/apple.rs:323 — dll/src/desktop/extra/gamepad/apple.rs:323-336 | dll/src/desktop/extra/gamepad/apple.rs:339-361 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/extra/gamepad/apple.rs:323` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16–23 lines × 2) · ×1
  • Duplicated block (16–23 lines × 2) doc/src/codegen/v2/lang_cpp/cpp20.rs:47 — doc/src/codegen/v2/lang_cpp/cpp20.rs:47-69 | doc/src/codegen/v2/lang_cpp/cpp20.rs:443-458 — both copies are in the same file, so extract the 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 (3–23 lines × 8) · ×1
  • Duplicated block (3–23 lines × 8) doc/src/codegen/v2/config.rs:391 — doc/src/codegen/v2/config.rs:391-393 | doc/src/codegen/v2/lang_crystal/mod.rs:319-321 | doc/src/codegen/v2/lang_freebasic/mod.rs:118-140 | doc/src/codegen/v2/lang_julia/mod.rs:214-216 | doc/src/codegen/v2/lang_nim/mod.rs:147-165 | doc/src/codegen/v2/lang_odin/mod.rs:148-150 | doc/src/codegen/v2/lang_pascal/mod.rs:246-248 | doc/src/codegen/v2/lang_v/mod.rs:172-174 — `doc/src/codegen/v2/lang_crystal/mod.rs` and `doc/src/codegen/v2/lang_julia/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 51 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/config.rs:391` it does not close everything it opens, so those 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–23 lines × 2) · ×1
  • Duplicated block (20–23 lines × 2) doc/src/codegen/v2/lang_java/wrappers.rs:287 — doc/src/codegen/v2/lang_java/wrappers.rs:287-309 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:681-700 — `doc/src/codegen/v2/lang_java/wrappers.rs` and `doc/src/codegen/v2/lang_kotlin/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 173 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_java/wrappers.rs:287` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (18–23 lines × 2) · ×1
  • Duplicated block (18–23 lines × 2) doc/src/codegen/v2/lang_php/wrappers.rs:117 — doc/src/codegen/v2/lang_php/wrappers.rs:117-139 | doc/src/codegen/v2/lang_php/wrappers.rs:236-253 — both copies are in the same file, so extract the 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 (54 lines × 2) · ×1
  • Duplicated block (54 lines × 2) layout/src/widgets/themes/flat.rs:932 — layout/src/widgets/themes/flat.rs:932-985 | layout/src/widgets/themes/flora.rs:1204-1257 — before extracting anything, compare `layout/src/widgets/themes/flat.rs` and `layout/src/widgets/themes/flora.rs` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 927 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (6–22 lines × 12) · ×1
  • Duplicated block (6–22 lines × 12) dll/src/desktop/shell2/linux/wayland/defines.rs:758 — dll/src/desktop/shell2/linux/wayland/defines.rs:758-774 | dll/src/desktop/shell2/linux/wayland/defines.rs:799-820 | dll/src/desktop/shell2/linux/wayland/defines.rs:846-862 | dll/src/desktop/shell2/linux/wayland/defines.rs:887-908 | dll/src/desktop/shell2/linux/wayland/defines.rs:939-955 | dll/src/desktop/shell2/linux/wayland/defines.rs:1006-1027 | dll/src/desktop/shell2/linux/wayland/defines.rs:1122-1138 | dll/src/desktop/shell2/linux/wayland/defines.rs:1163-1184 | dll/src/desktop/shell2/linux/wayland/defines.rs:1257-1262 | dll/src/desktop/shell2/linux/wayland/defines.rs:1371-1376 | dll/src/desktop/shell2/linux/wayland/defines.rs:1490-1506 | dll/src/desktop/shell2/linux/wayland/defines.rs:1545-1551 — 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 `dll/src/desktop/shell2/linux/wayland/defines.rs:758` 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 (22 lines × 5) · ×1
  • Duplicated block (22 lines × 5) webrender/core/src/picture.rs:6383 — webrender/core/src/picture.rs:6383-6404 | webrender/core/src/picture.rs:6413-6434 | webrender/core/src/picture.rs:6443-6464 | webrender/core/src/picture.rs:6473-6494 | webrender/core/src/picture.rs:6509-6530 — 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 `webrender/core/src/picture.rs:6383` 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 lines × 4) · ×1
  • Duplicated block (22 lines × 4) layout/src/widgets/themes/flora.rs:1351 — layout/src/widgets/themes/flora.rs:1351-1372 | layout/src/widgets/themes/flora.rs:1374-1395 | layout/src/widgets/themes/flora.rs:1397-1418 | layout/src/widgets/themes/flora.rs:1420-1441 — 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 `layout/src/widgets/themes/flora.rs:1351` 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–22 lines × 4) · ×1
  • Duplicated block (20–22 lines × 4) webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:104 — webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:104-123 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:104-123 | webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs:104-125 | webrender/swgl/src/shaders/brush_opacity_antialiasing.rs:103-123 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs` and `webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 392 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:104` it begins part-way through the construct above it, so those 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 × 4) · ×1
  • Duplicated block (21–22 lines × 4) webrender/swgl/src/shaders/brush_image_texture_rect.rs:100 — webrender/swgl/src/shaders/brush_image_texture_rect.rs:100-120 | webrender/swgl/src/shaders/brush_opacity.rs:100-121 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:150-170 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:148-168 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_texture_rect.rs` and `webrender/swgl/src/shaders/brush_opacity.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 158 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/swgl/src/shaders/brush_image_texture_rect.rs:100` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `context` to `&ShaderContext` in one and `&mut ShaderContext` 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 (21–22 lines × 3) · ×1
  • Duplicated block (21–22 lines × 3) dll/src/desktop/shell2/android/mod.rs:483 — dll/src/desktop/shell2/android/mod.rs:483-504 | dll/src/desktop/shell2/headless/mod.rs:1718-1738 | dll/src/desktop/shell2/ios/mod.rs:1935-1955 — `dll/src/desktop/shell2/android/mod.rs` and `dll/src/desktop/shell2/headless/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 106 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/android/mod.rs:483` 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 (22 lines × 3) · ×1
  • Duplicated block (22 lines × 3) layout/src/xml/svg.rs:165 — layout/src/xml/svg.rs:165-186 | layout/src/xml/svg.rs:215-236 | layout/src/xml/svg.rs:662-683 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/xml/svg.rs:165` 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–22 lines × 2) · ×1
  • Duplicated block (19–22 lines × 2) dll/src/desktop/shell2/linux/wayland/events.rs:823 — dll/src/desktop/shell2/linux/wayland/events.rs:823-844 | dll/src/desktop/shell2/linux/wayland/events.rs:1239-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 `dll/src/desktop/shell2/linux/wayland/events.rs:823` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16–22 lines × 2) · ×1
  • Duplicated block (16–22 lines × 2) dll/src/desktop/shell2/windows/mod.rs:5804 — dll/src/desktop/shell2/windows/mod.rs:5804-5819 | dll/src/desktop/shell2/windows/mod.rs:6005-6026 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/windows/mod.rs:5804` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (12–22 lines × 2) · ×1
  • Duplicated block (12–22 lines × 2) dll/src/web/transpiler_remill.rs:1477 — dll/src/web/transpiler_remill.rs:1477-1498 | dll/src/web/transpiler_remill.rs:6765-6776 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/web/transpiler_remill.rs:1477` it begins part-way through the construct above it, so those 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–21 lines × 11) · ×1
  • Duplicated block (19–21 lines × 11) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:163 — webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:163-182 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:165-185 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:151-170 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:165-183 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:156-176 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:141-159 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:125-143 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:124-142 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:161-181 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:161-181 | webrender/swgl/src/shaders/brush_image_texture_rect.rs:153-171 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs` and `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 439 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:163` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `context` to `&mut ShaderContext` in one and `&ShaderContext` 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, `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:150` calls `texture_size` and `webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:123` 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 (18–21 lines × 5) · ×1
  • Duplicated block (18–21 lines × 5) doc/src/codegen/v2/lang_cpp/cpp11.rs:67 — doc/src/codegen/v2/lang_cpp/cpp11.rs:67-87 | doc/src/codegen/v2/lang_cpp/cpp14.rs:52-70 | doc/src/codegen/v2/lang_cpp/cpp17.rs:66-86 | doc/src/codegen/v2/lang_cpp/cpp20.rs:76-95 | doc/src/codegen/v2/lang_cpp/cpp20.rs:465-482 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp11.rs` and `doc/src/codegen/v2/lang_cpp/cpp14.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 164 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/codegen/v2/lang_cpp/cpp11.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `doc/src/codegen/v2/lang_cpp/cpp11.rs:90` calls `push_str`, `generate_refany_freefn_downcasts` and `doc/src/codegen/v2/lang_cpp/cpp20.rs:485` 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 (18–21 lines × 4) · ×1
  • Duplicated block (18–21 lines × 4) doc/src/reftest/autodebug.rs:2198 — doc/src/reftest/autodebug.rs:2198-2218 | doc/src/reftest/autodoc.rs:934-951 | doc/src/reftest/autoreview.rs:1144-1163 | doc/src/reftest/autoreview.rs:1583-1602 — before extracting anything, compare `doc/src/reftest/autodebug.rs` and `doc/src/reftest/autodoc.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/reftest/autodebug.rs:2198` it does not close everything it opens, so those 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, `doc/src/reftest/autodoc.rs:931` calls `clone` and `doc/src/reftest/autodebug.rs:2196` 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–21 lines × 3) · ×1
  • Duplicated block (5–21 lines × 3) dll/src/desktop/shell2/linux/wayland/defines.rs:2073 — dll/src/desktop/shell2/linux/wayland/defines.rs:2073-2077 | dll/src/desktop/shell2/linux/wayland/defines.rs:2205-2209 | dll/src/desktop/shell2/linux/wayland/defines.rs:2387-2407 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/defines.rs:2073` 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 (17–21 lines × 3) · ×1
  • Duplicated block (17–21 lines × 3) layout/src/cpurender/compositor.rs:2523 — layout/src/cpurender/compositor.rs:2523-2539 | layout/src/cpurender/raster.rs:1420-1440 | layout/src/cpurender/raster.rs:1777-1797 — before extracting anything, compare `layout/src/cpurender/compositor.rs` and `layout/src/cpurender/raster.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/cpurender/compositor.rs:2523` it begins part-way through the construct above it, so those 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 × 3) · ×1
  • Duplicated block (20–21 lines × 3) layout/src/solver3/fc.rs:8862 — layout/src/solver3/fc.rs:8862-8881 | layout/src/solver3/fc.rs:9386-9406 | layout/src/solver3/fc.rs:9592-9611 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (18–21 lines × 3) · ×1
  • Duplicated block (18–21 lines × 3) layout/src/xml/mod.rs:582 — layout/src/xml/mod.rs:582-599 | layout/src/xml/mod.rs:628-648 | layout/src/xml/mod.rs:680-697 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (16–21 lines × 3) · ×1
  • Duplicated block (16–21 lines × 3) webrender/core/src/quad.rs:210 — webrender/core/src/quad.rs:210-230 | webrender/core/src/quad.rs:464-479 | webrender/core/src/quad.rs:635-650 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/core/src/quad.rs:210` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15–21 lines × 2) · ×1
  • Duplicated block (15–21 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:3412 — dll/src/desktop/shell2/linux/wayland/mod.rs:3412-3426 | dll/src/desktop/shell2/linux/x11/mod.rs:4440-4460 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:3412` it does not close everything it opens, so those 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–21 lines × 2) · ×1
  • Duplicated block (9–21 lines × 2) layout/src/solver3/display_list.rs:5553 — layout/src/solver3/display_list.rs:5553-5561 | layout/src/solver3/display_list.rs:5715-5735 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/display_list.rs:5553` it begins part-way through the construct above it, so those 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 (17–21 lines × 2) · ×1
  • Duplicated block (17–21 lines × 2) layout/src/widgets/node_graph.rs:3194 — layout/src/widgets/node_graph.rs:3194-3214 | layout/src/widgets/node_graph.rs:3361-3377 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/widgets/node_graph.rs:3194` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (8–20 lines × 36) · ×1
  • Duplicated block (8–20 lines × 36) webrender/swgl/src/shaders/brush_blend.rs:529 — webrender/swgl/src/shaders/brush_blend.rs:529-536 | webrender/swgl/src/shaders/brush_blend_alpha_pass.rs:473-480 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:531-538 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:534-541 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:525-532 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:458-465 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:509-516 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:466-473 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:402-409 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:387-394 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:460-467 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:448-455 | webrender/swgl/src/shaders/brush_image_texture_2d.rs:319-326 | webrender/swgl/src/shaders/brush_image_texture_rect.rs:379-386 | webrender/swgl/src/shaders/brush_linear_gradient.rs:349-356 | webrender/swgl/src/shaders/brush_linear_gradient_alpha_pass.rs:365-372 | webrender/swgl/src/shaders/brush_mix_blend.rs:479-486 | webrender/swgl/src/shaders/brush_mix_blend_alpha_pass.rs:444-451 | webrender/swgl/src/shaders/brush_opacity.rs:284-291 | webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs:384-391 | webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs:366-373 | webrender/swgl/src/shaders/brush_opacity_antialiasing.rs:348-355 | webrender/swgl/src/shaders/brush_solid.rs:282-289 | webrender/swgl/src/shaders/brush_solid_alpha_pass.rs:268-287 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:512-519 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:497-504 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:471-478 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:446-453 | webrender/swgl/src/shaders/cs_blur_alpha_target.rs:363-370 | webrender/swgl/src/shaders/cs_blur_color_target.rs:328-335 | webrender/swgl/src/shaders/cs_svg_filter_node.rs:467-474 | webrender/swgl/src/shaders/ps_split_composite.rs:314-321 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs:371-378 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_texture_2d.rs:314-321 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_glyph_transform_texture_2d.rs:329-336 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_texture_2d.rs:372-379 — before extracting anything, compare `webrender/swgl/src/shaders/brush_blend.rs` and `webrender/swgl/src/shaders/brush_blend_alpha_pass.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_blend.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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `webrender/swgl/src/shaders/brush_linear_gradient.rs:346` calls `strcmp` and `webrender/swgl/src/shaders/brush_blend.rs:526` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (20 lines × 5) · ×1
  • Duplicated block (20 lines × 5) webrender/core/src/batch.rs:1590 — webrender/core/src/batch.rs:1590-1609 | webrender/core/src/batch.rs:1688-1707 | webrender/core/src/batch.rs:1967-1986 | webrender/core/src/batch.rs:2241-2260 | webrender/core/src/batch.rs:2284-2303 — 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 `webrender/core/src/batch.rs:1590` 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 lines × 4) · ×1
  • Duplicated block (20 lines × 4) doc/src/reftest/autodoc.rs:1042 — doc/src/reftest/autodoc.rs:1042-1061 | doc/src/reftest/autoreview.rs:677-696 | doc/src/reftest/autoreview.rs:913-932 | doc/src/reftest/autoreview.rs:1818-1837 — before extracting anything, compare `doc/src/reftest/autodoc.rs` and `doc/src/reftest/autoreview.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 212 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/reftest/autodoc.rs:1042` it begins part-way through the construct above it, so those 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 × 4) · ×1
  • Duplicated block (19–20 lines × 4) layout/src/solver3/display_list.rs:4731 — layout/src/solver3/display_list.rs:4731-4750 | layout/src/solver3/display_list.rs:5082-5100 | layout/src/solver3/display_list.rs:5181-5199 | layout/src/solver3/display_list.rs:5267-5285 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `layout/src/solver3/display_list.rs:5103` calls `Some` and `layout/src/solver3/display_list.rs:4753` 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–20 lines × 3) · ×1
  • Duplicated block (17–20 lines × 3) dll/src/desktop/shell2/linux/x11/mod.rs:7091 — dll/src/desktop/shell2/linux/x11/mod.rs:7091-7108 | dll/src/desktop/shell2/macos/mod.rs:8402-8421 | dll/src/desktop/shell2/windows/mod.rs:1787-1803 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/mod.rs` and `dll/src/desktop/shell2/macos/mod.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (20 lines × 3) · ×1
  • Duplicated block (20 lines × 3) webrender/core/src/batch.rs:2412 — webrender/core/src/batch.rs:2412-2431 | webrender/core/src/batch.rs:2544-2563 | webrender/core/src/batch.rs:2668-2687 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/core/src/batch.rs:2412` it begins part-way through the construct above it, so those 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–20 lines × 2) · ×1
  • Duplicated block (14–20 lines × 2) dll/src/web/transpiler_remill.rs:2861 — dll/src/web/transpiler_remill.rs:2861-2874 | dll/src/web/transpiler_remill.rs:3527-3546 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/web/transpiler_remill.rs:2861` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (13–20 lines × 2) · ×1
  • Duplicated block (13–20 lines × 2) doc/src/codegen/v2/lang_rust.rs:3522 — doc/src/codegen/v2/lang_rust.rs:3522-3534 | doc/src/codegen/v2/lang_rust.rs:3719-3738 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_rust.rs:3522` it begins part-way through the construct above it, so those 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, `doc/src/codegen/v2/lang_rust.rs:3740` calls `sym` and `doc/src/codegen/v2/lang_rust.rs:3536` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (25–29 lines × 2) · ×1
  • Duplicated block (25–29 lines × 2) layout/src/solver3/fc.rs:6482 — layout/src/solver3/fc.rs:6482-6506 | layout/src/solver3/fc.rs:7959-7987 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/fc.rs:6482` 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 (11–20 lines × 2) · ×1
  • Duplicated block (11–20 lines × 2) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:399 — webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:399-418 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:337-347 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs` and `webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 251 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:399` 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 × 11) · ×1
  • Duplicated block (19 lines × 11) dll/src/desktop/shell2/macos/mod.rs:301 — dll/src/desktop/shell2/macos/mod.rs:301-319 | dll/src/desktop/shell2/macos/mod.rs:347-365 | dll/src/desktop/shell2/macos/mod.rs:376-394 | dll/src/desktop/shell2/macos/mod.rs:406-424 | dll/src/desktop/shell2/macos/mod.rs:669-687 | dll/src/desktop/shell2/macos/mod.rs:703-721 | dll/src/desktop/shell2/macos/mod.rs:733-751 | dll/src/desktop/shell2/macos/mod.rs:762-780 | dll/src/desktop/shell2/macos/mod.rs:791-809 | dll/src/desktop/shell2/macos/mod.rs:820-838 | dll/src/desktop/shell2/macos/mod.rs:880-898 — 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.
D4 · Code Duplication · Duplicated block (14–19 lines × 3) · ×1
  • Duplicated block (14–19 lines × 3) doc/src/codegen/v2/lang_node/wrappers.rs:437 — doc/src/codegen/v2/lang_node/wrappers.rs:437-455 | doc/src/codegen/v2/lang_node/wrappers.rs:661-674 | doc/src/codegen/v2/lang_node/wrappers.rs:1127-1140 — all 3 copies are in the same file, so extract the block into one function there and call 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, `doc/src/codegen/v2/lang_node/wrappers.rs:1142` calls `is_some` and `doc/src/codegen/v2/lang_node/wrappers.rs:677` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (13–19 lines × 3) · ×1
  • Duplicated block (13–19 lines × 3) doc/src/codegen/v2/lang_zig/wrappers.rs:731 — doc/src/codegen/v2/lang_zig/wrappers.rs:731-749 | doc/src/codegen/v2/lang_zig/wrappers.rs:935-947 | doc/src/codegen/v2/lang_zig/wrappers.rs:1015-1027 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_zig/wrappers.rs:731` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16–19 lines × 2) · ×1
  • Duplicated block (16–19 lines × 2) dll/src/desktop/shell2/common/layout.rs:953 — dll/src/desktop/shell2/common/layout.rs:953-971 | layout/src/window.rs:10871-10886 — 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 `dll/src/desktop/shell2/common/layout.rs:953` 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, `dll/src/desktop/shell2/common/layout.rs:972` calls `default` and `layout/src/window.rs:10887` 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–19 lines × 2) · ×1
  • Duplicated block (14–19 lines × 2) dll/src/web/transpiler_remill.rs:4889 — dll/src/web/transpiler_remill.rs:4889-4907 | dll/src/web/transpiler_remill.rs:4966-4979 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/web/transpiler_remill.rs:4889` it begins part-way through the construct above it, so those 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–19 lines × 2) · ×1
  • Duplicated block (12–19 lines × 2) doc/src/codegen/v2/lang_kotlin/wrappers.rs:1557 — doc/src/codegen/v2/lang_kotlin/wrappers.rs:1557-1575 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:1785-1796 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_kotlin/wrappers.rs:1557` it begins part-way through the construct above it, so those 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–19 lines × 2) · ×1
  • Duplicated block (17–19 lines × 2) webrender/core/src/picture.rs:4748 — webrender/core/src/picture.rs:4748-4764 | webrender/core/src/render_task.rs:2265-2283 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (8–18 lines × 7) · ×1
  • Duplicated block (8–18 lines × 7) webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:94 — webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:94-101 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:94-101 | webrender/swgl/src/shaders/brush_image_texture_2d.rs:91-100 | webrender/swgl/src/shaders/brush_image_texture_rect.rs:102-118 | webrender/swgl/src/shaders/brush_opacity.rs:102-119 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:152-168 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:150-166 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs` and `webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 285 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:94` it begins part-way through the construct above it, so those 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 `context` to `&ShaderContext` in one and `&mut ShaderContext` 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 (17–18 lines × 6) · ×1
  • Duplicated block (17–18 lines × 6) doc/src/codegen/v2/lang_cpp/cpp03.rs:56 — doc/src/codegen/v2/lang_cpp/cpp03.rs:56-73 | doc/src/codegen/v2/lang_cpp/cpp11.rs:57-74 | doc/src/codegen/v2/lang_cpp/cpp14.rs:43-59 | doc/src/codegen/v2/lang_cpp/cpp17.rs:56-73 | doc/src/codegen/v2/lang_cpp/cpp20.rs:66-83 | doc/src/codegen/v2/lang_cpp/cpp20.rs:455-472 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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, `doc/src/codegen/v2/lang_cpp/cpp03.rs:51` calls `push_str`, `generate_moved_from_helper` and `doc/src/codegen/v2/lang_cpp/cpp11.rs:52` 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–18 lines × 6) · ×1
  • Duplicated block (11–18 lines × 6) webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:120 — webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:120-136 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:120-136 | webrender/swgl/src/shaders/brush_image_texture_rect.rs:111-127 | webrender/swgl/src/shaders/brush_opacity.rs:111-128 | webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs:121-138 | webrender/swgl/src/shaders/brush_opacity_antialiasing.rs:120-130 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs` and `webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 392 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:120` it does not close everything it opens, so those 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 lines × 5) · ×1
  • Duplicated block (18 lines × 5) layout/src/dialogs/crash_reporter.rs:201 — layout/src/dialogs/crash_reporter.rs:201-218 | layout/src/dialogs/gpu_check.rs:215-232 | layout/src/dialogs/report_problem.rs:470-487 | layout/src/dialogs/telemetry_consent.rs:203-220 | layout/src/dialogs/update_version.rs:321-338 — before extracting anything, compare `layout/src/dialogs/crash_reporter.rs` and `layout/src/dialogs/report_problem.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (1–18 lines × 5) · ×1
  • Duplicated block (1–18 lines × 5) core/src/events.rs:1747 — core/src/events.rs:1747-1764 | core/src/events.rs:1890-1907 | core/src/events.rs:2049-2066 | core/src/window.rs:2585-2585 | layout/src/text3/default.rs:660-663 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 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 `core/src/events.rs:1747` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `filter` to `HoverEventFilter` in one and `FocusEventFilter` 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 (10–18 lines × 3) · ×1
  • Duplicated block (10–18 lines × 3) dll/src/desktop/shell2/linux/wayland/mod.rs:3419 — dll/src/desktop/shell2/linux/wayland/mod.rs:3419-3428 | dll/src/desktop/shell2/linux/wayland/mod.rs:3726-3735 | dll/src/desktop/shell2/linux/x11/mod.rs:4445-4462 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:3419` 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–18 lines × 3) · ×1
  • Duplicated block (9–18 lines × 3) doc/src/codegen/v2/lang_cpp/cpp11.rs:38 — doc/src/codegen/v2/lang_cpp/cpp11.rs:38-55 | doc/src/codegen/v2/lang_cpp/cpp14.rs:32-40 | doc/src/codegen/v2/lang_cpp/cpp17.rs:37-54 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp11.rs` and `doc/src/codegen/v2/lang_cpp/cpp14.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 164 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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, `doc/src/codegen/v2/lang_cpp/cpp17.rs:32` calls `push_str`, `generate_feature_docs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs:33` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (13–18 lines × 2) · ×1
  • Duplicated block (13–18 lines × 2) dll/src/desktop/extra/pdf/mod.rs:504 — dll/src/desktop/extra/pdf/mod.rs:504-516 | dll/src/desktop/extra/pdf/mod.rs:529-546 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/extra/pdf/mod.rs:504` it begins part-way through the construct above it, so those 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–31 lines × 2) · ×1
  • Duplicated block (24–31 lines × 2) doc/src/codegen/v2/lang_java/wrappers.rs:1753 — doc/src/codegen/v2/lang_java/wrappers.rs:1753-1783 | doc/src/codegen/v2/lang_java/wrappers.rs:1874-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. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_java/wrappers.rs:1753` it begins part-way through the construct above it, so those 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–17 lines × 16) · ×1
  • Duplicated block (9–17 lines × 16) webrender/swgl/src/shaders/brush_blend.rs:110 — webrender/swgl/src/shaders/brush_blend.rs:110-126 | webrender/swgl/src/shaders/brush_blend_alpha_pass.rs:100-108 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:106-115 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:108-117 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:103-111 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:108-117 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:99-108 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:103-111 | webrender/swgl/src/shaders/brush_linear_gradient.rs:101-109 | webrender/swgl/src/shaders/brush_linear_gradient_alpha_pass.rs:102-110 | webrender/swgl/src/shaders/brush_mix_blend_alpha_pass.rs:118-126 | webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs:102-111 | webrender/swgl/src/shaders/brush_solid.rs:111-127 | webrender/swgl/src/shaders/brush_solid_alpha_pass.rs:98-114 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:135-144 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:143-152 — before extracting anything, compare `webrender/swgl/src/shaders/brush_blend.rs` and `webrender/swgl/src/shaders/brush_blend_alpha_pass.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_blend.rs:110` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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–17 lines × 3) · ×1
  • Duplicated block (13–17 lines × 3) layout/src/solver3/fc.rs:8950 — layout/src/solver3/fc.rs:8950-8962 | layout/src/solver3/fc.rs:9500-9512 | layout/src/solver3/fc.rs:9997-10013 — all 3 copies are in the same file, so extract the block into one function there and call 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–17 lines × 2) · ×1
  • Duplicated block (12–17 lines × 2) dll/src/desktop/shell2/common/layout.rs:711 — dll/src/desktop/shell2/common/layout.rs:711-722 | dll/src/desktop/shell2/common/layout.rs:1358-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `dll/src/desktop/shell2/common/layout.rs:733` calls `publish_scroll_state` and `dll/src/desktop/shell2/common/layout.rs:1380` 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–17 lines × 2) · ×1
  • Duplicated block (9–17 lines × 2) dll/src/desktop/shell2/run.rs:979 — dll/src/desktop/shell2/run.rs:979-987 | dll/src/desktop/shell2/run.rs:1165-1181 — both copies are in the same file, so extract the 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, `dll/src/desktop/shell2/run.rs:989` calls `Err` and `dll/src/desktop/shell2/run.rs:1183` 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 (28–30 lines × 2) · ×1
  • Duplicated block (28–30 lines × 2) layout/src/cpurender/pixmap.rs:1522 — layout/src/cpurender/pixmap.rs:1522-1549 | layout/src/cpurender/pixmap.rs:1572-1601 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/cpurender/pixmap.rs:1522` 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–16 lines × 36) · ×1
  • Duplicated block (8–16 lines × 36) webrender/swgl/src/shaders/brush_blend.rs:42 — webrender/swgl/src/shaders/brush_blend.rs:42-57 | webrender/swgl/src/shaders/brush_blend_alpha_pass.rs:42-49 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:39-54 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:40-55 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:42-49 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:40-55 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:39-46 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:42-49 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:39-46 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:39-46 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:36-51 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:36-51 | webrender/swgl/src/shaders/brush_image_texture_2d.rs:36-43 | webrender/swgl/src/shaders/brush_image_texture_rect.rs:38-53 | webrender/swgl/src/shaders/brush_linear_gradient.rs:38-45 | webrender/swgl/src/shaders/brush_linear_gradient_alpha_pass.rs:39-46 | webrender/swgl/src/shaders/brush_mix_blend.rs:192-199 | webrender/swgl/src/shaders/brush_mix_blend_alpha_pass.rs:59-66 | webrender/swgl/src/shaders/brush_opacity.rs:36-51 | webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs:37-52 | webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs:35-50 | webrender/swgl/src/shaders/brush_opacity_antialiasing.rs:36-51 | webrender/swgl/src/shaders/brush_solid.rs:40-55 | webrender/swgl/src/shaders/brush_solid_alpha_pass.rs:34-49 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:71-78 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:79-86 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:89-96 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:80-95 | webrender/swgl/src/shaders/ps_quad_conic_gradient.rs:55-62 | webrender/swgl/src/shaders/ps_quad_radial_gradient.rs:41-48 | webrender/swgl/src/shaders/ps_quad_textured.rs:92-99 | webrender/swgl/src/shaders/ps_split_composite.rs:39-46 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs:63-70 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_texture_2d.rs:39-46 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_glyph_transform_texture_2d.rs:39-54 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_texture_2d.rs:65-72 — before extracting anything, compare `webrender/swgl/src/shaders/brush_blend.rs` and `webrender/swgl/src/shaders/brush_blend_alpha_pass.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (16 lines × 8) · ×1
  • Duplicated block (16 lines × 8) layout/src/xml/svg.rs:887 — layout/src/xml/svg.rs:887-902 | layout/src/xml/svg.rs:926-941 | layout/src/xml/svg.rs:994-1009 | layout/src/xml/svg.rs:1060-1075 | layout/src/xml/svg.rs:1137-1152 | layout/src/xml/svg.rs:1193-1208 | layout/src/xml/svg.rs:1241-1256 | layout/src/xml/svg.rs:1291-1306 — 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 `layout/src/xml/svg.rs:887` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16 lines × 6) · ×1
  • Duplicated block (16 lines × 6) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:227 — webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:227-242 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:231-246 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:237-252 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:231-246 | webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:177-192 | webrender/swgl/src/shaders/composite_texture_rect_yuv.rs:174-189 — before extracting anything, compare `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs` and `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 334 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (10–16 lines × 5) · ×1
  • Duplicated block (10–16 lines × 5) dll/src/desktop/shell2/android/clipboard.rs:130 — dll/src/desktop/shell2/android/clipboard.rs:130-139 | dll/src/desktop/shell2/android/clipboard.rs:187-196 | dll/src/desktop/shell2/android/mod.rs:2399-2414 | dll/src/desktop/shell2/android/mod.rs:2461-2470 | dll/src/desktop/shell2/android/mod.rs:2527-2536 — before extracting anything, compare `dll/src/desktop/shell2/android/clipboard.rs` and `dll/src/desktop/shell2/android/mod.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/android/clipboard.rs:130` it begins part-way through the construct above it, so those 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–16 lines × 5) · ×1
  • Duplicated block (14–16 lines × 5) dll/src/desktop/shell2/android/mod.rs:452 — dll/src/desktop/shell2/android/mod.rs:452-465 | dll/src/desktop/shell2/ios/mod.rs:1904-1917 | dll/src/desktop/shell2/linux/wayland/mod.rs:6448-6463 | dll/src/desktop/shell2/linux/x11/mod.rs:6176-6191 | dll/src/desktop/shell2/windows/mod.rs:1821-1836 — `dll/src/desktop/shell2/android/mod.rs` and `dll/src/desktop/shell2/ios/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 17 separate duplicated blocks between them, totalling at least 242 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/android/mod.rs:452` it does not close everything it opens, so those 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, `dll/src/desktop/shell2/android/mod.rs:447` calls `regen_epoch` and `dll/src/desktop/shell2/linux/x11/mod.rs:6172` 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 (16 lines × 5) · ×1
  • Duplicated block (16 lines × 5) layout/src/xml/svg.rs:710 — layout/src/xml/svg.rs:710-725 | layout/src/xml/svg.rs:748-763 | layout/src/xml/svg.rs:961-976 | layout/src/xml/svg.rs:1026-1041 | layout/src/xml/svg.rs:1104-1119 — 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 `layout/src/xml/svg.rs:710` 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–16 lines × 3) · ×1
  • Duplicated block (15–16 lines × 3) dll/src/desktop/shell2/windows/mod.rs:1879 — dll/src/desktop/shell2/windows/mod.rs:1879-1894 | dll/src/desktop/shell2/windows/mod.rs:1946-1961 | dll/src/desktop/shell2/windows/mod.rs:7050-7064 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/windows/mod.rs:1879` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `&mut` in one and `crate) fn release_gpu_resources(&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 (29 lines × 3) · ×1
  • Duplicated block (29 lines × 3) layout/src/window.rs:2036 — layout/src/window.rs:2036-2064 | layout/src/window.rs:4671-4699 | layout/src/window.rs:7765-7793 — all 3 copies are in the same file, so extract the block into one function there and call 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–16 lines × 2) · ×1
  • Duplicated block (12–16 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:5678 — dll/src/desktop/shell2/linux/wayland/mod.rs:5678-5693 | dll/src/desktop/shell2/linux/wayland/mod.rs:5856-5867 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:5678` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `super) fn wayland_set_selection(&mut` in one and `super) fn wayland_set_primary_selection(&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 (11–16 lines × 2) · ×1
  • Duplicated block (11–16 lines × 2) doc/src/codegen/v2/lang_csharp/wrappers.rs:1516 — doc/src/codegen/v2/lang_csharp/wrappers.rs:1516-1526 | doc/src/codegen/v2/lang_java/wrappers.rs:1425-1440 — `doc/src/codegen/v2/lang_csharp/wrappers.rs` and `doc/src/codegen/v2/lang_java/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 167 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_java/wrappers.rs:1425` it begins part-way through the construct above it, so those 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–16 lines × 3) · ×1
  • Duplicated block (4–16 lines × 3) doc/src/codegen/v2/lang_crystal/wrappers.rs:1087 — doc/src/codegen/v2/lang_crystal/wrappers.rs:1087-1090 | doc/src/codegen/v2/lang_d/wrappers.rs:1793-1808 | doc/src/codegen/v2/lang_swift/wrappers.rs:1770-1785 — `doc/src/codegen/v2/lang_crystal/wrappers.rs` and `doc/src/codegen/v2/lang_d/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 51 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_d/wrappers.rs:1793` it begins part-way through the construct above it, so those 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–15 lines × 9) · ×1
  • Duplicated block (10–15 lines × 9) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:125 — webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:125-139 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:127-141 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:127-141 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:118-132 | webrender/swgl/src/shaders/brush_solid_alpha_pass.rs:125-134 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:154-163 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:162-171 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:164-173 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:162-171 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs` and `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 439 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:125` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (13–15 lines × 6) · ×1
  • Duplicated block (13–15 lines × 6) webrender/core/src/device/gl.rs:3662 — webrender/core/src/device/gl.rs:3662-3674 | webrender/core/src/device/gl.rs:3685-3697 | webrender/core/src/device/gl.rs:3708-3720 | webrender/core/src/device/gl.rs:3726-3738 | webrender/core/src/device/gl.rs:3744-3758 | webrender/core/src/device/gl.rs:3763-3775 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (14–15 lines × 5) · ×1
  • Duplicated block (14–15 lines × 5) dll/src/desktop/shell2/android/mod.rs:474 — dll/src/desktop/shell2/android/mod.rs:474-487 | dll/src/desktop/shell2/ios/mod.rs:1926-1939 | dll/src/desktop/shell2/linux/wayland/mod.rs:6472-6486 | dll/src/desktop/shell2/linux/x11/mod.rs:6200-6214 | dll/src/desktop/shell2/windows/mod.rs:1845-1859 — `dll/src/desktop/shell2/android/mod.rs` and `dll/src/desktop/shell2/ios/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 17 separate duplicated blocks between them, totalling at least 242 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/android/mod.rs:474` 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–15 lines × 4) · ×1
  • Duplicated block (11–15 lines × 4) dll/src/desktop/shell2/android/mod.rs:483 — dll/src/desktop/shell2/android/mod.rs:483-494 | dll/src/desktop/shell2/headless/mod.rs:1717-1729 | dll/src/desktop/shell2/headless/mod.rs:1897-1911 | dll/src/desktop/shell2/ios/mod.rs:1935-1945 — `dll/src/desktop/shell2/android/mod.rs` and `dll/src/desktop/shell2/headless/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 106 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/android/mod.rs:483` 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, `dll/src/desktop/shell2/headless/mod.rs:1738` calls `rebuild_cpu_hit_tester` and `dll/src/desktop/shell2/headless/mod.rs:1914` 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–15 lines × 4) · ×1
  • Duplicated block (13–15 lines × 4) webrender/core/src/batch.rs:1581 — webrender/core/src/batch.rs:1581-1595 | webrender/core/src/batch.rs:2234-2246 | webrender/core/src/batch.rs:2277-2289 | webrender/core/src/batch.rs:3300-3312 — 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 `webrender/core/src/batch.rs:1581` it begins part-way through the construct above it, so those 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 × 3) · ×1
  • Duplicated block (12–15 lines × 3) css/src/dynamic_selector.rs:1454 — css/src/dynamic_selector.rs:1454-1465 | css/src/parser2.rs:1401-1412 | css/src/parser2.rs:1424-1438 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (13–15 lines × 3) · ×1
  • Duplicated block (13–15 lines × 3) dll/src/desktop/shell2/linux/wayland/mod.rs:3572 — dll/src/desktop/shell2/linux/wayland/mod.rs:3572-3584 | dll/src/desktop/shell2/linux/wayland/mod.rs:3672-3686 | dll/src/desktop/shell2/linux/wayland/mod.rs:5377-5390 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:3572` it does not close everything it opens, so those 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–15 lines × 2) · ×1
  • Duplicated block (10–15 lines × 2) doc/src/codegen/v2/lang_kotlin/wrappers.rs:1582 — doc/src/codegen/v2/lang_kotlin/wrappers.rs:1582-1596 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:1822-1831 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_kotlin/wrappers.rs:1582` it begins part-way through the construct above it, so those 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–14 lines × 12) · ×1
  • Duplicated block (11–14 lines × 12) webrender/swgl/src/shaders/brush_blend.rs:136 — webrender/swgl/src/shaders/brush_blend.rs:136-149 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:124-137 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:126-139 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:126-139 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:117-130 | webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs:120-133 | webrender/swgl/src/shaders/brush_solid.rs:137-147 | webrender/swgl/src/shaders/brush_solid_alpha_pass.rs:124-134 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:153-163 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:161-171 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:163-173 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:161-171 — before extracting anything, compare `webrender/swgl/src/shaders/brush_blend.rs` and `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 212 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_blend.rs:136` it does not close everything it opens, so those 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 `context` to `&mut ShaderContext` in one and `&ShaderContext` 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–14 lines × 13) · ×1
  • Duplicated block (4–14 lines × 13) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:233 — webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:233-246 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:236-245 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:221-234 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:186-195 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:227-240 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:210-219 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:146-155 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:148-151 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:232-245 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:232-242 | webrender/swgl/src/shaders/brush_image_texture_2d.rs:139-148 | webrender/swgl/src/shaders/brush_image_texture_rect.rs:174-183 | webrender/swgl/src/shaders/ps_split_composite.rs:144-147 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs` and `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 439 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:233` it does not close everything it opens, so those 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, `webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:148` calls `min` and `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:233` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (8–14 lines × 6) · ×1
  • Duplicated block (8–14 lines × 6) dll/src/desktop/extra/media_keys/android.rs:144 — dll/src/desktop/extra/media_keys/android.rs:144-151 | dll/src/desktop/shell2/android/clipboard.rs:129-136 | dll/src/desktop/shell2/android/clipboard.rs:186-193 | dll/src/desktop/shell2/android/mod.rs:2398-2411 | dll/src/desktop/shell2/android/mod.rs:2460-2467 | dll/src/desktop/shell2/android/mod.rs:2526-2533 — before extracting anything, compare `dll/src/desktop/shell2/android/clipboard.rs` and `dll/src/desktop/shell2/android/mod.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/extra/media_keys/android.rs:144` it does not close everything it opens, so those 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 × 5) · ×1
  • Duplicated block (14 lines × 5) layout/src/widgets/breadcrumb.rs:337 — layout/src/widgets/breadcrumb.rs:337-350 | layout/src/widgets/pagination.rs:501-514 | layout/src/widgets/radio_group.rs:546-559 | layout/src/widgets/segmented.rs:444-457 | layout/src/widgets/stepper.rs:568-581 — before extracting anything, compare `layout/src/widgets/pagination.rs` and `layout/src/widgets/segmented.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (12–14 lines × 4) · ×1
  • Duplicated block (12–14 lines × 4) webrender/core/src/prepare.rs:781 — webrender/core/src/prepare.rs:781-794 | webrender/core/src/prepare.rs:845-856 | webrender/core/src/prepare.rs:901-912 | webrender/core/src/prepare.rs:957-968 — 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 `webrender/core/src/prepare.rs:781` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–14 lines × 3) · ×1
  • Duplicated block (11–14 lines × 3) dll/src/desktop/shell2/linux/wayland/mod.rs:7212 — dll/src/desktop/shell2/linux/wayland/mod.rs:7212-7225 | dll/src/desktop/shell2/linux/x11/mod.rs:6947-6960 | dll/src/desktop/shell2/windows/mod.rs:1659-1669 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:7212` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (13–14 lines × 3) · ×1
  • Duplicated block (13–14 lines × 3) doc/src/autofix/type_index.rs:2057 — doc/src/autofix/type_index.rs:2057-2070 | doc/src/autofix/type_index.rs:2076-2088 | doc/src/autofix/type_index.rs:2216-2228 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/autofix/type_index.rs:2057` it begins part-way through the construct above it, so those 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–14 lines × 2) · ×1
  • Duplicated block (10–14 lines × 2) core/src/compact.rs:417 — core/src/compact.rs:417-426 | core/src/compact.rs:1713-1726 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `core/src/compact.rs:417` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–14 lines × 2) · ×1
  • Duplicated block (9–14 lines × 2) dll/src/web/transpiler_remill.rs:11838 — dll/src/web/transpiler_remill.rs:11838-11851 | dll/src/web/transpiler_remill.rs:11867-11875 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/web/transpiler_remill.rs:11838` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (4–14 lines × 3) · ×1
  • Duplicated block (4–14 lines × 3) doc/src/codegen/v2/lang_crystal/model.rs:486 — doc/src/codegen/v2/lang_crystal/model.rs:486-499 | doc/src/codegen/v2/lang_d/model.rs:782-795 | doc/src/codegen/v2/lang_swift/model.rs:792-795 — `doc/src/codegen/v2/lang_crystal/model.rs` and `doc/src/codegen/v2/lang_d/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 88 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_swift/model.rs:792` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (2–14 lines × 3) · ×1
  • Duplicated block (2–14 lines × 3) webrender/swgl/src/shaders/ps_quad_conic_gradient.rs:139 — webrender/swgl/src/shaders/ps_quad_conic_gradient.rs:139-150 | webrender/swgl/src/shaders/ps_quad_mask.rs:256-257 | webrender/swgl/src/shaders/ps_quad_radial_gradient.rs:132-145 — before extracting anything, compare `webrender/swgl/src/shaders/ps_quad_conic_gradient.rs` and `webrender/swgl/src/shaders/ps_quad_mask.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/swgl/src/shaders/ps_quad_conic_gradient.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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (11–13 lines × 13) · ×1
  • Duplicated block (11–13 lines × 13) webrender/swgl/src/shaders/brush_blend.rs:134 — webrender/swgl/src/shaders/brush_blend.rs:134-146 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:122-134 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:124-136 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:124-136 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:115-127 | webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs:118-130 | webrender/swgl/src/shaders/brush_solid.rs:135-147 | webrender/swgl/src/shaders/brush_solid_alpha_pass.rs:122-134 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:151-163 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:159-171 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:161-173 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:159-171 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_texture_2d.rs:94-104 — before extracting anything, compare `webrender/swgl/src/shaders/brush_blend.rs` and `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 212 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `context` to `&mut ShaderContext` in one and `&ShaderContext` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (13 lines × 9) · ×1
  • Duplicated block (13 lines × 9) doc/src/codegen/v2/lang_csharp/mod.rs:288 — doc/src/codegen/v2/lang_csharp/mod.rs:288-300 | doc/src/codegen/v2/lang_freebasic/mod.rs:330-342 | doc/src/codegen/v2/lang_go/mod.rs:412-424 | doc/src/codegen/v2/lang_haskell/wrappers.rs:2364-2376 | doc/src/codegen/v2/lang_nim/mod.rs:378-390 | doc/src/codegen/v2/lang_ocaml/mod.rs:1024-1036 | doc/src/codegen/v2/lang_pascal/mod.rs:508-520 | doc/src/codegen/v2/lang_smalltalk/wrappers.rs:437-449 | doc/src/codegen/v2/lang_vb6/mod.rs:395-407 — `doc/src/codegen/v2/lang_freebasic/mod.rs` and `doc/src/codegen/v2/lang_nim/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 66 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_csharp/mod.rs:288` 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 (13 lines × 7) · ×1
  • Duplicated block (13 lines × 7) doc/src/autofix/patch_format.rs:14 — doc/src/autofix/patch_format.rs:14-26 | doc/src/autofix/workspace.rs:2238-2250 | doc/src/codegen/v2/ir.rs:504-516 | doc/src/codegen/v2/ir_builder.rs:2680-2692 | doc/src/codegen/v2/lang_python.rs:4556-4568 | doc/src/codegen/v2/lang_rust.rs:5004-5016 | doc/src/codegen/v2/transmute_helpers.rs:507-519 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 7 times. 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 (13 lines × 6) · ×1
  • Duplicated block (13 lines × 6) dll/src/desktop/shell2/android/mod.rs:458 — dll/src/desktop/shell2/android/mod.rs:458-470 | dll/src/desktop/shell2/headless/mod.rs:1691-1704 | dll/src/desktop/shell2/ios/mod.rs:1910-1922 | dll/src/desktop/shell2/linux/x11/mod.rs:6183-6196 | dll/src/desktop/shell2/macos/mod.rs:6016-6029 | dll/src/desktop/shell2/windows/mod.rs:1828-1841 — `dll/src/desktop/shell2/android/mod.rs` and `dll/src/desktop/shell2/headless/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 106 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/android/mod.rs:458` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13 lines × 5) · ×1
  • Duplicated block (13 lines × 5) layout/src/solver3/fc.rs:1612 — layout/src/solver3/fc.rs:1612-1624 | layout/src/solver3/fc.rs:1686-1698 | layout/src/solver3/fc.rs:1830-1842 | layout/src/solver3/fc.rs:2431-2443 | layout/src/solver3/fc.rs:2471-2483 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (3–13 lines × 6) · ×1
  • Duplicated block (3–13 lines × 6) webrender/swgl/src/shaders/brush_blend.rs:170 — webrender/swgl/src/shaders/brush_blend.rs:170-172 | webrender/swgl/src/shaders/brush_blend_alpha_pass.rs:202-204 | webrender/swgl/src/shaders/brush_opacity.rs:145-157 | webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs:154-166 | webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs:150-162 | webrender/swgl/src/shaders/brush_opacity_antialiasing.rs:147-158 — before extracting anything, compare `webrender/swgl/src/shaders/brush_blend.rs` and `webrender/swgl/src/shaders/brush_blend_alpha_pass.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `context` to `&mut ShaderContext` in one and `&ShaderContext` 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, `webrender/swgl/src/shaders/brush_blend.rs:168` calls `texture_size`, `rect_size` and `webrender/swgl/src/shaders/brush_opacity.rs:145` 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–13 lines × 3) · ×1
  • Duplicated block (9–13 lines × 3) doc/src/codegen/v2/lang_d/types.rs:188 — doc/src/codegen/v2/lang_d/types.rs:188-196 | doc/src/codegen/v2/lang_odin/types.rs:236-248 | doc/src/codegen/v2/lang_v/types.rs:244-256 — `doc/src/codegen/v2/lang_d/types.rs` and `doc/src/codegen/v2/lang_odin/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 33 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind `cb` to `&CallbackTypedefDef` in one and `&super::super::ir::CallbackTypedefDef` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (11–13 lines × 3) · ×1
  • Duplicated block (11–13 lines × 3) doc/src/codegen/v2/lang_freebasic/functions.rs:119 — doc/src/codegen/v2/lang_freebasic/functions.rs:119-131 | doc/src/codegen/v2/lang_freebasic/types.rs:364-374 | doc/src/codegen/v2/lang_freebasic/wrappers.rs:430-440 — before extracting anything, compare `doc/src/codegen/v2/lang_freebasic/functions.rs` and `doc/src/codegen/v2/lang_freebasic/types.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/codegen/v2/lang_freebasic/functions.rs:119` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `doc/src/codegen/v2/lang_freebasic/types.rs:360` calls `ffi_type_name` and `doc/src/codegen/v2/lang_freebasic/functions.rs:115` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (3–13 lines × 4) · ×1
  • Duplicated block (3–13 lines × 4) doc/src/codegen/v2/lang_csharp/wrappers.rs:122 — doc/src/codegen/v2/lang_csharp/wrappers.rs:122-134 | doc/src/codegen/v2/lang_java/wrappers.rs:1281-1284 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:119-131 | doc/src/codegen/v2/lang_ruby/types.rs:694-696 — `doc/src/codegen/v2/lang_csharp/wrappers.rs` and `doc/src/codegen/v2/lang_java/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 167 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_csharp/wrappers.rs:122` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. 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, `doc/src/codegen/v2/lang_csharp/wrappers.rs:122` calls `Tuple` and `doc/src/codegen/v2/lang_java/wrappers.rs:1281` 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 (4–13 lines × 3) · ×1
  • Duplicated block (4–13 lines × 3) layout/src/solver3/display_list.rs:7770 — layout/src/solver3/display_list.rs:7770-7782 | layout/src/solver3/display_list.rs:8006-8009 | layout/src/solver3/display_list.rs:8072-8084 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/solver3/display_list.rs:8006` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (3–13 lines × 3) · ×1
  • Duplicated block (3–13 lines × 3) webrender/swgl/src/shaders/composite_fast_path_texture_rect.rs:81 — webrender/swgl/src/shaders/composite_fast_path_texture_rect.rs:81-83 | webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:140-152 | webrender/swgl/src/shaders/composite_texture_rect_yuv.rs:139-151 — before extracting anything, compare `webrender/swgl/src/shaders/composite_texture_2d_yuv.rs` and `webrender/swgl/src/shaders/composite_texture_rect_yuv.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 178 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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, `webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:140` calls `xy`, `zw` and `webrender/swgl/src/shaders/composite_fast_path_texture_rect.rs:81` 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 × 15) · ×1
  • Duplicated block (12 lines × 15) css/src/system.rs:2250 — css/src/system.rs:2250-2261 | css/src/system.rs:2302-2313 | css/src/system.rs:2354-2365 | css/src/system.rs:2406-2417 | css/src/system.rs:2459-2470 | css/src/system.rs:2517-2528 | css/src/system.rs:2566-2577 | css/src/system.rs:2618-2629 | css/src/system.rs:2668-2679 | css/src/system.rs:2717-2728 | css/src/system.rs:2795-2806 | css/src/system.rs:2873-2884 | css/src/system.rs:2924-2935 | css/src/system.rs:2973-2984 | css/src/system.rs:3020-3031 — 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 `css/src/system.rs:2250` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 14) · ×1
  • Duplicated block (12 lines × 14) webrender/swgl/src/shaders/brush_blend.rs:108 — webrender/swgl/src/shaders/brush_blend.rs:108-119 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:104-115 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:106-117 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:106-117 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:97-108 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:102-113 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:102-113 | webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs:102-113 | webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs:100-111 | webrender/swgl/src/shaders/brush_opacity_antialiasing.rs:101-112 | webrender/swgl/src/shaders/brush_solid.rs:109-120 | webrender/swgl/src/shaders/brush_solid_alpha_pass.rs:96-107 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:133-144 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:141-152 — before extracting anything, compare `webrender/swgl/src/shaders/brush_blend.rs` and `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 212 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_blend.rs:108` 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, `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:116` calls `clip_and_init_antialiasing` and `webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:115` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12 lines × 10) · ×1
  • Duplicated block (12 lines × 10) doc/src/codegen/v2/lang_csharp/mod.rs:287 — doc/src/codegen/v2/lang_csharp/mod.rs:287-298 | doc/src/codegen/v2/lang_freebasic/mod.rs:329-340 | doc/src/codegen/v2/lang_go/mod.rs:411-422 | doc/src/codegen/v2/lang_haskell/wrappers.rs:2363-2374 | doc/src/codegen/v2/lang_nim/mod.rs:377-388 | doc/src/codegen/v2/lang_ocaml/mod.rs:1023-1034 | doc/src/codegen/v2/lang_pascal/mod.rs:507-518 | doc/src/codegen/v2/lang_powershell/cmdlets.rs:370-381 | doc/src/codegen/v2/lang_smalltalk/wrappers.rs:436-447 | doc/src/codegen/v2/lang_vb6/mod.rs:394-405 — `doc/src/codegen/v2/lang_freebasic/mod.rs` and `doc/src/codegen/v2/lang_nim/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 66 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `doc/src/codegen/v2/lang_powershell/cmdlets.rs:382` calls `is_empty`, `to_string` and `doc/src/codegen/v2/lang_csharp/mod.rs:299` 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) doc/src/autofix/type_index.rs:2477 — doc/src/autofix/type_index.rs:2477-2488 | doc/src/autofix/type_index.rs:2518-2529 | doc/src/autofix/type_index.rs:2559-2570 | doc/src/autofix/type_index.rs:2600-2611 | doc/src/autofix/type_index.rs:2651-2662 | doc/src/autofix/type_index.rs:2734-2745 | doc/src/autofix/type_index.rs:2790-2801 — 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 `doc/src/autofix/type_index.rs:2477` 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–12 lines × 7) · ×1
  • Duplicated block (9–12 lines × 7) layout/src/widgets/node_graph.rs:3509 — layout/src/widgets/node_graph.rs:3509-3517 | layout/src/widgets/node_graph.rs:3581-3589 | layout/src/widgets/node_graph.rs:3629-3640 | layout/src/widgets/node_graph.rs:3678-3689 | layout/src/widgets/node_graph.rs:3727-3738 | layout/src/widgets/node_graph.rs:3776-3786 | layout/src/widgets/node_graph.rs:3824-3834 — 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. 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 (9–12 lines × 6) · ×1
  • Duplicated block (9–12 lines × 6) doc/src/codegen/v2/lang_cpp/cpp03.rs:306 — doc/src/codegen/v2/lang_cpp/cpp03.rs:306-314 | doc/src/codegen/v2/lang_cpp/cpp11.rs:205-213 | doc/src/codegen/v2/lang_cpp/cpp11.rs:283-294 | doc/src/codegen/v2/lang_cpp/cpp17.rs:353-361 | doc/src/codegen/v2/lang_cpp/cpp17.rs:440-451 | doc/src/codegen/v2/lang_cpp/cpp20.rs:1049-1057 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (7–12 lines × 6) · ×1
  • Duplicated block (7–12 lines × 6) doc/src/codegen/v2/lang_java/derives.rs:682 — doc/src/codegen/v2/lang_java/derives.rs:682-689 | doc/src/codegen/v2/lang_java/functions.rs:244-255 | doc/src/codegen/v2/lang_java/types.rs:432-438 | doc/src/codegen/v2/lang_java/types.rs:744-754 | doc/src/codegen/v2/lang_java/types.rs:927-935 | doc/src/codegen/v2/lang_java/wrappers.rs:1941-1947 — before extracting anything, compare `doc/src/codegen/v2/lang_java/types.rs` and `doc/src/codegen/v2/lang_java/wrappers.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/codegen/v2/lang_java/derives.rs:682` it does not close everything it opens, so those 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 × 4) · ×1
  • Duplicated block (11–12 lines × 4) doc/src/reftest/autodoc.rs:995 — doc/src/reftest/autodoc.rs:995-1005 | doc/src/reftest/autoreview.rs:615-625 | doc/src/reftest/autoreview.rs:844-855 | doc/src/reftest/autoreview.rs:1768-1778 — before extracting anything, compare `doc/src/reftest/autodoc.rs` and `doc/src/reftest/autoreview.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 212 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/reftest/autodoc.rs:995` it does not close everything it opens, so those 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) dll/src/desktop/shell2/linux/wayland/mod.rs:4668 — dll/src/desktop/shell2/linux/wayland/mod.rs:4668-4675 | dll/src/desktop/shell2/linux/wayland/mod.rs:5720-5730 | dll/src/desktop/shell2/linux/wayland/mod.rs:5878-5889 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:4668` it begins part-way through the construct above it, so those 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 `&mut` in one and `super) fn wayland_set_selection(&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 (10–12 lines × 3) · ×1
  • Duplicated block (10–12 lines × 3) doc/src/codegen/v2/lang_java/managed.rs:959 — doc/src/codegen/v2/lang_java/managed.rs:959-968 | doc/src/codegen/v2/lang_lua/managed.rs:177-186 | doc/src/codegen/v2/lang_zig/boundary.rs:80-91 — 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.
D4 · Code Duplication · Duplicated block (45 lines × 2) · ×1
  • Duplicated block (45 lines × 2) doc/src/codegen/v2/lang_rust.rs:96 — doc/src/codegen/v2/lang_rust.rs:96-140 | doc/src/codegen/v2/rust/static_binding.rs:73-117 — before extracting anything, compare `doc/src/codegen/v2/lang_rust.rs` and `doc/src/codegen/v2/rust/static_binding.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (6–12 lines × 2) · ×1
  • Duplicated block (6–12 lines × 2) webrender/core/src/render_backend.rs:1485 — webrender/core/src/render_backend.rs:1485-1496 | webrender/core/src/render_backend.rs:1717-1722 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/core/src/render_backend.rs:1485` it does not close everything it opens, so those 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 × 30) · ×1
  • Duplicated block (9–11 lines × 30) webrender/swgl/src/shaders/brush_blend.rs:454 — webrender/swgl/src/shaders/brush_blend.rs:454-462 | webrender/swgl/src/shaders/brush_blend_alpha_pass.rs:403-411 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:434-442 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:436-444 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:425-433 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:364-372 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:438-446 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:394-402 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:314-324 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:302-310 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:379-387 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:367-375 | webrender/swgl/src/shaders/brush_image_texture_2d.rs:243-251 | webrender/swgl/src/shaders/brush_image_texture_rect.rs:298-308 | webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs:297-307 | webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs:283-293 | webrender/swgl/src/shaders/brush_opacity_antialiasing.rs:268-276 | webrender/swgl/src/shaders/composite_fast_path_texture_2d.rs:178-186 | webrender/swgl/src/shaders/composite_fast_path_texture_rect.rs:168-176 | webrender/swgl/src/shaders/composite_texture_2d.rs:193-201 | webrender/swgl/src/shaders/composite_texture_rect.rs:201-209 | webrender/swgl/src/shaders/cs_blur_alpha_target.rs:281-289 | webrender/swgl/src/shaders/cs_scale_texture_2d.rs:175-183 | webrender/swgl/src/shaders/cs_scale_texture_rect.rs:187-195 | webrender/swgl/src/shaders/ps_copy.rs:156-166 | webrender/swgl/src/shaders/ps_split_composite.rs:236-244 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs:288-297 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_texture_2d.rs:227-235 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_glyph_transform_texture_2d.rs:249-257 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_texture_2d.rs:287-296 — before extracting anything, compare `webrender/swgl/src/shaders/brush_blend.rs` and `webrender/swgl/src/shaders/brush_blend_alpha_pass.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (11 lines × 19) · ×1
  • Duplicated block (11 lines × 19) webrender/swgl/src/shaders/brush_blend.rs:133 — webrender/swgl/src/shaders/brush_blend.rs:133-144 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:121-132 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:123-134 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:123-134 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:114-125 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:119-130 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:119-130 | webrender/swgl/src/shaders/brush_image_texture_rect.rs:110-121 | webrender/swgl/src/shaders/brush_opacity.rs:110-122 | webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs:120-132 | webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs:117-128 | webrender/swgl/src/shaders/brush_opacity_antialiasing.rs:119-130 | webrender/swgl/src/shaders/brush_solid.rs:134-145 | webrender/swgl/src/shaders/brush_solid_alpha_pass.rs:121-132 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:150-161 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:158-169 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:160-171 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:158-169 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_texture_2d.rs:92-102 — before extracting anything, compare `webrender/swgl/src/shaders/brush_blend.rs` and `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 212 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `context` to `&mut ShaderContext` in one and `&ShaderContext` 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, `webrender/swgl/src/shaders/brush_blend.rs:146` calls `write_clip` and `webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:134` 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 × 18) · ×1
  • Duplicated block (11 lines × 18) webrender/swgl/src/shaders/brush_blend.rs:104 — webrender/swgl/src/shaders/brush_blend.rs:104-114 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:100-110 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:102-112 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:102-112 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:93-103 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:98-108 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:98-108 | webrender/swgl/src/shaders/brush_image_texture_rect.rs:96-106 | webrender/swgl/src/shaders/brush_opacity.rs:96-106 | webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs:98-108 | webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs:96-106 | webrender/swgl/src/shaders/brush_opacity_antialiasing.rs:97-107 | webrender/swgl/src/shaders/brush_solid.rs:105-115 | webrender/swgl/src/shaders/brush_solid_alpha_pass.rs:92-102 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:129-139 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:137-147 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:146-156 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:144-154 — before extracting anything, compare `webrender/swgl/src/shaders/brush_blend.rs` and `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 212 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_blend.rs:104` it begins part-way through the construct above it, so those 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 `context` to `&mut ShaderContext` in one and `&ShaderContext` 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–11 lines × 15) · ×1
  • Duplicated block (9–11 lines × 15) dll/src/desktop/shell2/linux/wayland/defines.rs:754 — dll/src/desktop/shell2/linux/wayland/defines.rs:754-763 | dll/src/desktop/shell2/linux/wayland/defines.rs:795-804 | dll/src/desktop/shell2/linux/wayland/defines.rs:842-851 | dll/src/desktop/shell2/linux/wayland/defines.rs:883-892 | dll/src/desktop/shell2/linux/wayland/defines.rs:935-944 | dll/src/desktop/shell2/linux/wayland/defines.rs:1002-1011 | dll/src/desktop/shell2/linux/wayland/defines.rs:1080-1088 | dll/src/desktop/shell2/linux/wayland/defines.rs:1118-1127 | dll/src/desktop/shell2/linux/wayland/defines.rs:1159-1168 | dll/src/desktop/shell2/linux/wayland/defines.rs:1201-1209 | dll/src/desktop/shell2/linux/wayland/defines.rs:1253-1262 | dll/src/desktop/shell2/linux/wayland/defines.rs:1310-1318 | dll/src/desktop/shell2/linux/wayland/defines.rs:1367-1376 | dll/src/desktop/shell2/linux/wayland/defines.rs:1486-1495 | dll/src/desktop/shell2/linux/wayland/defines.rs:1541-1551 — 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 `dll/src/desktop/shell2/linux/wayland/defines.rs:754` it does not close everything it opens, so those 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 × 8) · ×1
  • Duplicated block (9–11 lines × 8) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:250 — webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:250-259 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:248-258 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:238-246 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:198-208 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:244-252 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:222-231 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:159-169 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:153-163 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs` and `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 439 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (11 lines × 7) · ×1
  • Duplicated block (11 lines × 7) doc/src/codegen/v2/lang_cpp/cpp03.rs:327 — doc/src/codegen/v2/lang_cpp/cpp03.rs:327-340 | doc/src/codegen/v2/lang_cpp/cpp03.rs:690-700 | doc/src/codegen/v2/lang_cpp/cpp11.rs:234-247 | doc/src/codegen/v2/lang_cpp/cpp11.rs:612-622 | doc/src/codegen/v2/lang_cpp/cpp17.rs:391-404 | doc/src/codegen/v2/lang_cpp/cpp17.rs:822-832 | doc/src/codegen/v2/lang_cpp/cpp20.rs:1070-1081 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 372 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (11 lines × 6) · ×1
  • Duplicated block (11 lines × 6) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:381 — webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:381-391 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:384-394 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:383-393 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:376-386 | webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:337-347 | webrender/swgl/src/shaders/composite_texture_rect_yuv.rs:335-345 — before extracting anything, compare `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs` and `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 334 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (7–11 lines × 4) · ×1
  • Duplicated block (7–11 lines × 4) dll/src/desktop/shell2/linux/wayland/mod.rs:6277 — dll/src/desktop/shell2/linux/wayland/mod.rs:6277-6283 | dll/src/desktop/shell2/linux/x11/events.rs:1418-1424 | dll/src/desktop/shell2/macos/events.rs:1182-1192 | dll/src/desktop/shell2/windows/mod.rs:2179-2187 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/events.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 263 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (3–11 lines × 4) · ×1
  • Duplicated block (3–11 lines × 4) doc/src/codegen/v2/lang_csharp/types.rs:453 — doc/src/codegen/v2/lang_csharp/types.rs:453-463 | doc/src/codegen/v2/lang_java/types.rs:630-644 | doc/src/codegen/v2/lang_kotlin/mod.rs:519-530 | doc/src/codegen/v2/lang_ruby/types.rs:691-693 — `doc/src/codegen/v2/lang_csharp/types.rs` and `doc/src/codegen/v2/lang_java/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 72 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_csharp/types.rs:453` it begins part-way through the construct above it, so those 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–11 lines × 3) · ×1
  • Duplicated block (8–11 lines × 3) doc/src/codegen/v2/lang_node/wrappers.rs:570 — doc/src/codegen/v2/lang_node/wrappers.rs:570-577 | doc/src/codegen/v2/lang_node/wrappers.rs:743-753 | doc/src/codegen/v2/lang_node/wrappers.rs:1226-1236 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_node/wrappers.rs:570` it does not close everything it opens, so those 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, `doc/src/codegen/v2/lang_node/wrappers.rs:741` calls `emit_constants_static` and `doc/src/codegen/v2/lang_node/wrappers.rs:1224` 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–11 lines × 2) · ×1
  • Duplicated block (7–11 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:5991 — dll/src/desktop/shell2/linux/wayland/mod.rs:5991-5997 | dll/src/desktop/shell2/macos/events.rs:444-454 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/macos/events.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 142 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (5–10 lines × 16) · ×1
  • Duplicated block (5–10 lines × 16) webrender/swgl/src/shaders/brush_blend.rs:128 — webrender/swgl/src/shaders/brush_blend.rs:128-137 | webrender/swgl/src/shaders/brush_blend_alpha_pass.rs:110-114 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:117-125 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:119-127 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:113-117 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:119-127 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:110-118 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:113-117 | webrender/swgl/src/shaders/brush_linear_gradient.rs:111-115 | webrender/swgl/src/shaders/brush_linear_gradient_alpha_pass.rs:112-116 | webrender/swgl/src/shaders/brush_mix_blend_alpha_pass.rs:128-132 | webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs:113-121 | webrender/swgl/src/shaders/brush_solid.rs:129-138 | webrender/swgl/src/shaders/brush_solid_alpha_pass.rs:116-125 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:146-154 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:154-162 — before extracting anything, compare `webrender/swgl/src/shaders/brush_blend.rs` and `webrender/swgl/src/shaders/brush_blend_alpha_pass.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_blend.rs:128` it begins part-way through the construct above it, so those 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 `context` to `&mut ShaderContext` in one and `&ShaderContext` 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 (17–18 lines × 7) · ×1
  • Duplicated block (17–18 lines × 7) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:255 — webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:255-272 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:254-271 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:242-259 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:248-265 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:227-243 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:251-268 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:247-263 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs` and `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 439 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (8–10 lines × 4) · ×1
  • Duplicated block (8–10 lines × 4) doc/src/codegen/v2/lang_freebasic/mod.rs:173 — doc/src/codegen/v2/lang_freebasic/mod.rs:173-180 | doc/src/codegen/v2/lang_nim/mod.rs:200-207 | doc/src/codegen/v2/lang_smalltalk/mod.rs:183-192 | doc/src/codegen/v2/lang_vb6/mod.rs:249-256 — `doc/src/codegen/v2/lang_freebasic/mod.rs` and `doc/src/codegen/v2/lang_nim/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 66 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_freebasic/mod.rs:173` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–10 lines × 4) · ×1
  • Duplicated block (9–10 lines × 4) doc/src/codegen/v2/lang_rust.rs:2484 — doc/src/codegen/v2/lang_rust.rs:2484-2493 | doc/src/codegen/v2/rust/dynamic_binding.rs:416-424 | doc/src/codegen/v2/rust/shared.rs:98-107 | doc/src/codegen/v2/rust/static_binding.rs:505-513 — before extracting anything, compare `doc/src/codegen/v2/lang_rust.rs` and `doc/src/codegen/v2/rust/shared.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 210 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 `doc/src/codegen/v2/lang_rust.rs:2484` it begins part-way through the construct above it, so those 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 (3–10 lines × 5) · ×1
  • Duplicated block (3–10 lines × 5) doc/src/codegen/v2/lang_csharp/wrappers.rs:73 — doc/src/codegen/v2/lang_csharp/wrappers.rs:73-80 | doc/src/codegen/v2/lang_java/types.rs:311-313 | doc/src/codegen/v2/lang_java/wrappers.rs:1229-1238 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:70-77 | doc/src/codegen/v2/lang_node/wrappers.rs:1289-1292 — `doc/src/codegen/v2/lang_csharp/wrappers.rs` and `doc/src/codegen/v2/lang_java/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 167 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_csharp/wrappers.rs:73` it does not close everything it opens, so those 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, `doc/src/codegen/v2/lang_csharp/wrappers.rs:81` calls `iter`, `find` and `doc/src/codegen/v2/lang_java/types.rs:313` 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 × 3) · ×1
  • Duplicated block (9–10 lines × 3) layout/src/font.rs:1867 — layout/src/font.rs:1867-1876 | layout/src/font.rs:1888-1896 | layout/src/font.rs:1954-1962 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/font.rs:1867` it does not close everything it opens, so those 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–10 lines × 2) · ×1
  • Duplicated block (6–10 lines × 2) doc/src/reftest/autodoc.rs:261 — doc/src/reftest/autodoc.rs:261-270 | doc/src/reftest/autoreview.rs:91-96 — before extracting anything, compare `doc/src/reftest/autodoc.rs` and `doc/src/reftest/autoreview.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 212 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/reftest/autodoc.rs:261` 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 (9 lines × 27) · ×1
  • Duplicated block (9 lines × 27) webrender/swgl/src/shaders/brush_blend.rs:297 — webrender/swgl/src/shaders/brush_blend.rs:297-305 | webrender/swgl/src/shaders/brush_blend_alpha_pass.rs:242-250 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:348-357 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:345-354 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:334-343 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:286-295 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:337-346 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:300-309 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:239-248 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:232-241 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:307-316 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:299-308 | webrender/swgl/src/shaders/brush_image_texture_2d.rs:184-193 | webrender/swgl/src/shaders/brush_image_texture_rect.rs:234-243 | webrender/swgl/src/shaders/brush_opacity.rs:187-198 | webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs:210-223 | webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs:204-213 | webrender/swgl/src/shaders/brush_opacity_antialiasing.rs:201-210 | webrender/swgl/src/shaders/composite_fast_path_texture_2d.rs:127-136 | webrender/swgl/src/shaders/composite_texture_2d.rs:144-153 | webrender/swgl/src/shaders/cs_blur_alpha_target.rs:203-211 | webrender/swgl/src/shaders/cs_blur_color_target.rs:192-201 | webrender/swgl/src/shaders/cs_scale_texture_2d.rs:126-135 | webrender/swgl/src/shaders/cs_scale_texture_rect.rs:135-144 | webrender/swgl/src/shaders/ps_split_composite.rs:176-184 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_texture_2d.rs:155-164 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_texture_2d.rs:217-226 — before extracting anything, compare `webrender/swgl/src/shaders/brush_blend.rs` and `webrender/swgl/src/shaders/brush_blend_alpha_pass.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `context` to `&mut ShaderContext` in one and `&ShaderContext` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (7–9 lines × 11) · ×1
  • Duplicated block (7–9 lines × 11) doc/src/autofix/type_index.rs:2024 — doc/src/autofix/type_index.rs:2024-2032 | doc/src/autofix/type_index.rs:2265-2271 | doc/src/autofix/type_index.rs:2312-2318 | doc/src/autofix/type_index.rs:2413-2419 | doc/src/autofix/type_index.rs:2462-2468 | doc/src/autofix/type_index.rs:2503-2509 | doc/src/autofix/type_index.rs:2544-2550 | doc/src/autofix/type_index.rs:2585-2591 | doc/src/autofix/type_index.rs:2628-2634 | doc/src/autofix/type_index.rs:2679-2685 | doc/src/autofix/type_index.rs:2767-2773 — 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 `doc/src/autofix/type_index.rs:2024` it does not close everything it opens, so those 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 × 9) · ×1
  • Duplicated block (9 lines × 9) webrender/swgl/src/shaders/brush_linear_gradient.rs:262 — webrender/swgl/src/shaders/brush_linear_gradient.rs:262-270 | webrender/swgl/src/shaders/brush_linear_gradient_alpha_pass.rs:278-286 | webrender/swgl/src/shaders/cs_border_segment.rs:425-433 | webrender/swgl/src/shaders/cs_border_solid.rs:311-319 | webrender/swgl/src/shaders/cs_conic_gradient.rs:199-207 | webrender/swgl/src/shaders/cs_fast_linear_gradient.rs:179-187 | webrender/swgl/src/shaders/cs_linear_gradient.rs:192-200 | webrender/swgl/src/shaders/cs_radial_gradient.rs:217-225 | webrender/swgl/src/shaders/ps_quad_radial_gradient.rs:274-282 — before extracting anything, compare `webrender/swgl/src/shaders/brush_linear_gradient.rs` and `webrender/swgl/src/shaders/brush_linear_gradient_alpha_pass.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 218 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (8–9 lines × 8) · ×1
  • Duplicated block (8–9 lines × 8) doc/src/codegen/v2/lang_rust.rs:2520 — doc/src/codegen/v2/lang_rust.rs:2520-2528 | doc/src/codegen/v2/lang_rust.rs:2595-2603 | doc/src/codegen/v2/rust/dynamic_binding.rs:150-157 | doc/src/codegen/v2/rust/dynamic_binding.rs:279-286 | doc/src/codegen/v2/rust/shared.rs:129-137 | doc/src/codegen/v2/rust/shared.rs:178-186 | doc/src/codegen/v2/rust/static_binding.rs:236-244 | doc/src/codegen/v2/rust/static_binding.rs:304-311 — before extracting anything, compare `doc/src/codegen/v2/lang_rust.rs` and `doc/src/codegen/v2/rust/shared.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 210 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (7–9 lines × 5) · ×1
  • Duplicated block (7–9 lines × 5) doc/src/autofix/discovery/parallel.rs:109 — doc/src/autofix/discovery/parallel.rs:109-117 | doc/src/docgen/guide.rs:191-197 | doc/src/lint_links.rs:407-413 | doc/src/reftest/autodoc.rs:260-268 | doc/src/reftest/autoreview.rs:90-96 — before extracting anything, compare `doc/src/reftest/autodoc.rs` and `doc/src/reftest/autoreview.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 212 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `doc/src/autofix/discovery/parallel.rs:109` it does not close everything it opens, so those 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 (1–9 lines × 14) · ×1
  • Duplicated block (1–9 lines × 14) layout/src/cpurender/compositor.rs:2047 — layout/src/cpurender/compositor.rs:2047-2048 | layout/src/cpurender/compositor.rs:2049-2049 | layout/src/cpurender/compositor.rs:2724-2725 | layout/src/cpurender/compositor.rs:2726-2726 | layout/src/cpurender/compositor.rs:3316-3317 | layout/src/cpurender/compositor.rs:3318-3319 | layout/src/cpurender/pixmap.rs:1676-1677 | layout/src/cpurender/pixmap.rs:1678-1686 | layout/src/solver3/display_list.rs:1028-1036 | layout/src/solver3/display_list.rs:1073-1074 | layout/src/solver3/display_list.rs:1075-1082 | layout/src/solver3/display_list.rs:1138-1146 | layout/src/solver3/display_list.rs:3634-3635 | layout/src/solver3/display_list.rs:3636-3637 — before extracting anything, compare `layout/src/cpurender/pixmap.rs` and `layout/src/solver3/display_list.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/cpurender/compositor.rs:3318` it does not close everything it opens, so those 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 `a` to `LogicalRect` in one and `&LogicalRect` 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, `layout/src/cpurender/compositor.rs:2725` calls `max` and `layout/src/cpurender/compositor.rs:2047` 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 × 3) · ×1
  • Duplicated block (8–9 lines × 3) doc/src/codegen/v2/lang_c.rs:634 — doc/src/codegen/v2/lang_c.rs:634-642 | doc/src/codegen/v2/lang_c.rs:912-919 | doc/src/codegen/v2/lang_c.rs:999-1006 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_c.rs:634` it does not close everything it opens, so those 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–9 lines × 3) · ×1
  • Duplicated block (5–9 lines × 3) layout/src/image.rs:643 — layout/src/image.rs:643-651 | layout/src/image.rs:692-696 | layout/src/image.rs:732-736 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `layout/src/image.rs:643` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (3–9 lines × 4) · ×1
  • Duplicated block (3–9 lines × 4) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:402 — webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:402-409 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:392-400 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:396-403 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:289-291 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs` and `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 369 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `context` to `&ShaderContext` in one and `&ShaderContext) -> (vec4` 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, `webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:287` calls `clamp`, `xy`, `zw` and `webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:402` 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 (1–9 lines × 3) · ×1
  • Duplicated block (1–9 lines × 3) doc/src/codegen/v2/lang_crystal/model.rs:554 — doc/src/codegen/v2/lang_crystal/model.rs:554-562 | doc/src/codegen/v2/lang_d/model.rs:860-868 | doc/src/codegen/v2/lang_swift/model.rs:861-861 — `doc/src/codegen/v2/lang_crystal/model.rs` and `doc/src/codegen/v2/lang_d/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 88 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (6–9 lines × 2) · ×1
  • Duplicated block (6–9 lines × 2) doc/src/codegen/v2/lang_java/types.rs:295 — doc/src/codegen/v2/lang_java/types.rs:295-300 | doc/src/codegen/v2/lang_java/types.rs:583-591 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_java/types.rs:295` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6–8 lines × 26) · ×1
  • Duplicated block (6–8 lines × 26) webrender/swgl/src/shaders/brush_blend.rs:101 — webrender/swgl/src/shaders/brush_blend.rs:101-107 | webrender/swgl/src/shaders/brush_blend_alpha_pass.rs:93-98 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:96-103 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:98-105 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:95-101 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:98-105 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:89-96 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:95-101 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:87-92 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:87-92 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:94-101 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:94-101 | webrender/swgl/src/shaders/brush_image_texture_2d.rs:84-89 | webrender/swgl/src/shaders/brush_image_texture_rect.rs:93-99 | webrender/swgl/src/shaders/brush_linear_gradient.rs:94-99 | webrender/swgl/src/shaders/brush_linear_gradient_alpha_pass.rs:95-100 | webrender/swgl/src/shaders/brush_mix_blend_alpha_pass.rs:111-116 | webrender/swgl/src/shaders/brush_opacity.rs:92-99 | webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs:94-101 | webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs:92-99 | webrender/swgl/src/shaders/brush_opacity_antialiasing.rs:93-100 | webrender/swgl/src/shaders/brush_solid.rs:101-108 | webrender/swgl/src/shaders/brush_solid_alpha_pass.rs:88-95 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:126-132 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:134-140 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:143-149 — before extracting anything, compare `webrender/swgl/src/shaders/brush_blend.rs` and `webrender/swgl/src/shaders/brush_blend_alpha_pass.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_blend.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. 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 `context` to `&mut ShaderContext` in one and `&ShaderContext` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (7–8 lines × 16) · ×1
  • Duplicated block (7–8 lines × 16) dll/src/desktop/shell2/linux/wayland/defines.rs:752 — dll/src/desktop/shell2/linux/wayland/defines.rs:752-758 | dll/src/desktop/shell2/linux/wayland/defines.rs:793-799 | dll/src/desktop/shell2/linux/wayland/defines.rs:840-846 | dll/src/desktop/shell2/linux/wayland/defines.rs:881-887 | dll/src/desktop/shell2/linux/wayland/defines.rs:933-939 | dll/src/desktop/shell2/linux/wayland/defines.rs:1000-1006 | dll/src/desktop/shell2/linux/wayland/defines.rs:1078-1084 | dll/src/desktop/shell2/linux/wayland/defines.rs:1116-1122 | dll/src/desktop/shell2/linux/wayland/defines.rs:1157-1163 | dll/src/desktop/shell2/linux/wayland/defines.rs:1199-1205 | dll/src/desktop/shell2/linux/wayland/defines.rs:1251-1257 | dll/src/desktop/shell2/linux/wayland/defines.rs:1308-1314 | dll/src/desktop/shell2/linux/wayland/defines.rs:1365-1371 | dll/src/desktop/shell2/linux/wayland/defines.rs:1484-1490 | dll/src/desktop/shell2/linux/wayland/defines.rs:1538-1545 | dll/src/desktop/shell2/linux/wayland/defines.rs:1642-1648 — 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 `dll/src/desktop/shell2/linux/wayland/defines.rs:752` it does not close everything it opens, so those 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 × 15) · ×1
  • Duplicated block (7–8 lines × 15) css/src/system.rs:2230 — css/src/system.rs:2230-2236 | css/src/system.rs:2282-2288 | css/src/system.rs:2334-2340 | css/src/system.rs:2386-2392 | css/src/system.rs:2441-2447 | css/src/system.rs:2499-2505 | css/src/system.rs:2548-2554 | css/src/system.rs:2598-2604 | css/src/system.rs:2648-2654 | css/src/system.rs:2697-2703 | css/src/system.rs:2776-2783 | css/src/system.rs:2849-2855 | css/src/system.rs:2904-2910 | css/src/system.rs:2953-2959 | css/src/system.rs:3002-3008 — 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 `css/src/system.rs:2230` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–8 lines × 6) · ×1
  • Duplicated block (7–8 lines × 6) webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:357 — webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:357-363 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:360-366 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:366-372 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:359-365 | webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:320-327 | webrender/swgl/src/shaders/composite_texture_rect_yuv.rs:318-325 — before extracting anything, compare `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs` and `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs` as WHOLE FILES: this scan already matched 30 separate duplicated blocks between them, totalling at least 334 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:357` it begins part-way through the construct above it, so those 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 × 4) · ×1
  • Duplicated block (7–8 lines × 4) dll/src/desktop/shell2/linux/x11/mod.rs:5922 — dll/src/desktop/shell2/linux/x11/mod.rs:5922-5929 | dll/src/desktop/shell2/linux/x11/mod.rs:5962-5969 | dll/src/desktop/shell2/linux/x11/mod.rs:7382-7388 | dll/src/desktop/shell2/linux/x11/mod.rs:8440-8446 — 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 `dll/src/desktop/shell2/linux/x11/mod.rs:5922` it does not close everything it opens, so those 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–8 lines × 4) · ×1
  • Duplicated block (5–8 lines × 4) doc/src/autofix/mod.rs:3145 — doc/src/autofix/mod.rs:3145-3149 | doc/src/autofix/mod.rs:3168-3175 | doc/src/autofix/mod.rs:3198-3205 | doc/src/autofix/mod.rs:3227-3234 — 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 (7–8 lines × 3) · ×1
  • Duplicated block (7–8 lines × 3) dll/src/desktop/shell2/android/mod.rs:2393 — dll/src/desktop/shell2/android/mod.rs:2393-2399 | dll/src/desktop/shell2/android/mod.rs:2455-2461 | dll/src/desktop/shell2/android/mod.rs:3110-3117 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/android/mod.rs:2393` it begins part-way through the construct above it, so those 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 × 2) · ×1
  • Duplicated block (6–8 lines × 2) doc/src/codegen/v2/lang_crystal/model.rs:302 — doc/src/codegen/v2/lang_crystal/model.rs:302-307 | doc/src/codegen/v2/lang_swift/model.rs:374-381 — `doc/src/codegen/v2/lang_crystal/model.rs` and `doc/src/codegen/v2/lang_swift/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 89 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_crystal/model.rs:302` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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, `doc/src/codegen/v2/lang_swift/model.rs:373` calls `module_of` and `doc/src/codegen/v2/lang_crystal/model.rs:301` 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 (2–8 lines × 3) · ×1
  • Duplicated block (2–8 lines × 3) webrender/swgl/src/shaders/cs_blur_alpha_target.rs:58 — webrender/swgl/src/shaders/cs_blur_alpha_target.rs:58-59 | webrender/swgl/src/shaders/ps_quad_mask.rs:117-124 | webrender/swgl/src/shaders/ps_quad_mask_fast_path.rs:106-113 — before extracting anything, compare `webrender/swgl/src/shaders/ps_quad_mask.rs` and `webrender/swgl/src/shaders/ps_quad_mask_fast_path.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/ps_quad_mask.rs:117` it begins part-way through the construct above it, so those 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 × 2) · ×1
  • Duplicated block (6–7 lines × 2) core/src/styled_dom.rs:1523 — core/src/styled_dom.rs:1523-1529 | layout/src/xml/mod.rs:256-261 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8 lines × 12) · ×1
  • Duplicated block (8 lines × 12) css/src/props/basic/color.rs:900 — css/src/props/basic/color.rs:900-907 | css/src/props/basic/color.rs:912-919 | css/src/props/basic/color.rs:924-931 | css/src/props/basic/color.rs:936-943 | css/src/props/basic/color.rs:948-955 | css/src/props/basic/color.rs:960-967 | css/src/props/basic/color.rs:972-979 | css/src/props/basic/color.rs:984-991 | css/src/props/basic/color.rs:996-1003 | css/src/props/basic/color.rs:1008-1015 | css/src/props/basic/color.rs:1020-1027 | css/src/props/basic/color.rs:1032-1039 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (6 lines × 11) · ×1
  • Duplicated block (6 lines × 11) doc/src/codegen/v2/lang_ada/mod.rs:222 — doc/src/codegen/v2/lang_ada/mod.rs:222-227 | doc/src/codegen/v2/lang_algol68/mod.rs:381-386 | doc/src/codegen/v2/lang_cobol/types.rs:560-565 | doc/src/codegen/v2/lang_freebasic/mod.rs:173-178 | doc/src/codegen/v2/lang_haskell/types.rs:1115-1120 | doc/src/codegen/v2/lang_nim/mod.rs:200-205 | doc/src/codegen/v2/lang_nim/mod.rs:223-228 | doc/src/codegen/v2/lang_ocaml/mod.rs:933-938 | doc/src/codegen/v2/lang_pascal/mod.rs:294-299 | doc/src/codegen/v2/lang_smalltalk/mod.rs:183-190 | doc/src/codegen/v2/lang_vb6/mod.rs:249-254 — `doc/src/codegen/v2/lang_freebasic/mod.rs` and `doc/src/codegen/v2/lang_nim/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 66 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `doc/src/codegen/v2/lang_ada/mod.rs:222` it does not close everything it opens, so those 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, `doc/src/codegen/v2/lang_cobol/types.rs:556` calls `to_string` and `doc/src/codegen/v2/lang_algol68/mod.rs:378` 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 (3–6 lines × 6) · ×1
  • Duplicated block (3–6 lines × 6) css/src/system.rs:2214 — css/src/system.rs:2214-2219 | css/src/system.rs:2268-2271 | css/src/system.rs:2318-2323 | css/src/system.rs:2370-2375 | css/src/system.rs:2429-2431 | css/src/system.rs:2480-2482 — 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 `css/src/system.rs:2214` it does not close everything it opens, so those 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, `css/src/system.rs:2428` calls `Some`, `new_rgb` and `css/src/system.rs:2268` 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 (4–6 lines × 4) · ×1
  • Duplicated block (4–6 lines × 4) layout/src/cpurender/pixmap.rs:119 — layout/src/cpurender/pixmap.rs:119-124 | layout/src/cpurender/pixmap.rs:303-308 | layout/src/cpurender/pixmap.rs:484-489 | layout/src/cpurender/raster.rs:4684-4687 — 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 `layout/src/cpurender/pixmap.rs:119` 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–6 lines × 2) · ×1
  • Duplicated block (5–6 lines × 2) webrender/swgl/src/shaders/ps_quad_mask.rs:197 — webrender/swgl/src/shaders/ps_quad_mask.rs:197-201 | webrender/swgl/src/shaders/ps_quad_mask_fast_path.rs:300-305 — before extracting anything, compare `webrender/swgl/src/shaders/ps_quad_mask.rs` and `webrender/swgl/src/shaders/ps_quad_mask_fast_path.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/ps_quad_mask.rs:197` it does not close everything it opens, so those 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 (4–6 lines × 3) · ×1
  • Duplicated block (4–6 lines × 3) webrender/swgl/src/shaders/cs_blur_alpha_target.rs:183 — webrender/swgl/src/shaders/cs_blur_alpha_target.rs:183-186 | webrender/swgl/src/shaders/ps_quad_mask.rs:364-369 | webrender/swgl/src/shaders/ps_quad_mask_fast_path.rs:340-345 — before extracting anything, compare `webrender/swgl/src/shaders/ps_quad_mask.rs` and `webrender/swgl/src/shaders/ps_quad_mask_fast_path.rs` as WHOLE FILES: this scan already matched 17 separate duplicated blocks between them, totalling at least 145 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/ps_quad_mask.rs:364` 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 before the matched lines, `webrender/swgl/src/shaders/ps_quad_mask.rs:360` calls `add` and `webrender/swgl/src/shaders/cs_blur_alpha_target.rs:180` 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 (3–5 lines × 38) · ×1
  • Duplicated block (3–5 lines × 38) webrender/swgl/src/shaders/brush_blend.rs:283 — webrender/swgl/src/shaders/brush_blend.rs:283-289 | webrender/swgl/src/shaders/brush_blend_alpha_pass.rs:235-239 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:333-340 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:331-337 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:320-326 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:272-278 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:323-329 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:293-297 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:232-236 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:225-229 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:293-299 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:285-291 | webrender/swgl/src/shaders/brush_image_texture_2d.rs:177-181 | webrender/swgl/src/shaders/brush_image_texture_rect.rs:219-226 | webrender/swgl/src/shaders/brush_linear_gradient.rs:182-186 | webrender/swgl/src/shaders/brush_linear_gradient_alpha_pass.rs:183-187 | webrender/swgl/src/shaders/brush_mix_blend.rs:294-298 | webrender/swgl/src/shaders/brush_mix_blend_alpha_pass.rs:186-190 | webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs:192-196 | webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs:189-196 | webrender/swgl/src/shaders/brush_opacity_antialiasing.rs:186-193 | webrender/swgl/src/shaders/brush_solid.rs:178-185 | webrender/swgl/src/shaders/brush_solid_alpha_pass.rs:168-175 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:290-294 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:294-298 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:300-304 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:294-298 | webrender/swgl/src/shaders/cs_blur_alpha_target.rs:183-185 | webrender/swgl/src/shaders/ps_quad_conic_gradient.rs:202-206 | webrender/swgl/src/shaders/ps_quad_mask.rs:361-363 | webrender/swgl/src/shaders/ps_quad_mask_fast_path.rs:337-339 | webrender/swgl/src/shaders/ps_quad_radial_gradient.rs:203-207 | webrender/swgl/src/shaders/ps_quad_textured.rs:313-317 | webrender/swgl/src/shaders/ps_split_composite.rs:169-173 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs:219-223 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_texture_2d.rs:148-152 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_glyph_transform_texture_2d.rs:173-177 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_texture_2d.rs:210-214 — before extracting anything, compare `webrender/swgl/src/shaders/brush_blend.rs` and `webrender/swgl/src/shaders/brush_blend_alpha_pass.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_blend.rs:283` 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 before the matched lines, `webrender/swgl/src/shaders/brush_blend.rs:282` calls `add` and `webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs:192` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (5 lines × 30) · ×1
  • Duplicated block (5 lines × 30) webrender/swgl/src/shaders/brush_blend.rs:83 — webrender/swgl/src/shaders/brush_blend.rs:83-87 | webrender/swgl/src/shaders/brush_blend_alpha_pass.rs:75-79 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:77-81 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:79-83 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:76-80 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:79-83 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:70-74 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:76-80 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:69-73 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:69-73 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:75-79 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:75-79 | webrender/swgl/src/shaders/brush_image_texture_2d.rs:66-70 | webrender/swgl/src/shaders/brush_image_texture_rect.rs:76-80 | webrender/swgl/src/shaders/brush_linear_gradient.rs:76-80 | webrender/swgl/src/shaders/brush_linear_gradient_alpha_pass.rs:77-81 | webrender/swgl/src/shaders/brush_mix_blend.rs:227-231 | webrender/swgl/src/shaders/brush_mix_blend_alpha_pass.rs:93-97 | webrender/swgl/src/shaders/brush_opacity.rs:74-78 | webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs:75-79 | webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs:73-77 | webrender/swgl/src/shaders/brush_opacity_antialiasing.rs:74-78 | webrender/swgl/src/shaders/brush_solid.rs:82-86 | webrender/swgl/src/shaders/brush_solid_alpha_pass.rs:69-73 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:108-112 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:116-120 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:126-130 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:125-129 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs:99-103 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_texture_2d.rs:72-76 — before extracting anything, compare `webrender/swgl/src/shaders/brush_blend.rs` and `webrender/swgl/src/shaders/brush_blend_alpha_pass.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `context` to `&mut ShaderContext` in one and `&ShaderContext` 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 (5 lines × 27) · ×1
  • Duplicated block (5 lines × 27) webrender/swgl/src/shaders/brush_blend.rs:102 — webrender/swgl/src/shaders/brush_blend.rs:102-107 | webrender/swgl/src/shaders/brush_blend_alpha_pass.rs:94-98 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:98-103 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:100-105 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:97-101 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:100-105 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:91-96 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:97-101 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:88-92 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:88-92 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:96-101 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:96-101 | webrender/swgl/src/shaders/brush_image_texture_2d.rs:85-89 | webrender/swgl/src/shaders/brush_image_texture_rect.rs:94-99 | webrender/swgl/src/shaders/brush_linear_gradient.rs:95-99 | webrender/swgl/src/shaders/brush_linear_gradient_alpha_pass.rs:96-100 | webrender/swgl/src/shaders/brush_mix_blend_alpha_pass.rs:112-116 | webrender/swgl/src/shaders/brush_opacity.rs:94-99 | webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs:96-101 | webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs:94-99 | webrender/swgl/src/shaders/brush_opacity_antialiasing.rs:95-100 | webrender/swgl/src/shaders/brush_solid.rs:103-108 | webrender/swgl/src/shaders/brush_solid_alpha_pass.rs:90-95 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:127-132 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:135-140 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:144-149 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:142-147 — before extracting anything, compare `webrender/swgl/src/shaders/brush_blend.rs` and `webrender/swgl/src/shaders/brush_blend_alpha_pass.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_blend.rs:102` it does not close everything it opens, so those 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 `context` to `&mut ShaderContext` in one and `&ShaderContext` 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 (5 lines × 20) · ×1
  • Duplicated block (5 lines × 20) webrender/swgl/src/shaders/brush_blend.rs:129 — webrender/swgl/src/shaders/brush_blend.rs:129-137 | webrender/swgl/src/shaders/brush_blend_alpha_pass.rs:110-114 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:117-125 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:119-127 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:113-117 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:119-127 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:110-118 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:113-117 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:115-123 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:115-123 | webrender/swgl/src/shaders/brush_linear_gradient.rs:111-115 | webrender/swgl/src/shaders/brush_linear_gradient_alpha_pass.rs:112-116 | webrender/swgl/src/shaders/brush_mix_blend_alpha_pass.rs:128-132 | webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs:116-125 | webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs:113-121 | webrender/swgl/src/shaders/brush_opacity_antialiasing.rs:115-123 | webrender/swgl/src/shaders/brush_solid.rs:130-138 | webrender/swgl/src/shaders/brush_solid_alpha_pass.rs:117-125 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:146-154 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:154-162 — before extracting anything, compare `webrender/swgl/src/shaders/brush_blend.rs` and `webrender/swgl/src/shaders/brush_blend_alpha_pass.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_blend.rs:129` it begins part-way through the construct above it, so those 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 `context` to `&mut ShaderContext` in one and `&ShaderContext` 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, `webrender/swgl/src/shaders/brush_blend_alpha_pass.rs:109` calls `clip_and_init_antialiasing` and `webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:113` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (3–5 lines × 3) · ×1
  • Duplicated block (3–5 lines × 3) dll/src/desktop/shell2/linux/system_style.rs:771 — dll/src/desktop/shell2/linux/system_style.rs:771-775 | dll/src/desktop/shell2/linux/system_style.rs:1468-1472 | dll/src/desktop/shell2/linux/system_style.rs:1579-1581 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/system_style.rs:771` 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 before the matched lines, `dll/src/desktop/shell2/linux/system_style.rs:770` calls `contains` and `dll/src/desktop/shell2/linux/system_style.rs:1579` 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–5 lines × 4) · ×1
  • Duplicated block (3–5 lines × 4) webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:405 — webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:405-407 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:364-366 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:295-300 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:284-288 — before extracting anything, compare `webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs` and `webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 328 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:295` 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 (4–5 lines × 4) · ×1
  • Duplicated block (4–5 lines × 4) webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:236 — webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:236-239 | webrender/swgl/src/shaders/cs_blur_color_target.rs:168-171 | webrender/swgl/src/shaders/cs_fast_linear_gradient.rs:107-111 | webrender/swgl/src/shaders/cs_radial_gradient.rs:116-120 — before extracting anything, compare `webrender/swgl/src/shaders/cs_fast_linear_gradient.rs` and `webrender/swgl/src/shaders/cs_radial_gradient.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:236` it does not close everything it opens, so those 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, `webrender/swgl/src/shaders/cs_fast_linear_gradient.rs:106` calls `add` and `webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:236` 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 × 7) · ×1
  • Duplicated block (7 lines × 7) dll/src/desktop/shell2/android/mod.rs:623 — dll/src/desktop/shell2/android/mod.rs:623-629 | dll/src/desktop/shell2/ios/mod.rs:2071-2077 | dll/src/desktop/shell2/linux/wayland/mod.rs:1660-1666 | dll/src/desktop/shell2/linux/wayland/mod.rs:10128-10134 | dll/src/desktop/shell2/linux/x11/mod.rs:7921-7927 | dll/src/desktop/shell2/macos/mod.rs:4415-4421 | dll/src/desktop/shell2/windows/mod.rs:7437-7443 — `dll/src/desktop/shell2/android/mod.rs` and `dll/src/desktop/shell2/ios/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 17 separate duplicated blocks between them, totalling at least 242 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/android/mod.rs:623` it begins part-way through the construct above it, so those 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, `dll/src/desktop/shell2/linux/wayland/mod.rs:10136` calls `queue_window_create`, `push` and `dll/src/desktop/shell2/linux/wayland/mod.rs:1668` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (15 lines × 20) · ×1
  • Duplicated block (15 lines × 20) doc/src/codegen/v2/lang_ada/types.rs:200 — doc/src/codegen/v2/lang_ada/types.rs:200-214 | doc/src/codegen/v2/lang_ada/wrappers.rs:85-99 | doc/src/codegen/v2/lang_algol68/types.rs:101-115 | doc/src/codegen/v2/lang_algol68/types.rs:117-131 | doc/src/codegen/v2/lang_algol68/wrappers.rs:133-147 | doc/src/codegen/v2/lang_cobol/types.rs:37-51 | doc/src/codegen/v2/lang_cobol/types.rs:53-67 | doc/src/codegen/v2/lang_cobol/wrappers.rs:101-115 | doc/src/codegen/v2/lang_fortran/types.rs:321-335 | doc/src/codegen/v2/lang_fortran/types.rs:337-351 | doc/src/codegen/v2/lang_fortran/wrappers.rs:496-510 | doc/src/codegen/v2/lang_freebasic/types.rs:97-111 | doc/src/codegen/v2/lang_freebasic/types.rs:113-127 | doc/src/codegen/v2/lang_freebasic/wrappers.rs:99-113 | doc/src/codegen/v2/lang_ocaml/wrappers.rs:235-249 | doc/src/codegen/v2/lang_pascal/wrappers.rs:149-163 | doc/src/codegen/v2/lang_smalltalk/types.rs:83-97 | doc/src/codegen/v2/lang_vb6/types.rs:114-128 | doc/src/codegen/v2/lang_vb6/types.rs:130-144 | doc/src/codegen/v2/lang_vb6/wrappers.rs:76-90 — `doc/src/codegen/v2/lang_ada/types.rs` and `doc/src/codegen/v2/lang_cobol/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 48 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (12 lines × 20) · ×1
  • Duplicated block (12 lines × 20) doc/src/codegen/v2/lang_csharp/types.rs:243 — doc/src/codegen/v2/lang_csharp/types.rs:243-255 | doc/src/codegen/v2/lang_csharp/types.rs:257-268 | doc/src/codegen/v2/lang_java/types.rs:389-403 | doc/src/codegen/v2/lang_java/types.rs:405-420 | doc/src/codegen/v2/lang_julia/mod.rs:380-391 | doc/src/codegen/v2/lang_julia/mod.rs:393-404 | doc/src/codegen/v2/lang_kotlin/mod.rs:154-167 | doc/src/codegen/v2/lang_kotlin/mod.rs:169-180 | doc/src/codegen/v2/lang_lisp/types.rs:119-132 | doc/src/codegen/v2/lang_lisp/types.rs:134-145 | doc/src/codegen/v2/lang_odin/mod.rs:301-312 | doc/src/codegen/v2/lang_odin/mod.rs:314-325 | doc/src/codegen/v2/lang_pascal/types.rs:217-233 | doc/src/codegen/v2/lang_pascal/types.rs:235-246 | doc/src/codegen/v2/lang_racket/types.rs:112-123 | doc/src/codegen/v2/lang_racket/types.rs:125-136 | doc/src/codegen/v2/lang_ruby/types.rs:375-389 | doc/src/codegen/v2/lang_ruby/types.rs:391-405 | doc/src/codegen/v2/lang_v/mod.rs:333-344 | doc/src/codegen/v2/lang_v/mod.rs:346-357 — `doc/src/codegen/v2/lang_csharp/types.rs` and `doc/src/codegen/v2/lang_java/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 72 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (5 lines × 7) · ×1
  • Duplicated block (5 lines × 7) layout/src/widgets/alert.rs:468 — layout/src/widgets/alert.rs:468-472 | layout/src/widgets/avatar.rs:291-295 | layout/src/widgets/badge.rs:268-272 | layout/src/widgets/button.rs:547-551 | layout/src/widgets/chip.rs:455-459 | layout/src/widgets/label.rs:121-125 | layout/src/widgets/toast.rs:497-501 — before extracting anything, compare `layout/src/widgets/alert.rs` and `layout/src/widgets/toast.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (7 lines × 36) · ×1
  • Duplicated block (7 lines × 36) webrender/swgl/src/shaders/brush_blend.rs:33 — webrender/swgl/src/shaders/brush_blend.rs:33-39 | webrender/swgl/src/shaders/brush_blend_alpha_pass.rs:33-39 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:30-36 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:31-37 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:33-39 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:31-37 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:30-36 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:33-39 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:30-36 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:30-36 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:27-33 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:27-33 | webrender/swgl/src/shaders/brush_image_texture_2d.rs:27-33 | webrender/swgl/src/shaders/brush_image_texture_rect.rs:29-35 | webrender/swgl/src/shaders/brush_linear_gradient.rs:29-35 | webrender/swgl/src/shaders/brush_linear_gradient_alpha_pass.rs:30-36 | webrender/swgl/src/shaders/brush_mix_blend.rs:183-189 | webrender/swgl/src/shaders/brush_mix_blend_alpha_pass.rs:50-56 | webrender/swgl/src/shaders/brush_opacity.rs:27-33 | webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs:28-34 | webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs:26-32 | webrender/swgl/src/shaders/brush_opacity_antialiasing.rs:27-33 | webrender/swgl/src/shaders/brush_solid.rs:31-37 | webrender/swgl/src/shaders/brush_solid_alpha_pass.rs:25-31 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_2d_yuv.rs:62-68 | webrender/swgl/src/shaders/brush_yuv_image_alpha_pass_texture_rect_yuv.rs:70-76 | webrender/swgl/src/shaders/brush_yuv_image_texture_2d_yuv.rs:80-86 | webrender/swgl/src/shaders/brush_yuv_image_texture_rect_yuv.rs:71-77 | webrender/swgl/src/shaders/ps_quad_conic_gradient.rs:46-52 | webrender/swgl/src/shaders/ps_quad_radial_gradient.rs:32-38 | webrender/swgl/src/shaders/ps_quad_textured.rs:83-89 | webrender/swgl/src/shaders/ps_split_composite.rs:30-36 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs:54-60 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_texture_2d.rs:30-36 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_glyph_transform_texture_2d.rs:30-36 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_texture_2d.rs:56-62 — before extracting anything, compare `webrender/swgl/src/shaders/brush_blend.rs` and `webrender/swgl/src/shaders/brush_blend_alpha_pass.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (8 lines × 31) · ×1
  • Duplicated block (8 lines × 31) webrender/swgl/src/shaders/brush_blend.rs:444 — webrender/swgl/src/shaders/brush_blend.rs:444-451 | webrender/swgl/src/shaders/brush_blend_alpha_pass.rs:393-400 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:424-431 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:426-433 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:415-422 | webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_rect.rs:354-361 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:428-435 | webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:384-391 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_2d.rs:304-311 | webrender/swgl/src/shaders/brush_image_alpha_pass_texture_rect.rs:292-299 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:369-376 | webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:357-364 | webrender/swgl/src/shaders/brush_image_texture_2d.rs:233-240 | webrender/swgl/src/shaders/brush_image_texture_rect.rs:288-295 | webrender/swgl/src/shaders/brush_opacity_alpha_pass.rs:285-294 | webrender/swgl/src/shaders/brush_opacity_alpha_pass_antialiasing.rs:273-280 | webrender/swgl/src/shaders/brush_opacity_antialiasing.rs:258-265 | webrender/swgl/src/shaders/composite_fast_path_texture_2d.rs:168-175 | webrender/swgl/src/shaders/composite_fast_path_texture_rect.rs:158-165 | webrender/swgl/src/shaders/composite_texture_2d.rs:183-190 | webrender/swgl/src/shaders/composite_texture_rect.rs:191-198 | webrender/swgl/src/shaders/cs_blur_alpha_target.rs:271-278 | webrender/swgl/src/shaders/cs_blur_color_target.rs:263-270 | webrender/swgl/src/shaders/cs_scale_texture_2d.rs:165-172 | webrender/swgl/src/shaders/cs_scale_texture_rect.rs:177-184 | webrender/swgl/src/shaders/ps_copy.rs:146-153 | webrender/swgl/src/shaders/ps_split_composite.rs:226-233 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_glyph_transform_texture_2d.rs:278-285 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_dual_source_blending_texture_2d.rs:217-224 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_glyph_transform_texture_2d.rs:239-246 | webrender/swgl/src/shaders/ps_text_run_alpha_pass_texture_2d.rs:277-284 — before extracting anything, compare `webrender/swgl/src/shaders/brush_blend.rs` and `webrender/swgl/src/shaders/brush_blend_alpha_pass.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 202 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (6 lines × 9) · ×1
  • Duplicated block (6 lines × 9) webrender/swgl/src/shaders/brush_linear_gradient.rs:317 — webrender/swgl/src/shaders/brush_linear_gradient.rs:317-322 | webrender/swgl/src/shaders/brush_linear_gradient_alpha_pass.rs:333-338 | webrender/swgl/src/shaders/cs_border_segment.rs:462-467 | webrender/swgl/src/shaders/cs_border_solid.rs:348-353 | webrender/swgl/src/shaders/cs_conic_gradient.rs:240-245 | webrender/swgl/src/shaders/cs_fast_linear_gradient.rs:214-219 | webrender/swgl/src/shaders/cs_linear_gradient.rs:247-252 | webrender/swgl/src/shaders/cs_radial_gradient.rs:272-277 | webrender/swgl/src/shaders/ps_quad_radial_gradient.rs:336-341 — before extracting anything, compare `webrender/swgl/src/shaders/brush_linear_gradient.rs` and `webrender/swgl/src/shaders/brush_linear_gradient_alpha_pass.rs` as WHOLE FILES: this scan already matched 22 separate duplicated blocks between them, totalling at least 218 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (7 lines × 23) · ×1
  • Duplicated block (7 lines × 23) css/src/props/layout/display.rs:214 — css/src/props/layout/display.rs:214-220 | css/src/props/layout/display.rs:293-299 | css/src/props/layout/flex.rs:327-333 | css/src/props/layout/flex.rs:498-504 | css/src/props/layout/flex.rs:589-595 | css/src/props/layout/flex.rs:677-683 | css/src/props/layout/flex.rs:784-790 | css/src/props/layout/fragmentation.rs:225-231 | css/src/props/layout/fragmentation.rs:286-292 | css/src/props/layout/fragmentation.rs:412-418 | css/src/props/style/effects.rs:730-736 | css/src/props/style/effects.rs:819-825 | css/src/props/style/effects.rs:919-925 | css/src/props/style/effects.rs:1119-1125 | css/src/props/style/lists.rs:155-161 | css/src/props/style/lists.rs:224-230 | css/src/props/style/scrollbar.rs:954-960 | css/src/props/style/scrollbar.rs:1008-1014 | css/src/props/style/scrollbar.rs:1130-1136 | css/src/props/style/scrollbar.rs:1180-1186 | css/src/props/style/scrollbar.rs:1239-1245 | css/src/props/style/text.rs:1393-1399 | css/src/props/style/transform.rs:725-731 — there are 23 copies across 8 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 23 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (23–26 lines × 2) · ×1
  • Duplicated block (23–26 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:10958 — dll/src/desktop/shell2/linux/wayland/mod.rs:10958-10983 | dll/src/desktop/shell2/linux/x11/mod.rs:8715-8737 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 49 separate duplicated blocks between them, totalling at least 777 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/mod.rs:10958` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 21) · ×1
  • Duplicated block (12 lines × 21) dll/src/desktop/shell2/linux/wayland/defines.rs:914 — dll/src/desktop/shell2/linux/wayland/defines.rs:914-925 | dll/src/desktop/shell2/linux/wayland/defines.rs:1060-1071 | dll/src/desktop/shell2/linux/wayland/defines.rs:1099-1110 | dll/src/desktop/shell2/linux/wayland/defines.rs:1237-1248 | dll/src/desktop/shell2/linux/wayland/defines.rs:1351-1362 | dll/src/desktop/shell2/linux/wayland/defines.rs:1470-1481 | dll/src/desktop/shell2/linux/wayland/defines.rs:1519-1530 | dll/src/desktop/shell2/linux/wayland/defines.rs:1627-1638 | dll/src/desktop/shell2/linux/wayland/defines.rs:1960-1971 | dll/src/desktop/shell2/linux/wayland/defines.rs:2012-2023 | dll/src/desktop/shell2/linux/wayland/defines.rs:2054-2065 | dll/src/desktop/shell2/linux/wayland/defines.rs:2114-2125 | dll/src/desktop/shell2/linux/wayland/defines.rs:2186-2197 | dll/src/desktop/shell2/linux/wayland/defines.rs:2241-2252 | dll/src/desktop/shell2/linux/wayland/defines.rs:2368-2379 | dll/src/desktop/shell2/linux/wayland/defines.rs:2408-2419 | dll/src/desktop/shell2/linux/wayland/defines.rs:2555-2566 | dll/src/desktop/shell2/linux/wayland/defines.rs:2598-2609 | dll/src/desktop/shell2/linux/wayland/defines.rs:2643-2654 | dll/src/desktop/shell2/linux/wayland/defines.rs:2909-2920 | dll/src/desktop/shell2/linux/wayland/defines.rs:2994-3005 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `dll/src/desktop/shell2/linux/wayland/defines.rs:914` 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–5 lines × 3) · ×1
  • Duplicated block (4–5 lines × 3) doc/src/reftest/debug.rs:577 — doc/src/reftest/debug.rs:577-580 | doc/src/reftest/regression.rs:1701-1705 | doc/src/reftest/regression.rs:1720-1724 — 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 `doc/src/reftest/debug.rs:577` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D44 · Platform End-of-Life · End-of-life runtime · ×1
  • End-of-life runtime: Rust 1.91 rust-toolchain.toml:1 — rust-toolchain.toml declares Rust 1.91 as this project's toolchain file, and Rust 1.91, superseded by 1.92 on 2025-12-11 (the Rust project patches only the current stable). An unsupported runtime receives no security patches, so every vulnerability disclosed in it since 2025-12-11 is present and unfixable without moving off it. This is a migration rather than an upgrade: there is no newer release of a runtime that has ended.
D5 · Coupling · Unstable project webrender · ×1
  • Unstable project webrender — webrender has instability 0.83 with 1 dependents.
P12 · CI test-gate honesty · Test suite runs only after the merge · ×1
  • Test suite runs only after the merge — `REDACTED` run(s) the test suite, but no workflow that runs tests is triggered by a pull request (or a merge queue) — so the suite reports on code that is already on the default branch. A red build there blocks nothing and the only remedy is a revert. Add the pull-request trigger to the workflow that runs your suite so the gate applies before the merge, not after it.
R1 · Type Safety · Type Safety · ×1
  • Type Safety — 0 typed · 10 plain JS — the untyped files are dll/src/desktop/shell2/common/debugger/debugger.js, scripts/docs_pdf_book.mjs, scripts/docs_pdf_cdp.mjs, scripts/e2e-web/lib/asserts.mjs, scripts/e2e-web/lib/cdp.mjs, scripts/e2e-web/lib/driver.mjs (+4 more).
R10 · Code Duplication · Duplicated block (15 lines × 2 locations) · ×1
  • Duplicated block (15 lines × 2 locations) dll/src/desktop/shell2/common/debugger/debugger.js:3534 — dll/src/desktop/shell2/common/debugger/debugger.js:3534 · dll/src/desktop/shell2/common/debugger/debugger.js:3550 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (14 lines × 2 locations) · ×1
  • Duplicated block (14 lines × 2 locations) dll/src/desktop/shell2/common/debugger/debugger.js:939 — dll/src/desktop/shell2/common/debugger/debugger.js:939 · dll/src/desktop/shell2/common/debugger/debugger.js:1037 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (13 lines × 2 locations) · ×1
  • Duplicated block (13 lines × 2 locations) dll/src/desktop/shell2/common/debugger/debugger.js:4252 — dll/src/desktop/shell2/common/debugger/debugger.js:4252 · dll/src/desktop/shell2/common/debugger/debugger.js:4312 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (12 lines × 2 locations) · ×1
  • Duplicated block (12 lines × 2 locations) dll/src/desktop/shell2/common/debugger/debugger.js:3153 — dll/src/desktop/shell2/common/debugger/debugger.js:3153 · dll/src/desktop/shell2/common/debugger/debugger.js:3181 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (11 lines × 2 locations) · ×1
  • Duplicated block (11 lines × 2 locations) dll/src/desktop/shell2/common/debugger/debugger.js:2842 — dll/src/desktop/shell2/common/debugger/debugger.js:2842 · dll/src/desktop/shell2/common/debugger/debugger.js:2870 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (9 lines × 3 locations) · ×1
  • Duplicated block (9 lines × 3 locations) dll/src/desktop/shell2/common/debugger/debugger.js:1408 — dll/src/desktop/shell2/common/debugger/debugger.js:1408 · dll/src/desktop/shell2/common/debugger/debugger.js:2236 · dll/src/desktop/shell2/common/debugger/debugger.js:2993 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (9 lines × 5 locations) · ×1
  • Duplicated block (9 lines × 5 locations) dll/src/desktop/shell2/common/debugger/debugger.js:1579 — dll/src/desktop/shell2/common/debugger/debugger.js:1579 · dll/src/desktop/shell2/common/debugger/debugger.js:2025 · dll/src/desktop/shell2/common/debugger/debugger.js:2236 · dll/src/desktop/shell2/common/debugger/debugger.js:2581 · +1 more site(s) not listed — all 5 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (7 lines × 2 locations) · ×1
  • Duplicated block (7 lines × 2 locations) dll/src/desktop/shell2/common/debugger/debugger.js:1697 — dll/src/desktop/shell2/common/debugger/debugger.js:1697 · dll/src/desktop/shell2/common/debugger/debugger.js:1705 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (6 lines × 2 locations) · ×1
  • Duplicated block (6 lines × 2 locations) dll/src/desktop/shell2/common/debugger/debugger.js:1649 — dll/src/desktop/shell2/common/debugger/debugger.js:1649 · dll/src/desktop/shell2/common/debugger/debugger.js:4731 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (6 lines × 4 locations) · ×1
  • Duplicated block (6 lines × 4 locations) dll/src/desktop/shell2/common/debugger/debugger.js:3707 — dll/src/desktop/shell2/common/debugger/debugger.js:3707 · dll/src/desktop/shell2/common/debugger/debugger.js:4128 · dll/src/desktop/shell2/common/debugger/debugger.js:4201 · dll/src/desktop/shell2/common/debugger/debugger.js:4228 — all 4 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (5 lines × 2 locations) · ×1
  • Duplicated block (5 lines × 2 locations) dll/src/desktop/shell2/common/debugger/debugger.js:2327 — dll/src/desktop/shell2/common/debugger/debugger.js:2327 · dll/src/desktop/shell2/common/debugger/debugger.js:2378 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R2 · Cyclomatic Complexity · Complex function runStep (cyclomatic 69, cognitive 44) · ×1
  • Complex function runStep (cyclomatic 69, cognitive 44) scripts/e2e-web/lib/driver.mjs:187 — runStep has cyclomatic complexity 69 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function runAssert (cyclomatic 53, cognitive 68) · ×1
  • Complex function runAssert (cyclomatic 53, cognitive 68) scripts/e2e-web/lib/asserts.mjs:53 — runAssert has cyclomatic complexity 53 and cognitive complexity 68; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function runTest (cyclomatic 42, cognitive 79) · ×1
  • Complex function runTest (cyclomatic 42, cognitive 79) scripts/e2e-web/run.mjs:191 — runTest has cyclomatic complexity 42 and cognitive complexity 79; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function decodePng (cyclomatic 39, cognitive 49) · ×1
  • Complex function decodePng (cyclomatic 39, cognitive 49) scripts/e2e-web/lib/png.mjs:22 — decodePng has cyclomatic complexity 39 and cognitive complexity 49; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function main (cyclomatic 37, cognitive 61) · ×1
  • Complex function main (cyclomatic 37, cognitive 61) scripts/e2e-web/run.mjs:403 — main has cyclomatic complexity 37 and cognitive complexity 61; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _renderTreeNode (cyclomatic 29, cognitive 34) · ×1
  • Complex function _renderTreeNode (cyclomatic 29, cognitive 34) dll/src/desktop/shell2/common/debugger/debugger.js:656 — _renderTreeNode has cyclomatic complexity 29 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _loop (cyclomatic 27, cognitive 27) · ×1
  • Complex function _loop (cyclomatic 27, cognitive 27) dll/src/desktop/shell2/common/debugger/debugger.js:4572 — _loop has cyclomatic complexity 27 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function showComponentDetail (cyclomatic 26, cognitive 28) · ×1
  • Complex function showComponentDetail (cyclomatic 26, cognitive 28) dll/src/desktop/shell2/common/debugger/debugger.js:2265 — showComponentDetail has cyclomatic complexity 26 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function render (cyclomatic 26, cognitive 9) · ×1
  • Complex function render (cyclomatic 26, cognitive 9) dll/src/desktop/shell2/common/debugger/debugger.js:3449 — render has cyclomatic complexity 26 and cognitive complexity 9; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _parseSlashCommand (cyclomatic 23, cognitive 48) · ×1
  • Complex function _parseSlashCommand (cyclomatic 23, cognitive 48) dll/src/desktop/shell2/common/debugger/debugger.js:4753 — _parseSlashCommand has cyclomatic complexity 23 and cognitive complexity 48; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _loadComponentPreview (cyclomatic 22, cognitive 21) · ×1
  • Complex function _loadComponentPreview (cyclomatic 22, cognitive 21) dll/src/desktop/shell2/common/debugger/debugger.js:2590 — _loadComponentPreview has cyclomatic complexity 22 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function parseArgs (cyclomatic 22, cognitive 13) · ×1
  • Complex function parseArgs (cyclomatic 22, cognitive 13) scripts/e2e-web/run.mjs:88 — parseArgs has cyclomatic complexity 22 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function init (cyclomatic 21, cognitive 33) · ×1
  • Complex function init (cyclomatic 21, cognitive 33) dll/src/desktop/shell2/common/debugger/debugger.js:196 — init has cyclomatic complexity 21 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function renderNodeDetail (cyclomatic 21, cognitive 24) · ×1
  • Complex function renderNodeDetail (cyclomatic 21, cognitive 24) dll/src/desktop/shell2/common/debugger/debugger.js:795 — renderNodeDetail has cyclomatic complexity 21 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function assertScreenshot (cyclomatic 21, cognitive 22) · ×1
  • Complex function assertScreenshot (cyclomatic 21, cognitive 22) scripts/e2e-web/lib/asserts.mjs:191 — assertScreenshot has cyclomatic complexity 21 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function exportCode (cyclomatic 19, cognitive 23) · ×1
  • Complex function exportCode (cyclomatic 19, cognitive 23) dll/src/desktop/shell2/common/debugger/debugger.js:1588 — exportCode has cyclomatic complexity 19 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _loadNodeClipInfo (cyclomatic 19, cognitive 21) · ×1
  • Complex function _loadNodeClipInfo (cyclomatic 19, cognitive 21) dll/src/desktop/shell2/common/debugger/debugger.js:1313 — _loadNodeClipInfo has cyclomatic complexity 19 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _addCollapsible (cyclomatic 18, cognitive 35) · ×1
  • Complex function _addCollapsible (cyclomatic 18, cognitive 35) dll/src/desktop/shell2/common/debugger/debugger.js:3335 — _addCollapsible has cyclomatic complexity 18 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function runTestsInTab (cyclomatic 18, cognitive 22) · ×1
  • Complex function runTestsInTab (cyclomatic 18, cognitive 22) scripts/e2e-web/run.mjs:333 — runTestsInTab has cyclomatic complexity 18 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _onMessage (cyclomatic 18, cognitive 21) · ×1
  • Complex function _onMessage (cyclomatic 18, cognitive 21) scripts/e2e-web/lib/cdp.mjs:86 — _onMessage has cyclomatic complexity 18 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _loadNodeBoxModel (cyclomatic 18, cognitive 16) · ×1
  • Complex function _loadNodeBoxModel (cyclomatic 18, cognitive 16) dll/src/desktop/shell2/common/debugger/debugger.js:1204 — _loadNodeBoxModel has cyclomatic complexity 18 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function update (cyclomatic 17, cognitive 23) · ×1
  • Complex function update (cyclomatic 17, cognitive 23) dll/src/desktop/shell2/common/debugger/debugger.js:4004 — update has cyclomatic complexity 17 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function ctxCreateComponentFromSubtree (cyclomatic 16, cognitive 20) · ×1
  • Complex function ctxCreateComponentFromSubtree (cyclomatic 16, cognitive 20) dll/src/desktop/shell2/common/debugger/debugger.js:1943 — ctxCreateComponentFromSubtree has cyclomatic complexity 16 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _extractBase64Image (cyclomatic 16, cognitive 12) · ×1
  • Complex function _extractBase64Image (cyclomatic 16, cognitive 12) dll/src/desktop/shell2/common/debugger/debugger.js:4737 — _extractBase64Image has cyclomatic complexity 16 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function buildNode (cyclomatic 15, cognitive 18) · ×1
  • Complex function buildNode (cyclomatic 15, cognitive 18) dll/src/desktop/shell2/common/debugger/debugger.js:4121 — buildNode has cyclomatic complexity 15 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function pixelDiff (cyclomatic 14, cognitive 20) · ×1
  • Complex function pixelDiff (cyclomatic 14, cognitive 20) scripts/e2e-web/lib/png.mjs:176 — pixelDiff has cyclomatic complexity 14 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 14, cognitive 13) · ×1
  • Complex function (anonymous) (cyclomatic 14, cognitive 13) dll/src/desktop/shell2/common/debugger/debugger.js:2686 — (anonymous) has cyclomatic complexity 14 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _parseFieldType (cyclomatic 13, cognitive 14) · ×1
  • Complex function _parseFieldType (cyclomatic 13, cognitive 14) dll/src/desktop/shell2/common/debugger/debugger.js:4048 — _parseFieldType has cyclomatic complexity 13 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function loadLibraries (cyclomatic 12, cognitive 13) · ×1
  • Complex function loadLibraries (cyclomatic 12, cognitive 13) dll/src/desktop/shell2/common/debugger/debugger.js:2129 — loadLibraries has cyclomatic complexity 12 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function switchView (cyclomatic 12, cognitive 12) · ×1
  • Complex function switchView (cyclomatic 12, cognitive 12) dll/src/desktop/shell2/common/debugger/debugger.js:581 — switchView has cyclomatic complexity 12 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function terminalKeydown (cyclomatic 11, cognitive 22) · ×1
  • Complex function terminalKeydown (cyclomatic 11, cognitive 22) dll/src/desktop/shell2/common/debugger/debugger.js:3011 — terminalKeydown has cyclomatic complexity 11 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 11, cognitive 10) · ×1
  • Complex function (anonymous) (cyclomatic 11, cognitive 10) dll/src/desktop/shell2/common/debugger/debugger.js:967 — (anonymous) has cyclomatic complexity 11 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function resolvePtr (cyclomatic 11, cognitive 10) · ×1
  • Complex function resolvePtr (cyclomatic 11, cognitive 10) dll/src/desktop/shell2/common/debugger/debugger.js:1856 — resolvePtr has cyclomatic complexity 11 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files · dll/src/desktop/shell2/common/debugger/debugger.js · ×1
  • dll/src/desktop/shell2/common/debugger/debugger.js: 4426 lines of code dll/src/desktop/shell2/common/debugger/debugger.js:1 — dll/src/desktop/shell2/common/debugger/debugger.js has 4426 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
SC1 · Supply-chain hygiene · JavaScript dependencies are not locked · ×1
  • JavaScript dependencies are not locked examples/node/package.json:14 — examples/node/package.json declares dependencies that no committed lockfile resolves — there is no package-lock.json / yarn.lock / pnpm-lock.yaml / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
Minor — 102 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×40
  • Duplicated predicate doc/src/codegen/v2/lang_c.rs:1106 — `!args.iter().any(is_aggregate) && !ret_is_aggregate` appears character-identically in 2 files — doc/src/codegen/v2/lang_c.rs, doc/src/codegen/v2/lang_zig/c_decls.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 layout/src/widgets/themes/flat.rs:593 — `!btn.icon.as_str().is_empty() || btn.icon_dom.is_some()` appears character-identically in 2 files — layout/src/widgets/themes/flat.rs, layout/src/widgets/themes/flora.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 doc/src/codegen/v2/lang_fortran/types.rs:448 — `!e.generic_params.is_empty() || e.category == TypeCategory::GenericTemplate` appears character-identically in 2 files — doc/src/codegen/v2/lang_fortran/types.rs, doc/src/codegen/v2/lang_pascal/types.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 doc/src/reftest/autodoc.rs:1152 — `!exit_status.success() && result_content.trim().is_empty()` appears character-identically in 2 files — doc/src/reftest/autodoc.rs, doc/src/reftest/autoreview.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 layout/src/widgets/camera.rs:1451 — `!finished() && std::time::Instant::now() < deadline` appears character-identically in 3 files — layout/src/widgets/camera.rs, layout/src/widgets/microphone.rs, layout/src/widgets/screencap.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 doc/src/autofix/discovery/parallel.rs:231 — `!first.is_ascii_uppercase() && first != '_'` appears character-identically in 3 files — doc/src/autofix/discovery/parallel.rs, doc/src/autofix/discovery/workspace.rs, doc/src/autofix/types/parser.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 layout/src/widgets/text_area.rs:1975 — `!node.root.get_style().is_empty() || !node.root.get_callbacks().as_ref().is_empty() || node.root.get_tab_index().is_some() || node.root.get_…` appears character-identically in 2 files — layout/src/widgets/text_area.rs, layout/src/widgets/text_input.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 doc/src/codegen/v2/lang_crystal/model.rs:494 — `!none.fields.is_empty() || some.fields.len() != 1` appears character-identically in 2 files — doc/src/codegen/v2/lang_crystal/model.rs, doc/src/codegen/v2/lang_d/model.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 dll/src/desktop/shell2/macos/mod.rs:6460 — `!previous.flags.has_focus && current.flags.has_focus` appears character-identically in 2 files — dll/src/desktop/shell2/macos/mod.rs, dll/src/desktop/shell2/windows/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate doc/src/codegen/v2/lang_fortran/types.rs:417 — `!s.generic_params.is_empty() || s.category == TypeCategory::GenericTemplate` appears character-identically in 2 files — doc/src/codegen/v2/lang_fortran/types.rs, doc/src/codegen/v2/lang_pascal/types.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 dll/src/desktop/shell2/linux/wayland/mod.rs:5392 — `!text.is_empty() && !text.chars().all(char::is_control)` appears character-identically in 2 files — dll/src/desktop/shell2/linux/wayland/mod.rs, dll/src/desktop/shell2/linux/x11/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate dll/src/desktop/shell2/linux/x11/mod.rs:6929 — `!want_redraw && !scroll_active && !scrollbar_fade && !virtual_view_pending` appears character-identically in 2 files — dll/src/desktop/shell2/linux/x11/mod.rs, dll/src/desktop/shell2/windows/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate doc/src/codegen/v2/lang_lisp/mod.rs:253 — `(prev_lower || prev_digit) && !out.is_empty() && !out.ends_with('-')` appears character-identically in 2 files — doc/src/codegen/v2/lang_lisp/mod.rs, doc/src/codegen/v2/lang_racket/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate doc/src/codegen/v2/lang_d/wrappers.rs:1786 — `a.ref_kind == ArgRefKind::Owned && m.ctx_getter(a.type_name.trim()).is_some()` appears character-identically in 2 files — doc/src/codegen/v2/lang_d/wrappers.rs, doc/src/codegen/v2/lang_swift/wrappers.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 dll/src/desktop/shell2/linux/wayland/mod.rs:3286 — `any_timer_fired || has_threads || theme_woke` appears character-identically in 2 files — dll/src/desktop/shell2/linux/wayland/mod.rs, dll/src/desktop/shell2/linux/x11/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate layout/src/widgets/text_area.rs:773 — `b <= current.len() && current.is_char_boundary(a) && current.is_char_boundary(b)` appears character-identically in 2 files — layout/src/widgets/text_area.rs, layout/src/widgets/text_input.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 layout/src/widgets/themes/flat.rs:632 — `btn.label.as_str().is_empty() && (has_icon || has_image || has_trailing_icon)` appears character-identically in 2 files — layout/src/widgets/themes/flat.rs, layout/src/widgets/themes/flora.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 doc/src/codegen/v2/lang_haskell/mod.rs:972 — `c.is_ascii_alphanumeric() || c == '_' || c == '\''` appears character-identically in 3 files — doc/src/codegen/v2/lang_haskell/mod.rs, doc/src/codegen/v2/lang_haskell/types.rs, doc/src/codegen/v2/lang_haskell/wrappers.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 doc/src/codegen/v2/lang_ocaml/mod.rs:1055 — `c.is_ascii_lowercase() || c.is_ascii_digit()` appears character-identically in 3 files — doc/src/codegen/v2/lang_ocaml/mod.rs, doc/src/codegen/v2/lang_perl/wrappers.rs, doc/src/codegen/v2/lang_ruby/functions.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 doc/src/codegen/v2/lang_d/model.rs:503 — `c.kind != Kind::Class || !c.traits.is_copy` appears character-identically in 2 files — doc/src/codegen/v2/lang_d/model.rs, doc/src/codegen/v2/lang_swift/model.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 css/src/props/basic/direction.rs:350 — `components.is_empty() || components.len() > 2` appears character-identically in 2 files — css/src/props/basic/direction.rs, css/src/props/style/transform.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 doc/src/codegen/v2/lang_crystal/wrappers.rs:690 — `copy || t(FunctionKind::DeepCopy).is_some()` appears character-identically in 2 files — doc/src/codegen/v2/lang_crystal/wrappers.rs, doc/src/codegen/v2/lang_swift/wrappers.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 doc/src/codegen/v2/lang_crystal/wrappers.rs:1089 — `data_first && cb_args.len() == 1 && refany_args.len() == 1` appears character-identically in 3 files — doc/src/codegen/v2/lang_crystal/wrappers.rs, doc/src/codegen/v2/lang_d/wrappers.rs, doc/src/codegen/v2/lang_swift/wrappers.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 layout/src/text3/cache.rs:7224 — `detail_cursor < self.details.len() && self.details[detail_cursor].cluster < ci` appears character-identically in 2 files — layout/src/text3/cache.rs, layout/src/text3/dense.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 webrender/core/src/renderer/init.rs:339 — `device.get_capabilities().supports_dual_source_blending && options.allow_dual_source_blending` appears character-identically in 2 files — webrender/core/src/renderer/init.rs, webrender/core/src/renderer/shade.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.
  • + 15 more in this group — see findings.md.
X7 · Silent fallback defaults · Silent fallback default on Err · ×37
  • Silent fallback default on Err core/src/json.rs:595 — `len` 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 core/src/json.rs:657 — `keys` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err core/src/prop_cache.rs:910 — `values_for` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err dll/src/desktop/extra/video_codec/videotoolbox.rs:1007 — `drain` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err dll/src/desktop/shader_cache.rs:69 — `load_all_from_disk` 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 dll/src/desktop/shell2/linux/x11/accessibility.rs:164 — `take_pending_actions` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err dll/src/desktop/shell2/windows/accessibility.rs:141 — `take_pending_actions` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err dll/src/desktop/extra/audio/avfoundation_mic.rs:276 — `mic_open` 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 dll/src/desktop/extra/hid/macos.rs:164 — `int_property` 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 dll/src/desktop/extra/hid/macos.rs:195 — `string_property` turns every `Err` into `String::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err dll/src/desktop/extra/pdf/mod.rs:436 — `pdf_to_svg_pages` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err dll/src/desktop/extra/pdf/mod.rs:568 — `dom_to_bytes` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err dll/src/desktop/extra/pdf/mod.rs:749 — `styled_dom_to_bytes_with` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err dll/src/desktop/extra/sqlite/mod.rs:133 — `free_bytes_at` 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 dll/src/desktop/extra/sqlite/mod.rs:994 — `value_u64` 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 dll/src/desktop/shell2/android/mod.rs:3452 — `jstring_to_string` turns every `Err` into `String::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err dll/src/desktop/shell2/linux/gnome_menu/actions_protocol.rs:60 — `drain_pending_menu_callbacks` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err dll/src/desktop/shell2/linux/wayland/clipboard.rs:61 — `native_copy_mimes` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err dll/src/desktop/shell2/windows/dnd.rs:93 — `extract_paths` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err dll/src/web/symbol_table.rs:3253 — `compute_hashbrown_empty_group_ranges` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err dll/src/web/transpiler_remill.rs:7295 — `engine_fingerprint` 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 dll/src/web/transpiler_remill.rs:7492 — `preflight_entries` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err doc/src/gene2e.rs:2178 — `png_paths` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err doc/src/assemble_context.rs:398 — `scan_markers` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err doc/src/autofix/discovery/parallel.rs:157 — `scan_file_for_types` turns every `Err` into `vec![]` — 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.
  • + 12 more in this group — see findings.md.
X9 · Subsumed condition operand · Subsumed condition operand · ×7
  • Subsumed condition operand doc/src/gene2e.rs:713 — `t.starts_with("///")` can never decide this `||` — every value satisfying `t.starts_with("///")` also satisfies `t.starts_with("//")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand doc/src/codegen/v2/ir_builder.rs:871 — `s.starts_with("&mut ")` can never decide this `||` — every value satisfying `s.starts_with("&mut ")` also satisfies `s.starts_with("&")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand doc/src/codegen/v2/lang_lua/cdef.rs:310 — `trimmed.starts_with("/* Macro to ")` can never decide this `||` — every value satisfying `trimmed.starts_with("/* Macro to ")` also satisfies `trimmed.starts_with("/* Macro ")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand dll/build_link.rs:311 — `dir_str.ends_with("/debug")` can never decide this `||` — every value satisfying `dir_str.ends_with("/debug")` also satisfies `dir_str.contains("/debug")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand dll/src/web/symbol_table.rs:2866 — `name.contains("spec_from_iter")` can never decide this `||` — every value satisfying `name.contains("spec_from_iter")` also satisfies `name.contains("from_iter")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand core/src/profile_test.rs:117 — `lower.contains("memory")` can never decide this `||` — every value satisfying `lower.contains("memory")` also satisfies `lower.contains("mem")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
  • Subsumed condition operand core/src/xml.rs:461 — `rel.contains("apple-touch-icon")` can never decide this `||` — every value satisfying `rel.contains("apple-touch-icon")` also satisfies `rel.contains("icon")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D24 · Comment Value · redundant comment · ×2
  • redundant comment dll/src/desktop/shell2/common/debugger/debugger.js:1981 — "Prompt for component name" repeats the code it sits on: 3 of its 3 words (prompt, component, name) are already in `var tagName = prompt('Component tag name (lowercase, e.g. "my-card"):');`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment dll/src/desktop/shell2/common/debugger/debugger.js:3265 — "Get current raw value from the app state JSON" repeats the code it sits on: 6 of its 7 words (get, raw, value, app, state, json) are already in `var rawValue = this._getValueAtPath(app.state.appStateJson, path);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
X7 · Silent fallback defaults · Silent fallback default in catch · ×2
  • Silent fallback default in catch scripts/debugging/azul-a11y-probe.py:48 — `role_name` swallows every exception into `return '?'` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch scripts/debugging/azul-a11y-probe.py:70 — `state_set` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
D30 · Dependency Vulnerabilities · Medium CVE · ×1
  • REDACTED
D31 · IaC & Container Security · Low IaC · ×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.
P10 · Library API & versioning · Implementation type on the public API · ×1
  • Implementation type on the public API webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:489 — 1 public type in `swgl_shaders.shaders.brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d` is marked as implementation by its own namespace, folder or name: `ProgramImpl` (webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:489, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 4/7 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `doc/aztest`, `layout`, `webrender/swgl`.
P3 · Security & performance tooling · No dependency-update automation · ×1
  • No dependency-update automation examples/node/package.json:14 — `examples/node/package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
P6 · Release Hygiene · No changelog · ×1
  • No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
X7 · Silent fallback defaults · Silent fallback default on parse failure · ×1
  • Silent fallback default on parse failure scripts/android/AzulAccessibilityBridge.java:270 — `parseInt` returns `0` when `NumberFormatException` is thrown, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. 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 in the catch or in the Javadoc, and the row stops firing.
Minor — 25 finding(s)
D12 · Dependency Hygiene · Outdated (compile) · ×24
  • Outdated (compile): org.jetbrains.kotlin:kotlin-stdlib — org.jetbrains.kotlin:kotlin-stdlib 2.3.21 → 2.4.21 available.
  • Outdated (compile): org.jetbrains:annotations — org.jetbrains:annotations 13.0 → 26.1.0 available.
  • Outdated (compile): net.java.dev.jna:jna — net.java.dev.jna:jna 5.14.0 → 5.19.1 available.
  • Outdated (compile): org.jetbrains.kotlin:kotlin-build-tools-compat — org.jetbrains.kotlin:kotlin-build-tools-compat 2.3.21 → 2.4.21 available.
  • Outdated (compile): org.jetbrains.kotlin:kotlin-tooling-core — org.jetbrains.kotlin:kotlin-tooling-core 2.3.21 → 2.4.21 available.
  • Outdated (compile): org.jetbrains.kotlin:kotlin-build-tools-api — org.jetbrains.kotlin:kotlin-build-tools-api 2.3.21 → 2.4.21 available.
  • Outdated (compile): org.jetbrains.kotlin:kotlin-build-tools-cri-impl — org.jetbrains.kotlin:kotlin-build-tools-cri-impl 2.3.21 → 2.4.21 available.
  • Outdated (compile): org.jetbrains.kotlin:kotlin-compiler-embeddable — org.jetbrains.kotlin:kotlin-compiler-embeddable 2.3.21 → 2.4.21 available.
  • Outdated (compile): org.jetbrains.kotlin:kotlin-script-runtime — org.jetbrains.kotlin:kotlin-script-runtime 2.3.21 → 2.4.21 available.
  • Outdated (compile): org.jetbrains.kotlin:kotlin-reflect — org.jetbrains.kotlin:kotlin-reflect 1.6.10 → 2.4.21 available.
  • Outdated (compile): org.jetbrains.kotlin:kotlin-daemon-embeddable — org.jetbrains.kotlin:kotlin-daemon-embeddable 2.3.21 → 2.4.21 available.
  • Outdated (compile): org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm — org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm 1.8.0 → 1.11.0 available.
  • Outdated (compile): org.jetbrains.kotlin:kotlin-compiler-runner — org.jetbrains.kotlin:kotlin-compiler-runner 2.3.21 → 2.4.21 available.
  • Outdated (compile): org.jetbrains.kotlin:kotlin-daemon-client — org.jetbrains.kotlin:kotlin-daemon-client 2.3.21 → 2.4.21 available.
  • Outdated (compile): org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable — org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable 2.3.21 → 2.4.21 available.
  • Outdated (compile): org.jetbrains.kotlin:kotlin-scripting-common — org.jetbrains.kotlin:kotlin-scripting-common 2.3.21 → 2.4.21 available.
  • Outdated (compile): org.jetbrains.kotlin:kotlin-scripting-jvm — org.jetbrains.kotlin:kotlin-scripting-jvm 2.3.21 → 2.4.21 available.
  • Outdated (compile): org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable — org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable 2.3.21 → 2.4.21 available.
  • Outdated (compile): org.jetbrains.kotlin:abi-tools — org.jetbrains.kotlin:abi-tools 2.3.21 → 2.4.21 available.
  • Outdated (compile): org.jetbrains.kotlin:abi-tools-api — org.jetbrains.kotlin:abi-tools-api 2.3.21 → 2.4.21 available.
  • Outdated (compile): org.jetbrains.kotlin:kotlin-metadata-jvm — org.jetbrains.kotlin:kotlin-metadata-jvm 2.3.21 → 2.4.21 available.
  • Outdated (compile): org.jetbrains.kotlin:kotlin-klib-abi-reader — org.jetbrains.kotlin:kotlin-klib-abi-reader 2.3.21 → 2.4.21 available.
  • Outdated (compile): io.github.java-diff-utils:java-diff-utils — io.github.java-diff-utils:java-diff-utils 4.12 → 4.18 available.
  • Outdated (compile): org.jetbrains.kotlin:kotlin-klib-commonizer-embeddable — org.jetbrains.kotlin:kotlin-klib-commonizer-embeddable 2.3.21 → 2.4.21 available.
D12 · Dependency Hygiene · Dependency hygiene PARTLY measured · ×1
  • Dependency hygiene PARTLY measured — Go module pinning and checksums read, no direct requirement to grade for currency — This repository's Go modules were read for PINNING discipline and checksum coverage: 2 requirement(s) across 1 go.mod (1 of them direct, the rest marked `// indirect`), against 1 module(s) recorded in the committed go.sum files. No pinning or checksum defect was found. That is only PART of dependency hygiene, so this dimension is NOT SCORED: whether any of these modules has a newer release, or has been deprecated by its author, is the dependency-CURRENCY question, and answering it needs the Go module proxy — and this repository has no direct Go requirement the proxy could grade. A clean pinning pass is NOT an all-clear for these dependencies, and it is not a finding that they are all USED. Known CVEs in the same module graph are a separate question again, reported under D30 wherever go.mod/go.sum is OSV-readable.

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-a36b61d0c1b6430693e1b051c039d42d/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-a36b61d0c1b6430693e1b051c039d42d/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/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 .32artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .37artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .16artifacts/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—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .0artifacts/raw/trivy-fs.json

Run 01a1db46-d457-7dcf-8556-12099e322224 · 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