Public report of tracel-ai/burn, 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, 15:37 UTC · Survey ID cd_08bbb5eb8a854da5858cb2b53fe3e13b

tracel-ai/burn

Measured 14 November 2026, 15:31 UTC, at code version ce8babc

Test reliability is not measured: The suite could not be re-run, but the repository declares tests of its own unreliable.

CAI score 62out of 100 At risk Down 3 since the last survey

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

A large codebase: 336,364 lines of product code in 40 projects, tests not counted · Estimated rebuild effort: about 3.3 person-years · Weakest lens: Security and Compliance, 53

Findings by how serious they are

97 critical 1559 serious 87 minor

14 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, 15:31 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 ▸

50of 50 dimensions measured by tools.
1691of 1743 findings point to an exact file and line, so you can open each one in the code. The other 52 concern the repository as a whole, such as missing documentation.
50dimensions across 7 lenses, read from 336,364 lines of product code in 40 projects.
Chapters

Executive summary

tracel-ai/burn is rated At risk because critical security findings are open, most of them in the build pipeline. It scores 62 out of 100, which the At risk rating leaves unchanged. We judged it as a preview release, against a lower bar.

Security and Compliance, at 53, is the weakest lens and counts most in the score. The best first step is recording design decisions, worth about 4 points. Restricting the build's access tokens comes next, worth about 3 points. Raising Security and Compliance to 68 would lift the score to about 67.

Eighty-nine pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. One automatic update takes new releases before a bad one can be spotted, and three parts of the code are no longer understood by anyone working on it. Pinning each tool to an exact version, setting a waiting period for automatic updates and having someone learn the forgotten files would close these risks. Updating the vulnerable packages would fix the package with a known security hole, and limiting each secret to its own step would deal with the secret exposed to more of the pipeline than needed. The two tests the project itself marks as unreliable need fixing or deleting.

The product code is 336,364 lines, about €490,000 to rebuild.

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

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

If Security and Compliance rose from 53 to 68, the lowest score rated Strong, the score would rise from 62 to about 67.

Code composition: what the lines of code are
Product code 77%Tests 23%
New since the last survey: 659 findings

These 659 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.

  • Cyclomatic Complexity · TensorInterpreter::execute_op (cyclomatic 340) crates/burn-router/src/interpreter.rs
  • Cyclomatic Complexity · burn_linalg::solve_cubecl::blocked_rhs (cyclomatic 46) crates/burn-linalg/src/solve_cubecl.rs
  • Cyclomatic Complexity · SessionHandler::process_task (cyclomatic 45) crates/burn-remote/src/server/worker.rs
  • Cyclomatic Complexity · burn_linalg::solve_cubecl::factor_panel (cyclomatic 36) crates/burn-linalg/src/solve_cubecl.rs
  • Cyclomatic Complexity · burn_linalg::solve_cubecl::factor_panel_shared (cyclomatic 28) crates/burn-linalg/src/solve_cubecl.rs
  • Cyclomatic Complexity · burn_linalg::functions::solve::solve_impl (cyclomatic 19) crates/burn-linalg/src/functions/solve.rs
  • Cyclomatic Complexity · burn_linalg::solve_cubecl::solve_rhs_shared (cyclomatic 17) crates/burn-linalg/src/solve_cubecl.rs
  • Cyclomatic Complexity · LazyMethod::new (cyclomatic 16) crates/burn-backend-extension/src/parse.rs
  • Cyclomatic Complexity · burn_flex::ops::attention::naive_attention_head (cyclomatic 16) crates/burn-flex/src/ops/attention.rs
  • Cyclomatic Complexity · burn_linalg::solve_cubecl::swap_and_solve_upper (cyclomatic 16) crates/burn-linalg/src/solve_cubecl.rs
  • Cognitive Complexity · burn_linalg::solve_cubecl::blocked_rhs (cognitive 138) crates/burn-linalg/src/solve_cubecl.rs
  • Cognitive Complexity · burn_linalg::solve_cubecl::factor_panel (cognitive 89) crates/burn-linalg/src/solve_cubecl.rs
  • Cognitive Complexity · burn_linalg::solve_cubecl::factor_panel_shared (cognitive 69) crates/burn-linalg/src/solve_cubecl.rs
  • Cognitive Complexity · burn_linalg::solve_cubecl::solve_rhs_shared (cognitive 30) crates/burn-linalg/src/solve_cubecl.rs
  • Cognitive Complexity · burn_linalg::solve_cubecl::solve_impl (cognitive 30) crates/burn-linalg/src/solve_cubecl.rs
  • Cognitive Complexity · burn_linalg::functions::solve::solve_impl (cognitive 29) crates/burn-linalg/src/functions/solve.rs
  • Cognitive Complexity · burn_linalg::solve_cubecl::swap_and_solve_upper (cognitive 29) crates/burn-linalg/src/solve_cubecl.rs
  • Cognitive Complexity · TensorInterpreter::execute_op (cognitive 29) crates/burn-router/src/interpreter.rs
  • Cognitive Complexity · ConfigAnalyzerFactory::create_struct_analyzer (cognitive 25) crates/burn-derive/src/config/analyzer.rs
  • Cognitive Complexity · burn_linalg::solve_cubecl::reduce_pivot (cognitive 25) crates/burn-linalg/src/solve_cubecl.rs
  • Cognitive Complexity · burn_backend_extension::fusion::derive_adapter (cognitive 23) crates/burn-backend-extension/src/fusion.rs
  • Cognitive Complexity · burn_linalg::solve_host::substitute (cognitive 22) crates/burn-linalg/src/solve_host.rs
  • Cognitive Complexity · burn_vision::backends::cpu::median::base::select_windows (cognitive 21) crates/burn-vision/src/backends/cpu/median/base.rs
  • Cognitive Complexity · LazyMethod::new (cognitive 18) crates/burn-backend-extension/src/parse.rs
  • Cognitive Complexity · FusionBehavior::new (cognitive 18) crates/burn-backend-extension/src/parse.rs
  • Cognitive Complexity · burn_linalg::solve_host::factor (cognitive 18) crates/burn-linalg/src/solve_host.rs
  • Cognitive Complexity · SessionHandler::process_task (cognitive 18) crates/burn-remote/src/server/worker.rs
  • Cognitive Complexity · burn_linalg::solve_host::factor_panel (cognitive 17) crates/burn-linalg/src/solve_host.rs
  • Cognitive Complexity · SupervisedTraining::launch (cognitive 17) crates/burn-train/src/learner/supervised/paradigm.rs
  • Cognitive Complexity · burn_flex::ops::interpolate::interpolate_lanczos3_impl (cognitive 16) crates/burn-flex/src/ops/interpolate.rs
  • God Classes · MethodTooLong: TensorInterpreter.execute_op crates/burn-router/src/interpreter.rs
  • God Classes · FileTooLong: src/solve_cubecl.rs crates/burn-linalg/src/solve_cubecl.rs
  • God Classes · TooManyMethods: TensorInterpreter crates/burn-router/src/interpreter.rs
  • God Classes · FileTooLong: client/service.rs crates/burn-remote/src/client/service.rs
  • God Classes · FunctionTooLong: burn_linalg::solve_cubecl::blocked_rhs crates/burn-linalg/src/solve_cubecl.rs
  • God Classes · ClassTooLong: SessionHandler crates/burn-remote/src/server/worker.rs
  • God Classes · FunctionTooLong: burn_cubecl::kernel::conv::backward_data::tune::dgrad_autotune crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs
  • God Classes · FunctionTooLong: burn_cubecl::kernel::conv::backward_weight::tune::wgrad_autotune crates/burn-cubecl/src/kernel/conv/backward_weight/tune.rs
  • God Classes · FileTooLong: conv/im2col.rs crates/burn-cubecl/src/kernel/conv/im2col.rs
  • God Classes · FunctionTooLong: burn_linalg::solve_cubecl::solve crates/burn-linalg/src/solve_cubecl.rs
  • God Classes · FunctionTooLong: burn_cubecl::kernel::conv::forward::tune::conv_autotune crates/burn-cubecl/src/kernel/conv/forward/tune.rs
  • God Classes · FunctionTooLong: burn_linalg::solve_cubecl::factor_panel crates/burn-linalg/src/solve_cubecl.rs
  • God Classes · TooManyMethods: HandleContainer crates/burn-ir/src/handle.rs
  • God Classes · FunctionTooLong: burn_flex::ops::pool::avg_pool3d_backward_impl crates/burn-flex/src/ops/pool.rs
  • God Classes · FileTooLong: ops/collective.rs crates/burn-cubecl/src/ops/collective.rs
  • God Classes · FileTooLong: server/worker.rs crates/burn-remote/src/server/worker.rs
  • God Classes · MethodTooLong: FusionMethod.implementation crates/burn-backend-extension/src/fusion.rs
  • God Classes · TooManyMethods: CubeTensor crates/burn-cubecl/src/tensor/base.rs
  • God Classes · FunctionTooLong: burn_linalg::solve_cubecl::factor_panel_shared crates/burn-linalg/src/solve_cubecl.rs
  • Code Duplication · Near-duplicate member family (4 members, 18 shared lines) crates/burn-autodiff/src/ops/tensor.rs
  • Code Duplication · Near-duplicate member family (3 members, 34 shared lines) crates/burn-cubecl/src/kernel/binary.rs
  • Code Duplication · Near-duplicate member family (3 members, 29 shared lines) crates/burn-flex/src/ops/interpolate.rs
  • Code Duplication · Near-duplicate member pair (119 shared lines) crates/burn-flex/src/ops/attention.rs
  • Code Duplication · Near-duplicate member pair (94 shared lines) crates/burn-flex/src/ops/fft.rs
  • Code Duplication · Near-duplicate member pair (64 shared lines) crates/burn-flex/src/ops/attention.rs
  • Code Duplication · Near-duplicate member pair (59 shared lines) crates/burn-flex/src/ops/pool.rs
  • Code Duplication · Near-duplicate member pair (47 shared lines) crates/burn-flex/src/ops/interpolate.rs
  • Code Duplication · Near-duplicate member pair (45 shared lines) crates/burn-cubecl/src/kernel/unary_float.rs
  • Code Duplication · Edited copy of a member (22 corresponding lines) crates/burn-flex/src/simd/portable.rs
  • Code Duplication · Members sharing a duplicated core (14 members, 50+ identical tokens) crates/burn-autodiff/src/ops/tensor.rs
  • Code Duplication · Members sharing a duplicated core (12 members, 50+ identical tokens) crates/burn-autodiff/src/ops/module.rs
  • Code Duplication · Members sharing a duplicated core (10 members, 50+ identical tokens) crates/burn-autodiff/src/ops/module.rs
  • Code Duplication · Members sharing a duplicated core (8 members, 50+ identical tokens) crates/burn-flex/src/ops/interpolate.rs
  • Code Duplication · Members sharing a duplicated core (8 members, 50+ identical tokens) crates/burn-flex/src/simd/kernels.rs
  • Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) crates/burn-autodiff/src/ops/module.rs
  • Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) crates/burn-flex/src/ops/pool.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) crates/burn-autodiff/src/ops/tensor.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) crates/burn-autodiff/src/ops/tensor.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) crates/burn-flex/src/ops/pool.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) crates/burn-flex/src/simd/portable.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) crates/burn-fusion/src/client.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) crates/burn-train/src/metric/bleu.rs
  • Code Duplication · Edited copy of a member (296 corresponding lines) crates/burn-autodiff/src/ops/tensor.rs
  • Code Duplication · Edited copy of a member (60 corresponding lines) crates/burn-ir/src/operation.rs
  • Code Duplication · Edited copy of a member (154 corresponding lines) crates/burn-flex/src/ops/int.rs
  • Code Duplication · Edited copy of a member (143 corresponding lines) crates/burn-ir/src/operation.rs
  • Code Duplication · Edited copy of a member (41 corresponding lines) crates/burn-ir/src/operation.rs
  • Code Duplication · Edited copy of a member (110 corresponding lines) crates/burn-ir/src/operation.rs
  • Code Duplication · Edited copy of a member (79 corresponding lines) crates/burn-flex/src/ops/float.rs
  • Code Duplication · Edited copy of a member (34 corresponding lines) crates/burn-ir/src/operation.rs
  • Code Duplication · Edited copy of a member (99 corresponding lines) crates/burn-cubecl/src/kernel/conv/conv_transpose2d/col2im.rs
  • Code Duplication · Edited copy of a member (57 corresponding lines) crates/burn-vision/src/backends/cpu/morphology/filter.rs
  • Code Duplication · Edited copy of a member (79 corresponding lines) crates/burn-fusion/src/stream/context.rs
  • Code Duplication · Edited copies of one member (6 members, 44+ corresponding lines) crates/burn-flex/src/ops/reduce.rs
  • Code Duplication · Edited copy of a member (70 corresponding lines) crates/burn-nn/src/modules/transformer/decoder.rs
  • Code Duplication · Edited copy of a member (67 corresponding lines) crates/burn-ir/src/operation.rs
  • Code Duplication · Edited copy of a member (48 corresponding lines) crates/burn-flex/src/simd/portable.rs
  • Code Duplication · Edited copy of a member (66 corresponding lines) crates/burn-autodiff/src/ops/tensor.rs
  • Code Duplication · Edited copy of a member (66 corresponding lines) crates/burn-flex/src/ops/sort.rs
  • Code Duplication · Edited copy of a member (58 corresponding lines) crates/burn-cubecl/src/kernel/conv/conv_transpose2d/col2im.rs
  • Code Duplication · Edited copy of a member (31 corresponding lines) crates/burn-flex/src/ops/reduce.rs
  • Code Duplication · Edited copy of a member (51 corresponding lines) crates/burn-train/src/metric/processor/minimal.rs
  • Code Duplication · Edited copy of a member (46 corresponding lines) crates/burn-flex/src/ops/module.rs
  • Code Duplication · Edited copy of a member (60 corresponding lines) crates/burn-flex/src/zip.rs
  • Code Duplication · Edited copy of a member (9 corresponding lines) crates/burn-ir/src/operation.rs
  • Code Duplication · Edited copy of a member (66 corresponding lines) crates/burn-train/src/learner/supervised/strategies/multi/strategy.rs
  • Code Duplication · Edited copy of a member (37 corresponding lines) crates/burn-flex/src/ops/fft.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: 230 findings

These 230 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 · TensorInterpreter::register_op (cyclomatic 338) crates/burn-router/src/interpreter.rs
  • Cyclomatic Complexity · burn_backend_extension::fusion::expand_method (cyclomatic 51) crates/burn-backend-extension/src/fusion.rs
  • Cyclomatic Complexity · burn_cubecl::kernel::matmul::tune::base::matmul_autotune (cyclomatic 39) crates/burn-cubecl/src/kernel/matmul/tune/base.rs
  • Cyclomatic Complexity · FusedMatmulLaunch::matmul_fused (cyclomatic 32) crates/burn-cubecl-fusion/src/optim/matmul/optimization.rs
  • Cyclomatic Complexity · burn_cubecl_fusion::optim::matmul::tune::fused_matmul_autotune (cyclomatic 29) crates/burn-cubecl-fusion/src/optim/matmul/tune.rs
  • Cyclomatic Complexity · burn_cubecl::kernel::pool::avg_pool3d::avg_pool3d_backward_kernel (cyclomatic 20) crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs
  • Cognitive Complexity · burn_backend_extension::fusion::expand_method (cognitive 88) crates/burn-backend-extension/src/fusion.rs
  • Cognitive Complexity · burn_cubecl::kernel::matmul::tune::base::matmul_autotune (cognitive 58) crates/burn-cubecl/src/kernel/matmul/tune/base.rs
  • Cognitive Complexity · burn_cubecl_fusion::optim::matmul::tune::fused_matmul_autotune (cognitive 48) crates/burn-cubecl-fusion/src/optim/matmul/tune.rs
  • Cognitive Complexity · FusedMatmulLaunch::matmul_fused (cognitive 35) crates/burn-cubecl-fusion/src/optim/matmul/optimization.rs
  • Cognitive Complexity · TensorInterpreter::register_op (cognitive 30) crates/burn-router/src/interpreter.rs
  • Cognitive Complexity · burn_cubecl::ops::base::expand (cognitive 22) crates/burn-cubecl/src/ops/base.rs
  • Cognitive Complexity · FusedMatmulLaunch::axis (cognitive 19) crates/burn-cubecl-fusion/src/optim/matmul/optimization.rs
  • God Classes · MethodTooLong: TensorInterpreter.register_op crates/burn-router/src/interpreter.rs
  • God Classes · FunctionTooLong: burn_cubecl::kernel::matmul::tune::base::matmul_autotune crates/burn-cubecl/src/kernel/matmul/tune/base.rs
  • God Classes · FunctionTooLong: burn_backend_extension::fusion::expand_method crates/burn-backend-extension/src/fusion.rs
  • God Classes · MethodTooLong: FusedMatmulLaunch.matmul_fused crates/burn-cubecl-fusion/src/optim/matmul/optimization.rs
  • God Classes · FunctionTooLong: burn_cubecl_fusion::optim::matmul::tune::fused_matmul_autotune crates/burn-cubecl-fusion/src/optim/matmul/tune.rs
  • God Classes · FileTooLong: src/fusion.rs crates/burn-backend-extension/src/fusion.rs
  • God Classes · FileTooLong: matmul/optimization.rs crates/burn-cubecl-fusion/src/optim/matmul/optimization.rs
  • Code Duplication · Near-duplicate member pair (115 shared lines) crates/burn-flex/src/ops/attention.rs
  • Code Duplication · Near-duplicate member pair (89 shared lines) crates/burn-flex/src/ops/fft.rs
  • Code Duplication · Near-duplicate member pair (55 shared lines) crates/burn-flex/src/ops/attention.rs
  • Code Duplication · Near-duplicate member pair (32 shared lines) crates/burn-flex/src/ops/pool.rs
  • Code Duplication · Edited copy of a member (21 corresponding lines) crates/burn-train/src/metric/vision/lpips/metric.rs
  • Code Duplication · Edited copy of a member (22 corresponding lines) crates/burn-flex/src/simd/portable.rs
  • Code Duplication · Members sharing a duplicated core (14 members, 50+ identical tokens) crates/burn-autodiff/src/ops/tensor.rs
  • Code Duplication · Members sharing a duplicated core (12 members, 50+ identical tokens) crates/burn-autodiff/src/ops/module.rs
  • Code Duplication · Members sharing a duplicated core (9 members, 50+ identical tokens) crates/burn-autodiff/src/ops/module.rs
  • Code Duplication · Members sharing a duplicated core (8 members, 50+ identical tokens) crates/burn-flex/src/ops/interpolate.rs
  • Code Duplication · Members sharing a duplicated core (8 members, 50+ identical tokens) crates/burn-flex/src/simd/kernels.rs
  • Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) crates/burn-flex/src/ops/interpolate.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) crates/burn-autodiff/src/ops/module.rs
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) crates/burn-autodiff/src/ops/tensor.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) crates/burn-autodiff/src/ops/tensor.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) crates/burn-flex/src/ops/pool.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) crates/burn-flex/src/simd/portable.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) crates/burn-fusion/src/client.rs
  • Code Duplication · Duplicated block (37–38 lines × 2) crates/burn-flex/src/ops/attention.rs
  • Code Duplication · Duplicated block (31–32 lines × 2) crates/burn-train/src/learner/supervised/strategies/ddp/epoch.rs
  • Code Duplication · Duplicated block (29 lines × 2) crates/burn-flex/src/ops/attention.rs
  • Code Duplication · Duplicated block (27–28 lines × 2) crates/burn-cubecl/src/kernel/index/gather_nd.rs
  • Code Duplication · Duplicated block (23 lines × 2) crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs
  • Code Duplication · Duplicated block (20–21 lines × 2) crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs
  • Code Duplication · Duplicated block (20 lines × 2) crates/burn-cubecl-fusion/src/engine/trace/block.rs
  • Code Duplication · Duplicated block (19 lines × 2) crates/burn-flex/src/ops/interpolate.rs
  • Code Duplication · Duplicated block (18 lines × 2) crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs
  • Code Duplication · Duplicated block (17–18 lines × 2) crates/burn-flex/src/ops/cumulative.rs
  • Code Duplication · Duplicated block (15–18 lines × 2) crates/burn-train/src/metric/cer.rs
  • Code Duplication · Duplicated block (16–17 lines × 2) crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs
  • Code Duplication · Duplicated block (16 lines × 6) crates/burn-autodiff/src/ops/module.rs
  • Code Duplication · Duplicated block (16 lines × 6) crates/burn-cubecl-fusion/src/optim/matmul/optimization.rs
  • Code Duplication · Duplicated block (15–16 lines × 4) crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs
  • Code Duplication · Duplicated block (16 lines × 3) crates/burn-cubecl-fusion/src/optim/matmul/optimization.rs
  • Code Duplication · Duplicated block (16 lines × 3) crates/burn-cubecl/src/kernel/pool/base.rs
  • Code Duplication · Duplicated block (16 lines × 2) crates/burn-cubecl-fusion/src/engine/codegen/io.rs
  • Code Duplication · Duplicated block (16 lines × 2) crates/burn-cubecl-fusion/src/engine/fuser.rs
  • Code Duplication · Duplicated block (16 lines × 2) crates/burn-cubecl-fusion/src/optim/matmul/tune.rs
  • Code Duplication · Duplicated block (16 lines × 2) crates/burn-cubecl/src/kernel/binary.rs
  • Code Duplication · Duplicated block (15–16 lines × 2) crates/burn-cubecl/src/kernel/matmul/base.rs
  • Code Duplication · Duplicated block (16 lines × 2) crates/burn-cubecl/src/kernel/pool/max_pool3d.rs
  • Code Duplication · Duplicated block (16 lines × 2) crates/burn-flex/src/simd/kernels.rs
  • Code Duplication · Duplicated block (15–16 lines × 2) crates/burn-train/src/learner/rl/paradigm.rs
  • Code Duplication · Duplicated block (15 lines × 6) crates/burn-autodiff/src/ops/module.rs
  • Code Duplication · Duplicated block (14–15 lines × 4) crates/burn-backend/src/backend/ops/modules/conv.rs
  • Code Duplication · Duplicated block (15 lines × 3) crates/burn-autodiff/src/ops/module.rs
  • Code Duplication · Duplicated block (15 lines × 3) crates/burn-autodiff/src/ops/module.rs
  • Code Duplication · Duplicated block (15 lines × 3) crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs
  • Code Duplication · Duplicated block (14–15 lines × 2) crates/burn-autodiff/src/ops/module.rs
  • Code Duplication · Duplicated block (14–15 lines × 2) crates/burn-autodiff/src/ops/module.rs
  • Code Duplication · Duplicated block (12–15 lines × 2) crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs
  • Code Duplication · Duplicated block (14 lines × 5) crates/burn-flex/src/ops/interpolate.rs
  • Code Duplication · Duplicated block (14 lines × 3) crates/burn-flex/src/ops/reduce.rs
  • Code Duplication · Duplicated block (14 lines × 2) crates/burn-autodiff/src/ops/module.rs
  • Code Duplication · Duplicated block (14 lines × 2) crates/burn-cubecl/src/kernel/pool/base.rs
  • Code Duplication · Duplicated block (13 lines × 7) crates/burn-flex/src/ops/interpolate.rs
  • Code Duplication · Duplicated block (12–13 lines × 5) crates/burn-backend/src/backend/ops/modules/conv.rs
  • Code Duplication · Duplicated block (13 lines × 3) crates/burn-autodiff/src/ops/module.rs
  • Code Duplication · Duplicated block (13 lines × 3) crates/burn-nn/src/modules/conv/conv2d.rs
  • Code Duplication · Duplicated block (13 lines × 2) crates/burn-autodiff/src/ops/module.rs
  • Code Duplication · Duplicated block (12 lines × 3) crates/burn-autodiff/src/ops/tensor.rs
  • Code Duplication · Duplicated block (12 lines × 3) crates/burn-flex/src/ops/gather_scatter.rs
  • Code Duplication · Duplicated block (12 lines × 3) crates/burn-tensor/src/tensor/module.rs
  • Code Duplication · Duplicated block (11–12 lines × 2) crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs
  • Code Duplication · Duplicated block (12 lines × 2) crates/burn-cubecl/src/kernel/conv/forward/depthwise.rs
  • Code Duplication · Duplicated block (12 lines × 2) crates/burn-flex/src/ops/pool.rs
  • Code Duplication · Duplicated block (12 lines × 2) crates/burn-nn/src/modules/rnn/basic.rs
  • Code Duplication · Duplicated block (12 lines × 2) crates/burn-train/src/metric/processor/full.rs
  • Code Duplication · Duplicated block (11 lines × 4) crates/burn-autodiff/src/ops/tensor.rs
  • Code Duplication · Duplicated block (10–11 lines × 3) crates/burn-flex/src/simd/portable.rs
  • Code Duplication · Duplicated block (11 lines × 2) crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs
  • Code Duplication · Duplicated block (11 lines × 2) crates/burn-cubecl/src/kernel/comparison.rs
  • Code Duplication · Duplicated block (11 lines × 2) crates/burn-cubecl/src/kernel/conv/backward_weight/tune.rs
  • Code Duplication · Duplicated block (10–11 lines × 2) crates/burn-flex/src/ops/conv.rs
  • Code Duplication · Duplicated block (9–11 lines × 2) crates/burn-flex/src/ops/fft.rs
  • Code Duplication · Duplicated block (11 lines × 2) crates/burn-ir/src/builder.rs
  • Code Duplication · Duplicated block (10–11 lines × 2) crates/burn-train/src/learner/supervised/strategies/ddp/epoch.rs
  • Code Duplication · Duplicated block (9–10 lines × 7) crates/burn-autodiff/src/ops/module.rs
Rebuild cost: about €490,000 · Estimate
Cost to rebuild€160,000 to €810,000, for 2,691 to 8,538 hours of work, about 3.3 person-years for 1 to 7 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.9 at a score of 62. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeLarge: 336,364 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

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

Top priorities

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

1
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with main.rs.
Raises the score by about 4 points · Low effort · ADR Quality
2
Resolve the 4 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED.
Raises the score by about 3 points · Low effort · Supply-chain Provenance & Signing
3
Secure the server's transport: serve TLS itself (`HttpServer::bind_rustls_0_23(addr, config)` in actix-web, `axum_server::bind_rustls(addr, RustlsConfig::from_pem_file(…))`, tonic's `Server::builder().tls_config(ServerTlsConfig::new().identity(…))`, Rocket's `[default.tls]`), or run it behind a TLS-terminating proxy and check `X-Forwarded-Proto`; send `Strict-Transport-Security` once it is HTTPS-only.
Raises the score by about 5 points · Medium effort · Web-Security Posture

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 €490,000 to build again, about 3.3 person-years of work. Its weakest lens is Security and Compliance, at 53 (Adequate). Security and Compliance is about how well the product is protected, and how it handles personal data. Because the weakest lens counts most in the score, work on Security and Compliance also moves the score most.
Based on: the rebuild estimate · the Security and Compliance grade · how much each lens counts
What to do: Start with the Security and Compliance actions in Top priorities.
If you do one thing first · First action
Resolve the 1 No ADRs found finding(s) in ADR Quality. Of all the actions in this report, it raises the score most for the work it takes: about 4 points for low effort, because it clears the 1 ADR Quality findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.7 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 3% to 7% on every change. The history of the code shows how much it changes: about 266,939 lines over the last 90 days, which is about 1,082,586 lines a year. At that pace, the extra work comes to an estimated 86.7 to 520.3 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture — module dependency graph

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

arch burn burn burn-core burn-core burn->burn-core burn-linalg burn-linalg burn->burn-linalg burn-signal burn-signal burn->burn-signal burn-std burn-std burn->burn-std burn-store burn-store burn->burn-store burn-train burn-train burn->burn-train burn-vision burn-vision burn->burn-vision burn-autodiff burn-autodiff burn-backend burn-backend burn-autodiff->burn-backend burn-autodiff->burn-std burn-backend->burn-std burn-capture burn-capture burn-capture->burn-backend burn-ir burn-ir burn-capture->burn-ir burn-router burn-router burn-capture->burn-router burn-capture->burn-std burn-core->burn-backend burn-cubecl burn-cubecl burn-core->burn-cubecl burn-dispatch burn-dispatch burn-core->burn-dispatch burn-fusion burn-fusion burn-core->burn-fusion burn-instrument burn-instrument burn-core->burn-instrument burn-core->burn-ir burn-core->burn-std burn-tensor burn-tensor burn-core->burn-tensor burn-cubecl->burn-backend burn-cubecl->burn-fusion burn-cubecl->burn-ir burn-cubecl->burn-std burn-dispatch->burn-autodiff burn-dispatch->burn-backend burn-dispatch->burn-capture burn-dispatch->burn-cubecl burn-flex burn-flex burn-dispatch->burn-flex burn-dispatch->burn-ir burn-remote burn-remote burn-dispatch->burn-remote burn-dispatch->burn-router burn-flex->burn-backend burn-flex->burn-ir burn-flex->burn-std burn-fusion->burn-backend burn-fusion->burn-ir burn-fusion->burn-std burn-instrument->burn-fusion burn-instrument->burn-ir burn-instrument->burn-tensor burn-ir->burn-backend burn-ir->burn-std burn-linalg->burn-autodiff burn-linalg->burn-core burn-linalg->burn-cubecl burn-linalg->burn-fusion burn-linalg->burn-router burn-linalg->burn-std burn-remote->burn-backend burn-remote->burn-fusion burn-remote->burn-ir burn-remote->burn-router burn-remote->burn-std burn-router->burn-backend burn-router->burn-fusion burn-router->burn-ir burn-router->burn-std burn-signal->burn-autodiff burn-signal->burn-core burn-signal->burn-cubecl burn-signal->burn-flex burn-signal->burn-fusion burn-signal->burn-remote burn-signal->burn-router burn-signal->burn-std burn-store->burn-core burn-tensor->burn-backend burn-tensor->burn-capture burn-tensor->burn-dispatch burn-tensor->burn-std burn-train->burn-core burn-train->burn-flex burn-train->burn-linalg burn-train->burn-std burn-train->burn-store burn-vision->burn-core burn-vision->burn-cubecl burn-vision->burn-fusion burn-vision->burn-std burn-vision->burn-store __more__ +19 more projects

Architecture: which parts of the code depend on which

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

968 modules, with 2742 dependencies between them. 28 loops run through 88 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 928 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 burn_autodiff.grads2 burn_core.module.display3 burn_std.distributed4 burn_std.ops5 burn_std.tensor.dtype6 burn_train.metric.base7 burn_cubecl_fusion.engine.codegen.ir8 burn_ir.tensor9 burn_pack.tensor10 burn_std.data.tensor.base11 burn_std.device_settings12 burn_std.element.scalar13 burn_backend.backend.base14 burn_cubecl_fusion.engine.trace.base15 burn_flex.tensor16 burn_ir.operation17 burn_remote.shared.task18 burn_tensor.device19 burn_train.metric.state20 burn_autodiff.backend21 burn_dispatch.backend22 burn_ir.backend23 burn_nn.activation.activation_wrapper24 burn_remote.client.service25 burn_tensor.bridge.kind26 burn_ir.handle27 burn_tensor.tensor.api.base28 burn_core.module.param.base29 burn_cubecl.tensor.base30 burn_flex.backend31 burn_fusion.stream.context32 burn_instrument.bounds33 burn_router.interpreter34 burn_core.module.base35 burn_fusion.backend36 burn_nn.initializer37 burn_cubecl.backend38 burn_optim.optim.module.module_optimizer39 burn_router.backend40 burn_train.learner.base
1 burn_autodiff.grads
2 burn_core.module.display
3 burn_std.distributed
4 burn_std.ops
5 burn_std.tensor.dtype
6 burn_train.metric.base
7 burn_cubecl_fusion.engine.codegen.ir1
8 burn_ir.tensor1
9 burn_pack.tensor1
10 burn_std.data.tensor.base3
11 burn_std.device_settings3
12 burn_std.element.scalar1
13 burn_backend.backend.base11
14 burn_cubecl_fusion.engine.trace.base24
15 burn_flex.tensor21
16 burn_ir.operation1912112
17 burn_remote.shared.task121
18 burn_tensor.device21
19 burn_train.metric.state62
20 burn_autodiff.backend1263113
21 burn_dispatch.backend1293113
22 burn_ir.backend11
23 burn_nn.activation.activation_wrapper11
24 burn_remote.client.service121119
25 burn_tensor.bridge.kind2543133
26 burn_ir.handle3121
27 burn_tensor.tensor.api.base3111223
28 burn_core.module.param.base3411
29 burn_cubecl.tensor.base11
30 burn_flex.backend731112121
31 burn_fusion.stream.context2
32 burn_instrument.bounds1
33 burn_router.interpreter1311114
34 burn_core.module.base212
35 burn_fusion.backend184111121331
36 burn_nn.initializer221
37 burn_cubecl.backend174112211
38 burn_optim.optim.module.module_optimizer11
39 burn_router.backend193112211
40 burn_train.learner.base11
Uses a module listed above itPart of a loopThe module itself
1 burn_autodiff.grads2 burn_core.module.display3 burn_std.distributed4 burn_std.ops5 burn_std.tensor.dtype6 burn_train.metric.base7 burn_cubecl_fusion.engine.codegen.ir8 burn_ir.tensor9 burn_pack.tensor10 burn_std.data.tensor.base11 burn_std.device_settings12 burn_std.element.scalar13 burn_backend.backend.base14 burn_cubecl_fusion.engine.trace.base15 burn_flex.tensor16 burn_ir.operation17 burn_remote.shared.task18 burn_tensor.device19 burn_train.metric.state20 burn_autodiff.backend21 burn_dispatch.backend22 burn_ir.backend23 burn_nn.activation.activation_wrapper24 burn_remote.client.service25 burn_tensor.bridge.kind26 burn_ir.handle27 burn_tensor.tensor.api.base28 burn_core.module.param.base29 burn_cubecl.tensor.base30 burn_flex.backend31 burn_fusion.stream.context32 burn_instrument.bounds33 burn_router.interpreter34 burn_core.module.base35 burn_fusion.backend36 burn_nn.initializer37 burn_cubecl.backend38 burn_optim.optim.module.module_optimizer39 burn_router.backend40 burn_train.learner.baseburn_autodiff.grads1burn_core.module.display2burn_std.distributed3burn_std.ops4burn_std.tensor.dtype5burn_train.metric.base6burn_cubecl_fusion.engine.codegen.ir7burn_ir.tensor8burn_pack.tensor9burn_std.data.tensor.base10burn_std.device_settings11burn_std.element.scalar12burn_backend.backend.base13burn_cubecl_fusion.engine.trace.base14burn_flex.tensor15burn_ir.operation16burn_remote.shared.task17burn_tensor.device18burn_train.metric.state19burn_autodiff.backend20burn_dispatch.backend21burn_ir.backend22burn_nn.activation.activation_wrapper23burn_remote.client.service24burn_tensor.bridge.kind25burn_ir.handle26burn_tensor.tensor.api.base27burn_core.module.param.base28burn_cubecl.tensor.base29burn_flex.backend30burn_fusion.stream.context31burn_instrument.bounds32burn_router.interpreter33burn_core.module.base34burn_fusion.backend35burn_nn.initializer36burn_cubecl.backend37burn_optim.optim.module.module_optimizer38burn_router.backend39burn_train.learner.base40111331112421191211212121621263113129311311111211192543133312131112233411117311121212113111142121841111213312211741122111119311221111+928 more modules (most-connected shown)

At a glance — Code Health · 84% · Strong ·

At a glance — Architecture · 94% · Exemplary ·

At a glance — Maturity · 65% · Adequate · gated by M2 ·

At a glance — Readiness · 60% · Adequate · gated by P7 ·

At a glance — Security · 53% · Adequate · gated by D36 ·

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

At a glance — Performance · 97% · Exemplary ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A05:2025 — Injection91High / Critical
A03:2025 — Software Supply Chain Failures31High / Critical

Roadmap

Top priorities: Secure the server's transport: serve TLS itself (`HttpServer::bind_rustls_0_23(addr, config)` in actix-web, `axum_server::bind_rustls(addr, RustlsConfig::from_pem_file(…))`, tonic's `Server::builder().tls_config(ServerTlsConfig::new().identity(…))`, Rocket's `[default.tls]`), or run it behind a TLS-terminating proxy and check `X-Forwarded-Proto`; send `Strict-Transport-Security` once it is HTTPS-only; Resolve the 1 No ADRs found finding(s) in ADR Quality — start with main.rs; Name the access rules — roles and permissions declared once (an enum Role/Permission, actix-web-grants #[protect(…)], axum-login's permission_required!, a casbin or oso policy) and consulted where access is checked, so the rule set is reviewable and testable on its own.

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

Do thisHelpsEffortDimension
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with main.rs.+3.6 ptsLowADR Quality
Resolve the 4 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED.+3.0 ptsLowSupply-chain Provenance & Signing
Secure the server's transport: serve TLS itself (`HttpServer::bind_rustls_0_23(addr, config)` in actix-web, `axum_server::bind_rustls(addr, RustlsConfig::from_pem_file(…))`, tonic's `Server::builder().tls_config(ServerTlsConfig::new().identity(…))`, Rocket's `[default.tls]`), or run it behind a TLS-terminating proxy and check `X-Forwarded-Proto`; send `Strict-Transport-Security` once it is HTTPS-only.+5.5 ptsMediumWeb-Security Posture
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED.+1.8 ptsLowStatic Analysis (SAST)
Resolve the 1 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED.+1.8 ptsLowDependency Vulnerabilities
Name the access rules — roles and permissions declared once (an enum Role/Permission, actix-web-grants #[protect(…)], axum-login's permission_required!, a casbin or oso policy) and consulted where access is checked, so the rule set is reviewable and testable on its own.+3.3 ptsMediumAccess Controls
Resolve the 2 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED.+1.5 ptsLowSupply-chain Provenance & Signing
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.+3.0 ptsMediumArchitecture documentation

File quality

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

FileScoreBandWorst signal
REDACTED1.6SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.4SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.0MixedStatic Analysis (SAST): High: REDACTED
crates/burn-backend/src/backend/ops/bool_tensor.rs4.8MixedCode Duplication: Edited copies of one member (3 members, 14+ corresponding lines)
crates/burn-router/src/interpreter.rs5.5MixedCyclomatic Complexity: TensorInterpreter::execute_op (cyclomatic 340)
crates/burn-fusion/src/stream/context.rs5.5MixedGod Classes: MethodTooLong: ModuleOperationIr.to_relative
crates/burn-cubecl/src/kernel/binary.rs5.5MixedCode Duplication: Near-duplicate member family (3 members, 34 shared lines)
crates/burn-nn/src/modules/transformer/decoder.rs5.5MixedCode Duplication: Edited copy of a member (25 corresponding lines)
crates/burn-nn/src/modules/conv/conv2d.rs5.5MixedCode Duplication: Edited copies of one member (4 members, 34+ corresponding lines)
crates/burn-remote/src/server/worker.rs5.6MixedCyclomatic Complexity: SessionHandler::process_task (cyclomatic 45)
crates/burn-remote/src/client/service.rs5.6MixedGod Classes: TooManyMethods: RemoteService
crates/burn-backend/src/backend/ops/modules/base.rs5.7MixedGod Classes: ClassTooLong: ModuleOps
crates/burn-nn/src/modules/conv/conv1d.rs5.7MixedCode Duplication: Near-duplicate member family (3 members, 13 shared lines)
crates/burn-fusion/src/client.rs5.7MixedCode Duplication: Members sharing a duplicated core (4 members, 50+ identical tokens)
REDACTED5.8MixedStatic Analysis (SAST): High: REDACTED
crates/burn-nn/src/modules/pool/avg_pool1d.rs5.9MixedCode Duplication: Edited copies of one member (3 members, 8+ corresponding lines)

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

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

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

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

Could not be resolved — 14

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 50 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 — 50 dimensions across the health lenses
D1D2D3D4D5D6D12D13D14D15D16D17D19D20D23D26D28D29D30D34D35D36D43AX10AX3AX4AX8AX9C2ES1ES2M1M2M3M4P1P10P2P3P4P6P7PF1PF3S1X1X15X21X29X30

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, 1691 of 1743 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 · trivySecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3✓ deterministic

Every finding is locatable in findings.md. Run 01a1daaf-7bf6-7899-a492-b6583f1431a9.

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

Run transparency — what happened this run

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

  • D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: the Rust half could not be measured — the Cargo suite in repository root did not build, so it was never run. Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo — a Codecov configuration (codecov.yml, target 80%) and a coverage step in CI (`grcov .`) shows coverage is measured in your own CI.
  • 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. This repository declares 2 of its own test(s) unreliable. The built-in reliability runner does not support this repository's ecosystem (.rs, .py), so the suite was not re-run and no reliability score is given — these are the repository's own declarations, not our measurement.
  • 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.
  • 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 — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D27 Navigability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • D44 Platform End-of-Life — 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 dimension reads a project's own statement about the platform it runs on: a TargetFramework in a .NET project file, a .nvmrc or .python-version, a capped requires-python, a Rust toolchain file or Cargo.toml rust-version, a .go-version, .java-version, .ruby-version, .tool-versions or .sdkmanrc, a go.mod go directive, a Maven or Gradle Java level or toolchain, a Gemfile's ruby directive, a mix.exs elixir requirement, a rebar.config minimum_otp_vsn, a pubspec.yaml SDK constraint, a build.sbt scalaVersion, or a framework major pinned by a dependency constraint. This repository carries none of them, so nothing about its platform was established. That is a gap in this analyzer's coverage, NOT a finding that the platform is supported — a language whose runtime is declared elsewhere (Package.swift, a Dockerfile) is simply not read here yet.
  • AX6 Interface segregation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • AXB1 Runtime evidence locked — no reproducible boot — 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. Subject: 1 markup document(s) — HTML, Razor, JSX, Vue, Svelte or server templates. The Runtime Evidence tier boots an app only via docker-compose, an Aspire AppHost, a Dockerfile, an npm dev script, a web service's own toolchain entry point (cargo, go, dotnet, Python, Spring Boot), or an Android app's own Gradle wrapper (run on an emulator); an Apple or Flutter app needs a host it lacks. None applied, so no live runtime a11y/egress/header evidence was collected. You can widen what we reach: add a docker-compose.yml (or an Aspire AppHost) that brings the app up with its dependencies. We then boot it in an isolated sandbox and gathers real runtime evidence — you change nothing in your pipeline (no CI step, no SDK).
  • GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and no C#, F#, JavaScript/TypeScript, Dart, Ruby or Scala was found, and this repository's Python, Rust is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and no C#, JavaScript/TypeScript, Java, Dart, Ruby or Scala was found, and this repository's Python, Rust is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X16 Unfloored truncation loop — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X18 Disposal-pattern correctness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala or PHP was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X5 Nullable reference types — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax and MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, and Kotlin source only, and no C# was loaded, no TypeScript was found, and this repository's Python, Rust is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D23 Boundary Type-Coupling: Boundary leakage is detected from type references across detected contexts — leaks that flow through primitives, serialization or shared infrastructure may not surface as a typed reference.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • 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.
  • 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.7 / 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.7 / 10 · rule-coverage 100% · ceiling Prevented

73 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was TensorInterpreter::execute_op at 340. A further 50 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being OpCode::try_from at 66 — they are counted neither in the figure above nor in this dimension's score. 15 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: crates/burn-fusion/src/stream/context.rs (ModuleOperationIr::to_relative at 60), crates/burn-cubecl-fusion/src/engine/codegen/ir.rs (FuseOp::fmt at 38), crates/burn-cubecl/src/kernel/unary_float.rs (BasicFloatUnary::execute at 26), crates/burn-shard/src/backend/classify.rs (OpClass::numeric at 23), crates/pytorch-reader/src/nested/data.rs (NestedValue::fmt at 21), and 10 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.

burn_flex::ops::reduce::reduce_dim_f32 (cyclomatic 39) · ×22crates/burn-flex/src/ops/reduce.rs:858
burn_linalg::solve_cubecl::blocked_rhs (cyclomatic 46) · ×10crates/burn-linalg/src/solve_cubecl.rs:803
burn_vision::backends::cube::connected_components::prefix_sum::prefix_sum_kernel (cyclomatic 32) · ×6crates/burn-vision/src/backends/cube/connected_components/prefix_sum.rs:18
ModuleOperationIr::visit_mut (cyclomatic 84) · ×3crates/burn-ir/src/operation.rs:4717
burn_cubecl_fusion::engine::codegen::io::read (cyclomatic 25) · ×3crates/burn-cubecl-fusion/src/engine/codegen/io.rs:40

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

What to do

  1. Bring the 1 body over 120 down to 120 or less in Cyclomatic Complexity — start with TensorInterpreter::execute_op (cyclomatic 340). — Refactoring it lifts Cyclomatic Complexity from 4.7 to about 5.8/10.

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

D2 · Cognitive Complexity5.7 / 10Adequate✓ Tool-verified

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

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

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

174 method(s) exceeded the cognitive complexity threshold of 15; the worst was burn_linalg::solve_cubecl::blocked_rhs at 138.

burn_flex::ops::pool::avg_pool3d_backward_impl (cognitive 116) · ×50crates/burn-flex/src/ops/pool.rs:1446
burn_linalg::solve_cubecl::blocked_rhs (cognitive 138) · ×17crates/burn-linalg/src/solve_cubecl.rs:803
burn_cubecl::kernel::pool::max_pool3d::max_pool3d_forward_kernel (cognitive 60) · ×15crates/burn-cubecl/src/kernel/pool/max_pool3d.rs:31
burn_cubecl_fusion::engine::launch::vectorization::base::vectorization_swapped (cognitive 30) · ×11crates/burn-cubecl-fusion/src/engine/launch/vectorization/base.rs:384
burn_vision::backends::cpu::connected_components::spaghetti::process (cognitive 77) · ×9crates/burn-vision/src/backends/cpu/connected_components/spaghetti/mod.rs:32

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

What to do

  1. Bring the 1 body over 120 down to 120 or less in Cognitive Complexity — start with burn_linalg::solve_cubecl::blocked_rhs (cognitive 138). — Refactoring it lifts Cognitive Complexity from 5.7 to about 5.8/10.

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

144 god class(es) detected.

FileTooLong: src/operation.rs · ×55crates/burn-ir/src/operation.rs
FunctionTooLong: burn_flex::ops::conv::conv3d_impl · ×38crates/burn-flex/src/ops/conv.rs:238
MethodTooLong: TensorInterpreter.execute_op · ×27crates/burn-router/src/interpreter.rs:287
ClassTooLong: TensorInterpreter · ×12crates/burn-router/src/interpreter.rs:62
TooManyMethods: Tensor · ×9crates/burn-tensor/src/tensor/api/base.rs:76

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

What to do

  1. Resolve the 55 FileTooLong finding(s) in God Classes — start with module.rs (6), tensor.rs (5), int_tensor.rs (3). — One of this dimension's main actionable groups (55 warning-level).
  2. Resolve the 38 FunctionTooLong finding(s) in God Classes — start with conv.rs (4), solve_cubecl.rs (4), mod.rs (3). — One of this dimension's main actionable groups (38 warning-level).
  3. Resolve the 27 MethodTooLong finding(s) in God Classes — start with operation.rs (6), context.rs (4), tensor.rs (3). — One of this dimension's main actionable groups (27 warning-level).

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

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

565 duplicated block group(s) detected. 8.6 % of the production lines (28,834 of 336,364) are in a reported copy. A further 417 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 9 of the 982 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) · ×43crates/burn-autodiff/src/ops/tensor.rs:830
Duplicated block (9 lines × 2) · ×35crates/burn-autodiff/src/ops/tensor.rs:478
Duplicated block (5 lines × 2) · ×30crates/burn-autodiff/src/ops/tensor.rs:227
Duplicated block (7 lines × 2) · ×28crates/burn-backend/src/backend/ops/collective.rs:280
Duplicated block (11 lines × 2) · ×23crates/burn-autodiff/src/ops/tensor.rs:4419

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

What to do

  1. Resolve the 43 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with tensor.rs (3), base.rs (3), reduce.rs (3). — One of this dimension's main actionable groups (43 warning-level).
  2. Resolve the 35 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with tensor.rs (6), col2im.rs (2), matmul.rs (2). — One of this dimension's main actionable groups (35 warning-level).
  3. Resolve the 30 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with tensor.rs (3), sort.rs (2), lu.rs (2). — One of this dimension's main actionable groups (30 warning-level).

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

D5 · Coupling7.9 / 10Strong✓ Tool-verified

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

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

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

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

39 production modules (Cargo), 0 dependency cycle(s), 4 unstable depended-on module(s). Read from the build's own module declarations; 5 module(s) off the main sequence, with abstractness counted on 31 of the 39 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).

Off the main sequence: burn-einsum · ×5
Unstable project burn-dispatch
Unstable project burn-signal
Unstable project burn-train
Unstable project burn-vision

What to do

  1. Resolve the 5 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (5 warning-level).
  2. Resolve the 1 Unstable project burn-dispatch finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 Unstable project burn-signal finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).

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

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

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

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

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

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

4 of 551 classes have LCOM4 above 3.

Low cohesion: Tensor (LCOM4 10) · ×4crates/burn-pack/src/tensor.rs:119

What to do

  1. Resolve the 4 Low cohesion finding(s) in Cohesion (LCOM4) — start with tensor.rs, base.rs, display.rs. — One of this dimension's main actionable groups (4 warning-level).

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

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

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

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

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

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

Outdated: bon · ×20

✓ On the Gold path — maintain.

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

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

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

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

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

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

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

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

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

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

0 of 1027 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 36 crate(s) in the closure resolve from git, a path or a private registry and publish no licence this pass can read; they are outside this verdict. This repository publishes itself under MIT OR Apache-2.0, which is its own choice and is not judged here.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

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

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

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

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

Top hotspots: crates/burn-router/src/interpreter.rs (30×340=10200); crates/burn-ir/src/operation.rs (20×84=1680); crates/pytorch-reader/src/pickle_reader.rs (13×68=884) Repeated repair below the complexity floor: crates/burn-autodiff/src/ops/tensor.rs (8 of 14 changes were fixes); crates/burn-std/src/data/tensor/base.rs (7 of 12 changes were fixes); crates/burn-core/src/backend.rs (6 of 8 changes were fixes)

Hotspot: crates/burn-router/src/interpreter.rs · ×16crates/burn-router/src/interpreter.rs:287
Repeated repair: crates/burn-autodiff/src/ops/tensor.rs · ×15crates/burn-autodiff/src/ops/tensor.rs:1155

What to do

  1. Resolve the 16 Hotspot finding(s) in Churn × Complexity Hotspots — start with interpreter.rs, operation.rs, pickle_reader.rs. — One of this dimension's main actionable groups (16 warning-level).
  2. Resolve the 15 Repeated repair finding(s) in Churn × Complexity Hotspots — start with base.rs (2), optimization.rs (2), tensor.rs. — One of this dimension's main actionable groups (15 warning-level).

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

D16 · Bus Factor9.4 / 10Exemplary✓ Tool-verified

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

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

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

49 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is crates/burn-flex/src/simd/portable.rs. Counted over 860 of the 1235 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

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

✓ On the Gold path — maintain.

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

D17 · Explicit Debt10.0 / 10Stronggated by 84 serious findings✓ Tool-verified

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

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

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

84 deducted task-comment markers across 336364 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.

TodoComment · ×81xtask/src/commands/test.rs:94
FixmeComment · ×2crates/burn-backend-tests/tests/cubecl/quantization/reshape.rs:61
HackCommentcrates/burn-vision/src/backends/cpu/connected_components.rs:86

What to do

  1. Resolve the 81 TodoComment finding(s) in Explicit Debt — start with builder.rs (9), base.rs (8), tensor.rs (4). — One of this dimension's main actionable groups (81 warning-level).
  2. Resolve the 2 FixmeComment finding(s) in Explicit Debt — start with reshape.rs (2). — One of this dimension's main actionable groups (2 warning-level).
  3. Resolve the 1 HackComment finding(s) in Explicit Debt — start with connected_components.rs. — One of this dimension's main actionable groups (1 warning-level).

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality0.0 / 10Critical✓ Tool-verified

What it measures: Whether architecture decisions are recorded well (context, decision, consequences).

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

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

No architecture decision records were found.

No ADRs foundcrates/burn-instrument-report/src/main.rs:1

What to do

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

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

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

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

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

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

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

No domain types leak across context boundaries (2 contexts). Contexts: burn-remote, burn-train.

✓ On the Gold path — maintain.

Detailed fixes: d23_recommendation.md.

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

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

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

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

8 of 40 build units (Cargo) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion

What to do

  1. Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).

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

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

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

Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.

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

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

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

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

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

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

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

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

91 finding(s): 0 critical, 91 high, 0 medium, 0 low. 89 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 1 file(s) — `crates/burn-communication/src/websocket/server.rs` (line 105) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them.

REDACTED
REDACTED
REDACTED
REDACTED

What to do

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

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

D30 · Dependency Vulnerabilities6.5 / 10Adequate✓ 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 6.5 / 10 · rule-coverage 100% · ceiling Documented

19 finding(s): 1 critical, 0 high, 12 medium, 0 low.

REDACTED
REDACTED
REDACTED
REDACTED

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 1 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  3. Resolve the 3 Medium advisory (unmaintained) finding(s) in Dependency Vulnerabilities — start with REDACTED (3). — One of this dimension's main actionable groups (3 recommendation-level).

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

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

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

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

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

28 of 860 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is crates/burn-vision/src/backends/cpu/connected_components/spaghetti/Spaghetti_center_line_forest_code.rs. Counted over 860 of the 1235 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned knowledge · ×3crates/burn-vision/src/backends/cpu/connected_components/spaghetti/Spaghetti_center_line_forest_code.rs:1
Orphaned file · ×25crates/burn-train/src/metric/vision/afine/heads.rs:1
Further orphaned files (smaller)

What to do

  1. Resolve the 3 Orphaned knowledge finding(s) in Knowledge Freshness — start with Spaghetti_center_line_forest_code.rs, Spaghetti_last_line_forest_code.rs, filter.rs. — One of this dimension's main actionable groups (3 issue-level).
  2. Resolve the 25 Orphaned file finding(s) in Knowledge Freshness — start with weights.rs (2), heads.rs, metric.rs. — One of this dimension's main actionable groups (25 recommendation-level).
  3. Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).

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

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

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

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

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

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

Strongest change-coupling: int_tensor.rs↔int_tensor.rs 100%; runner.rs↔backend.rs 86%; conv1d.rs↔conv2d.rs 84%

Change coupling: int_tensor.rs ↔ int_tensor.rs · ×31crates/burn-fusion/src/ops/int_tensor.rs:1
Change-coupling hub: backend.rs → backend.rs, backend.rs, runner.rs, task.rs · ×5crates/burn-router/src/backend.rs

What to do

  1. Resolve the 31 Change coupling finding(s) in Change Coupling — start with bool_tensor.rs (4), int_tensor.rs (2), module.rs (2). — One of this dimension's main actionable groups (31 warning-level).
  2. Resolve the 5 Change-coupling hub finding(s) in Change Coupling — start with backend.rs, module.rs, interpreter.rs. — One of this dimension's main actionable groups (5 warning-level).

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

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

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

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

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

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

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

Frontend & cross-cutting dimensions

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

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

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

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

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

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

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

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

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

Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.

Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.

AX8 · Test 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.

C2 · Access Controls7.0 / 10Strong✓ Tool-verified

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

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

  • Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.

What to do

  • Name the access rules — roles and permissions declared once (an enum Role/Permission, actix-web-grants #[protect(…)], axum-login's permission_required!, a casbin or oso policy) and consulted where access is checked, so the rule set is reviewable and testable on its own.
ES1 · Fold determinism10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

M1 · Documentation (README)8.3 / 10Exemplary✓ Tool-verified

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

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

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 documentation2.0 / 10Weak✓ 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 accuracy8.0 / 10Strong✓ Tool-verified

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

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

  • crates/burn/README.md links to `assets/ci-powered-by-blaze.svg`, but `crates/burn/assets/ci-powered-by-blaze.svg` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — crates/burn/README.md:13

What to do

  • Reconcile the README with reality: crates/burn/README.md links to `assets/ci-powered-by-blaze.svg`, but `crates/burn/assets/ci-powered-by-blaze.svg` does not exist.
P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

P2 · Observability6.6 / 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 13/15 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `crates/burn-instrument-report`.

What to do

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

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

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

  • `REDACTED` run(s) a static-analysis scan, but no workflow that runs one is triggered by a pull request (or a merge queue, or an unfiltered push) — the scan fires on a schedule or a manual dispatch only. A vulnerable change therefore merges clean and is reported on the next scheduled run, by which time it is on the default branch and the only remedy is a follow-up fix. Add the pull-request trigger to the workflow that runs the scan so the finding arrives before the merge rather than after it.

What to do

  • Trigger your SAST workflow on pull requests — a scan that only runs on a cron reports history, it does not 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.

  • The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.

What to do

  • Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
P6 · Release Hygiene8.0 / 10Strong✓ 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.

  • The changelog this check read carries 0 versioned entries, against a bar of 3. Counted as either the distinct `x.y.z` versions it names (a link's target is not counted) or its version-shaped section headings (`## [1.2.0]`, `## V14.x.x`, `## Updates in 8.0.x`), whichever is the larger — so a log sectioned by minor series counts its sections, not its individual patch numbers. Entries recorded somewhere this check does not read — release notes generated at tag time from a generator config it did not recognise, or a log kept outside the repository — are not counted here, and this row is about what is re-findable in the tree rather than about how often you release.

What to do

  • Keep the changelog current — add a versioned entry (Keep-a-Changelog ## [x.y.z]) for each release so the history isn't a stub.
P7 · Outbound HTTP resilience3.0 / 10Weak✓ Tool-verified

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

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

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

What to do

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

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

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

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

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

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

S1 · Web-Security Posture4.0 / 10Weak✓ Tool-verified

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

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

  • This repository starts an HTTP server and nothing in its Rust source or committed `Rocket.toml` secures the transport: no TLS served (actix-web `bind_rustls`/`bind_openssl`, axum-server `bind_rustls` with a `RustlsConfig`, tonic `ServerTlsConfig`, a `TlsAcceptor`, Rocket's `[default.tls]`), no `Strict-Transport-Security` header, no `X-Forwarded-Proto` read from a TLS-terminating proxy — so its traffic may cross the network in clear text. (−2.0 on this card.) The server: `axum::serve(` (crates/burn-communication/src/websocket/server.rs:68).
  • None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is set on a response this repository's Rust server sends — defense in depth, even when a proxy could set them. (−2.0 on this card.) The server: `axum::serve(` (crates/burn-communication/src/websocket/server.rs:68).
  • No handler of this repository's Rust server answers 400, 413 or 422 (`StatusCode::BAD_REQUEST`, `HttpResponse::BadRequest()`, `Status::BadRequest`, tonic `Status::invalid_argument`), and nothing declares validation — no `validator`/`garde` derive, no body limit (`DefaultBodyLimit::max`, `RequestBodyLimitLayer`, `JsonConfig::default().limit(…)`, Rocket `Limits`) — nothing shows inbound requests being checked, and refused, before a handler acts on them. A check that answers its failure with 200 and an error body is not seen. (−2.0 on this card.) The server: `axum::serve(` (crates/burn-communication/src/websocket/server.rs:68).

What to do

  • Secure the server's transport: serve TLS itself (`HttpServer::bind_rustls_0_23(addr, config)` in actix-web, `axum_server::bind_rustls(addr, RustlsConfig::from_pem_file(…))`, tonic's `Server::builder().tls_config(ServerTlsConfig::new().identity(…))`, Rocket's `[default.tls]`), or run it behind a TLS-terminating proxy and check `X-Forwarded-Proto`; send `Strict-Transport-Security` once it is HTTPS-only.
  • Set security response headers on what the server sends — actix-web's `DefaultHeaders::new().add((header::X_CONTENT_TYPE_OPTIONS, "nosniff"))`, tower-http's `SetResponseHeaderLayer::overriding(…)` on an axum router, or keep Rocket's default `Shield` — with `Content-Security-Policy`, `X-Content-Type-Options` and a frame policy on every response.
  • Validate what the server reads from a request — path, query, headers, body size and shape — and answer what fails with 400 (413 for an oversized body) before a handler acts on it: derive `validator::Validate` (or `garde::Validate`) on the request types and reject with `StatusCode::BAD_REQUEST`, and cap bodies with `DefaultBodyLimit::max`/`RequestBodyLimitLayer` or actix's `JsonConfig::default().limit(…)`.
X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reference — by lens

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

LensScoreRatingImpact
Code Health84%StrongSolid.
Architecture94%ExemplarySolid.
Maturity65%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness60%Adequate — gated by P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security53%Adequate — gated by D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Event Sourcing100%ExemplaryStrongest area.
Performance97%ExemplarySolid.
Unscored — 2 check(s) recorded observations but carry no score

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

  • D11 Test Reliability — 2 observation(s) recorded · This repository declares 2 of its own test(s) unreliable. The built-in reliability runner does not support this repository's ecosystem (.rs, .py), so the suite was not re-run and no reliability score is given — these are the repository's own declarations, not our measurement.
  • X10 Duplicated predicate — 14 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 — 64 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 — Frontend below the scale floor (4 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC2 Forms & labels — Frontend below the scale floor (4 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC3 Page structure — Frontend below the scale floor (4 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC4 Keyboard semantics — Frontend below the scale floor (4 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC5 ARIA correctness — Frontend below the scale floor (4 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC6 Visual & motion safety — Frontend below the scale floor (4 DOM element(s) < 25) — too little surface to assess accessibility.
  • AX1 Captive dependencies — Not applicable: this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; Rust with no dependency-injection crate has no container to hand one lifetime's instance to another — every value is owned by the code that builds it, and the borrow checker rejects a longer-lived value keeping a borrow of a shorter-lived one.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AXB1 Runtime evidence locked — no reproducible boot — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no data at rest for these controls to protect.
  • C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data whose lifetime a retention limit would bound.
  • C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data for a data subject to erase, export or consent over.
  • D10 Test Quality — ~100071 lines of test source are present (.rs, .py) 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.
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D21 Naming Consistency — Naming consistency does not read html yet; not measured.
  • D22 Internal API Consistency — API consistency is measured on C# only; the exposed Rust surface was not measured.
  • D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only; comments in this repository's .py, .rs source were not judged.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • 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.
  • D44 Platform End-of-Life — Platform end-of-life not assessed — this repository declares no platform this pass reads
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage not measured — Rust suite
  • DM1 Domain Modelling — applicable but not scored (3 signals for this style, 3 needed — the count is met but a required primary signal is absent): 3 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit); 80 value object(s); 1 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 a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • X12 Unreachable branch — X12 reached only 0% of this repository's production lines — rust (335,789 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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
  • X16 Unfloored truncation loop — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • 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 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
  • X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X2 Cancellation propagation — no C# was loaded; this repository's Python and Rust were read, and no request in it can be cancelled by a caller — a Python request takes no token: asyncio cancels the task and trio or anyio the scope that made it, from outside the call, and requests, httpx, aiohttp and gRPC take a timeout, not a cancellation; a Rust request takes no token: a future is cancelled by dropping it, from outside the call (select!, a timeout, an aborted task), and reqwest, hyper and tonic take none
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X27 Collection changed while being enumerated — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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
  • X3 Exception handling — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X4 Structured logging — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Rust was read, and it logs through none: the `log` crate's macros take one finished message (as log4net does in C#; its `kv` values are an opt-in its backends mostly drop), `println!`/`eprintln!` are not loggers, or it makes no log call outside its tests and examples at all. Calls through `tracing` (`tracing::info!`, or `info!` imported from it) would be judged.
  • X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X7 Silent fallback defaults — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

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

Critical — 97 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 28 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 11 more in this group — see findings.md.
D34 · Knowledge Freshness · Orphaned knowledge · ×3
  • Orphaned knowledge crates/burn-vision/src/backends/cpu/connected_components/spaghetti/Spaghetti_center_line_forest_code.rs:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge crates/burn-vision/src/backends/cpu/connected_components/spaghetti/Spaghetti_last_line_forest_code.rs:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge crates/burn-vision/src/backends/cpu/morphology/filter.rs:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
D11 · Test Reliability · Test declared unreliable · ×2
  • Test declared unreliable: should_behave_the_same_with_multithread crates/burn-backend-tests/tests/autodiff/multithread.rs:6 — This test is disabled or skipped with a reason naming unreliability — the repository's own words: "Flaky test". A test that is skipped for flakiness is neither passing nor protecting the code it covers; either stabilise it or delete it, but do not leave it disabled indefinitely. (Found by reading the repository's own test source — the suite itself was not re-run, since the reliability runner does not support this ecosystem.)
  • Test declared unreliable: should_handle_multi_threads_no_async_op_no_wait crates/burn-backend-tests/tests/tensor/multi_threads.rs:90 — This test is disabled or skipped with a reason naming unreliability — the repository's own words: "Flaky test". A test that is skipped for flakiness is neither passing nor protecting the code it covers; either stabilise it or delete it, but do not leave it disabled indefinitely. (Found by reading the repository's own test source — the suite itself was not re-run, since the reliability runner does not support this ecosystem.)
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×1
  • REDACTED
Serious — 1559 finding(s)
D17 · Explicit Debt · TodoComment · ×81
  • TodoComment xtask/src/commands/test.rs:94 — // TODO: Re-enable collective (all-reduce) tests once NCCL is installed and loadable on — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment xtask/src/commands/test.rs:536 — // TODO: Investigate GPU shutdown and remove this workaround once it is fixed. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment xtask/src/commands/test.rs:600 — // TODO: switch to `cargo xtask build` or `check` eventually instead of including this in the tests — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment xtask/src/commands/wgpu_test_runner.rs:4 — //! TODO: Investigate and fix GPU shutdown, then remove this workaround. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/burn-vision/src/loss/gram_matrix/gram_matrix_loss.rs:313 — // TODO: run tests only locally, and #[serial]'ised? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/burn-vision/src/backends/cpu/morphology/mod.rs:18 — /// TODO: Implement composite ops — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/burn-train/src/renderer/tui/base.rs:36 — // TODO: constraints are still hardcoded, but could be computed dynamically. For example, — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/burn-train/src/metric/state.rs:217 — // TODO: naming inconsistent with RL. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/burn-train/src/metric/processor/minimal.rs:161 — // TODO: Check for another default. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/burn-train/src/learner/summary.rs:384 — // TODO: rename to `ExperimentSummary`? Used in learner + evaluator. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/burn-train/src/learner/rl/strategy.rs:79 — // TODO: summary makes sense for RL? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/burn-train/src/learner/rl/env_runner/async_runner.rs:235 — // TODO : clean this up. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/burn-tensor/src/device.rs:1266 — // TODO: maybe quantization, but for now we keep this as device defaults — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/burn-tensor/src/tensor/api/base.rs:3316 — // TODO: refactor display — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/burn-tensor/src/tensor/api/float.rs:295 — // TODO: Allow backend specialization. Optimally, implement a median kernel for cubecl — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/burn-tensor/src/tensor/api/float.rs:340 — // TODO: Allow backend specialization. Optimally, implement a median kernel for cubecl — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/burn-std/src/data/tensor/conversion.rs:236 — // TODO: deprecate? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/burn-std/src/data/tensor/conversion.rs:249 — // TODO: deprecate? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/burn-optim/src/optim/grads.rs:71 — // TODO: always call value.inner() to make sure? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/burn-nn/tests/quantize.rs:77 — // TODO: set native if dtype is supported by the test backend — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/burn-nn/src/loss/cross_entropy.rs:196 — // TODO: finfo stable eps — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/burn-linalg/tests/backend/lu.rs:13 — // TODO: for correctness it might be good to allow users to disable some of these configs in burn.toml. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/burn-ir/src/builder.rs:92 — // TODO: check that ScalarIr dtype matches dtype? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/burn-ir/src/builder.rs:353 — // TODO: check if axes are within the tensor dimensions — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment crates/burn-ir/src/builder.rs:369 — // TODO: check dims compat between tensor and indices — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • + 56 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×55
  • FileTooLong: src/operation.rs crates/burn-ir/src/operation.rs — FileTooLong — 3641 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 3141 over it, 7.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: ops/tensor.rs crates/burn-autodiff/src/ops/tensor.rs — FileTooLong — 3254 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 97% of them inside a single declaration: Autodiff (110-4887). The bar is 500 significant lines; this is 2754 over it, 6.51× 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: ops/tensor.rs crates/burn-fusion/src/ops/tensor.rs — FileTooLong — 2056 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 99% of them inside a single declaration: Fusion (18-3051). The bar is 500 significant lines; this is 1556 over it, 4.11× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: src/interpreter.rs crates/burn-router/src/interpreter.rs — FileTooLong — 1882 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 96% of them inside a single declaration: TensorInterpreter (4 blocks, 62-2628). The bar is 500 significant lines; this is 1382 over it, 3.76× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: ops/module.rs crates/burn-autodiff/src/ops/module.rs — FileTooLong — 1873 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 95% of them inside a single declaration: Autodiff (19-2456). The bar is 500 significant lines; this is 1373 over it, 3.75× 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: ops/int_tensor.rs crates/burn-fusion/src/ops/int_tensor.rs — FileTooLong — 1696 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 99% of them inside a single declaration: Fusion (18-2524). The bar is 500 significant lines; this is 1196 over it, 3.39× 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: ops/module.rs crates/burn-fusion/src/ops/module.rs — FileTooLong — 1607 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 98% of them inside a single declaration: Fusion (40-2102). The bar is 500 significant lines; this is 1107 over it, 3.21× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: ops/reduce.rs crates/burn-flex/src/ops/reduce.rs — FileTooLong — 1592 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 53 free functions. The bar is 500 significant lines; this is 1092 over it, 3.18× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: ops/conv.rs crates/burn-flex/src/ops/conv.rs — FileTooLong — 1312 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 812 over it, 2.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: simd/portable.rs crates/burn-flex/src/simd/portable.rs — FileTooLong — 1300 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 99 free functions. The bar is 500 significant lines; this is 800 over it, 2.60× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: stream/context.rs crates/burn-fusion/src/stream/context.rs — FileTooLong — 1298 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 798 over it, 2.60× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/builder.rs crates/burn-ir/src/builder.rs — FileTooLong — 1285 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 785 over it, 2.57× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: ops/pool.rs crates/burn-flex/src/ops/pool.rs — FileTooLong — 1249 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 75 free functions. The bar is 500 significant lines; this is 749 over it, 2.50× 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: ops/tensor.rs crates/burn-router/src/ops/tensor.rs — FileTooLong — 1181 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 98% of them inside a single declaration: BackendRouter (23-1686). The bar is 500 significant lines; this is 681 over it, 2.36× 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/pickle_reader.rs crates/pytorch-reader/src/pickle_reader.rs — FileTooLong — 1169 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 38 free functions. The bar is 500 significant lines; this is 669 over it, 2.34× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: api/check.rs crates/burn-tensor/src/tensor/api/check.rs — FileTooLong — 1167 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 95% of them inside a single declaration: TensorCheck (2 blocks, 36-1834). The bar is 500 significant lines; this is 667 over it, 2.33× 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: modules/conv.rs crates/burn-backend/src/backend/ops/modules/conv.rs — FileTooLong — 1149 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 50 free functions. The bar is 500 significant lines; this is 649 over it, 2.30× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: api/base.rs crates/burn-tensor/src/tensor/api/base.rs — FileTooLong — 1132 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 65% of them inside a single declaration: Tensor (7 blocks, 76-3843). The bar is 500 significant lines; this is 632 over it, 2.26× 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: ops/fft.rs crates/burn-flex/src/ops/fft.rs — FileTooLong — 1109 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 609 over it, 2.22× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: ops/module.rs crates/burn-router/src/ops/module.rs — FileTooLong — 1075 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 99% of them inside a single declaration: BackendRouter (15-1384). The bar is 500 significant lines; this is 575 over it, 2.15× 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: ops/gather_scatter.rs crates/burn-flex/src/ops/gather_scatter.rs — FileTooLong — 1036 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 44 free functions. The bar is 500 significant lines; this is 536 over it, 2.07× 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: tensor/module.rs crates/burn-tensor/src/tensor/module.rs — FileTooLong — 997 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 49 free functions. The bar is 500 significant lines; this is 497 over it, 1.99× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: ops/int.rs crates/burn-flex/src/ops/int.rs — FileTooLong — 993 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 93% of them inside a single declaration: Flex (110-1478). The bar is 500 significant lines; this is 493 over it, 1.99× 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: ops/int_tensor.rs crates/burn-router/src/ops/int_tensor.rs — FileTooLong — 953 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 98% of them inside a single declaration: BackendRouter (22-1363). The bar is 500 significant lines; this is 453 over it, 1.91× 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: ops/float.rs crates/burn-flex/src/ops/float.rs — FileTooLong — 886 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 96% of them inside a single declaration: Flex (50-1350). The bar is 500 significant lines; this is 386 over it, 1.77× 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.
  • + 30 more in this group — see findings.md.
D2 · Cognitive Complexity · burn_flex · ×50
  • burn_flex::ops::pool::avg_pool3d_backward_impl (cognitive 116) crates/burn-flex/src/ops/pool.rs:1446 — burn_flex::ops::pool::avg_pool3d_backward_impl has cognitive complexity 116 (threshold 15). Drivers by points: if/else 11 (55 pts), loops 11 (53 pts), boolean chains 8 (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.
  • burn_flex::ops::conv_transpose::conv_transpose3d_impl (cognitive 79) crates/burn-flex/src/ops/conv_transpose.rs:246 — burn_flex::ops::conv_transpose::conv_transpose3d_impl has cognitive complexity 79 (threshold 15). Drivers by points: if/else 21 (43 pts), loops 10 (33 pts), boolean chains 3 (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.
  • burn_flex::ops::reduce::reduce_dim_f32 (cognitive 70) crates/burn-flex/src/ops/reduce.rs:858 — burn_flex::ops::reduce::reduce_dim_f32 has cognitive complexity 70 (threshold 15). Drivers by points: if/else 29 (39 pts), loops 7 (20 pts), boolean chains 10, match/switch 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.
  • burn_flex::tensor::copy_2d_tiled (cognitive 70) crates/burn-flex/src/tensor.rs:805 — burn_flex::tensor::copy_2d_tiled has cognitive complexity 70 (threshold 15). Drivers by points: loops 16 (64 pts), if/else 5 (6 pts) (nesting depth added 49). 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.
  • burn_flex::ops::slice::slice_write_impl (cognitive 64) crates/burn-flex/src/ops/slice.rs:107 — burn_flex::ops::slice::slice_write_impl has cognitive complexity 64 (threshold 15). Drivers by points: if/else 22 (41 pts), loops 8 (21 pts), boolean chains 2 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • burn_flex::ops::deform_conv::deform_conv2d_f64 (cognitive 62) crates/burn-flex/src/ops/deform_conv.rs:763 — burn_flex::ops::deform_conv::deform_conv2d_f64 has cognitive complexity 62 (threshold 15). Drivers by points: loops 15 (52 pts), if/else 2 (10 pts) (nesting depth added 45). 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.
  • burn_flex::ops::deform_conv::deform_conv2d_backward_f32 (cognitive 60) crates/burn-flex/src/ops/deform_conv.rs:449 — burn_flex::ops::deform_conv::deform_conv2d_backward_f32 has cognitive complexity 60 (threshold 15). Drivers by points: loops 11 (42 pts), if/else 4 (18 pts) (nesting depth added 45). 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.
  • burn_flex::ops::mask::mask_where (cognitive 60) crates/burn-flex/src/ops/mask.rs:251 — burn_flex::ops::mask::mask_where has cognitive complexity 60 (threshold 15). Drivers by points: if/else 22 (42 pts), loops 5 (14 pts), boolean chains 4 (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.
  • burn_flex::ops::attention::flash_attention_head (cognitive 59) crates/burn-flex/src/ops/attention.rs:536 — burn_flex::ops::attention::flash_attention_head has cognitive complexity 59 (threshold 15). Drivers by points: if/else 13 (36 pts), loops 8 (20 pts), boolean chains 3 (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.
  • burn_flex::ops::pool::adaptive_avg_pool3d_impl (cognitive 57) crates/burn-flex/src/ops/pool.rs:995 — burn_flex::ops::pool::adaptive_avg_pool3d_impl has cognitive complexity 57 (threshold 15). Drivers by points: loops 14 (57 pts) (nesting depth added 43). 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.
  • burn_flex::ops::conv::conv3d_impl (cognitive 44) crates/burn-flex/src/ops/conv.rs:238 — burn_flex::ops::conv::conv3d_impl has cognitive complexity 44 (threshold 15). Drivers by points: loops 16 (42 pts), boolean chains 1, if/else 1 (nesting depth added 26). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • burn_flex::ops::gather_scatter::select (cognitive 43) crates/burn-flex/src/ops/gather_scatter.rs:655 — burn_flex::ops::gather_scatter::select has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (28 pts), loops 6 (14 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.
  • burn_flex::ops::deform_conv::deform_conv2d_f32 (cognitive 42) crates/burn-flex/src/ops/deform_conv.rs:124 — burn_flex::ops::deform_conv::deform_conv2d_f32 has cognitive complexity 42 (threshold 15). Drivers by points: loops 16 (39 pts), if/else 2 (3 pts) (nesting depth added 24). 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.
  • burn_flex::ops::gather_scatter::select_2d (cognitive 39) crates/burn-flex/src/ops/gather_scatter.rs:810 — burn_flex::ops::gather_scatter::select_2d has cognitive complexity 39 (threshold 15). Drivers by points: loops 9 (27 pts), if/else 10 (12 pts) (nesting depth added 20). 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.
  • burn_flex::ops::pool::avg_pool3d_impl (cognitive 39) crates/burn-flex/src/ops/pool.rs:680 — burn_flex::ops::pool::avg_pool3d_impl has cognitive complexity 39 (threshold 15). Drivers by points: loops 11 (27 pts), if/else 4 (12 pts) (nesting depth added 24). 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.
  • burn_flex::ops::pool::adaptive_avg_pool3d_backward_impl (cognitive 38) crates/burn-flex/src/ops/pool.rs:1649 — burn_flex::ops::pool::adaptive_avg_pool3d_backward_impl has cognitive complexity 38 (threshold 15). Drivers by points: loops 8 (32 pts), if/else 3 (4 pts), boolean chains 2 (nesting depth added 25). 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.
  • burn_flex::ops::gather_scatter::gather_2d (cognitive 36) crates/burn-flex/src/ops/gather_scatter.rs:283 — burn_flex::ops::gather_scatter::gather_2d has cognitive complexity 36 (threshold 15). Drivers by points: loops 10 (26 pts), if/else 9 (10 pts) (nesting depth added 17). 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.
  • burn_flex::ops::mask::mask_fill (cognitive 34) crates/burn-flex/src/ops/mask.rs:25 — burn_flex::ops::mask::mask_fill has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 3 (8 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.
  • burn_flex::ops::gather_scatter::select_update (cognitive 32) crates/burn-flex/src/ops/gather_scatter.rs:1034 — burn_flex::ops::gather_scatter::select_update has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 5 (11 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.
  • burn_flex::ops::grid_sample::grid_sample_2d_impl (cognitive 32) crates/burn-flex/src/ops/grid_sample.rs:41 — burn_flex::ops::grid_sample::grid_sample_2d_impl has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 4 (10 pts), match/switch 1 (4 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.
  • burn_flex::ops::pool::max_pool3d_with_indices_impl (cognitive 32) crates/burn-flex/src/ops/pool.rs:251 — burn_flex::ops::pool::max_pool3d_with_indices_impl has cognitive complexity 32 (threshold 15). Drivers by points: loops 11 (27 pts), if/else 1 (4 pts), boolean chains 1 (nesting depth added 19). 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.
  • burn_flex::ops::conv::conv_plane_accumulate_oh_outer (cognitive 31) crates/burn-flex/src/ops/conv.rs:1221 — burn_flex::ops::conv::conv_plane_accumulate_oh_outer has cognitive complexity 31 (threshold 15). Drivers by points: loops 5 (16 pts), if/else 5 (13 pts), boolean chains 2 (nesting depth added 19). 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.
  • burn_flex::ops::reduce::reduce_dim_impl (cognitive 31) crates/burn-flex/src/ops/reduce.rs:1199 — burn_flex::ops::reduce::reduce_dim_impl has cognitive complexity 31 (threshold 15). Drivers by points: loops 6 (18 pts), if/else 9 (11 pts), boolean chains 2 (nesting depth added 14). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • burn_flex::ops::attention::naive_attention_head (cognitive 30) crates/burn-flex/src/ops/attention.rs:932 — burn_flex::ops::attention::naive_attention_head has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 4 (7 pts), boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • burn_flex::ops::interpolate::interpolate_bicubic_impl (cognitive 28) crates/burn-flex/src/ops/interpolate.rs:561 — burn_flex::ops::interpolate::interpolate_bicubic_impl has cognitive complexity 28 (threshold 15). Drivers by points: loops 9 (20 pts), if/else 5 (8 pts) (nesting depth added 14). Of this number, 20 points are the body's own statements and 8 belong to one function item inside it that branches. 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.
  • + 25 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×43
  • Duplicated block (8 lines × 2) crates/burn-autodiff/src/ops/tensor.rs:830 — crates/burn-autodiff/src/ops/tensor.rs:830-837 | crates/burn-autodiff/src/ops/tensor.rs:4552-4560 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/tensor.rs:830` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8 lines × 2) crates/burn-autodiff/src/ops/tensor.rs:1328 — crates/burn-autodiff/src/ops/tensor.rs:1328-1335 | crates/burn-autodiff/src/ops/tensor.rs:1636-1643 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/tensor.rs:1328` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/burn-autodiff/src/ops/tensor.rs:1560 — crates/burn-autodiff/src/ops/tensor.rs:1560-1567 | crates/burn-autodiff/src/ops/tensor.rs:2490-2497 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/tensor.rs:1560` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/burn-autodiff/src/ops/tensor.rs:2498` calls `shape` and `crates/burn-autodiff/src/ops/tensor.rs:1568` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) crates/burn-backend-extension/src/derive.rs:253 — crates/burn-backend-extension/src/derive.rs:253-260 | crates/burn-backend-extension/src/derive.rs:279-286 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-backend-extension/src/derive.rs:253` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/burn-backend/src/backend/ops/cat.rs:33 — crates/burn-backend/src/backend/ops/cat.rs:33-40 | crates/burn-backend/src/backend/ops/repeat_dim.rs:32-39 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) crates/burn-backend/src/backend/ops/qtensor.rs:518 — crates/burn-backend/src/backend/ops/qtensor.rs:518-525 | crates/burn-backend/src/backend/ops/qtensor.rs:529-536 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-backend/src/backend/ops/qtensor.rs:518` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/burn-cubecl/src/kernel/conv/conv_transpose2d/col2im.rs:73 — crates/burn-cubecl/src/kernel/conv/conv_transpose2d/col2im.rs:73-80 | crates/burn-cubecl/src/kernel/conv/conv_transpose3d/col2im.rs:91-98 — `crates/burn-cubecl/src/kernel/conv/conv_transpose2d/col2im.rs` and `crates/burn-cubecl/src/kernel/conv/conv_transpose3d/col2im.rs` are one unit implemented 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 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 `crates/burn-cubecl/src/kernel/conv/conv_transpose2d/col2im.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.
  • Duplicated block (8 lines × 2) crates/burn-cubecl/src/kernel/conv/forward/depthwise.rs:49 — crates/burn-cubecl/src/kernel/conv/forward/depthwise.rs:49-56 | crates/burn-cubecl/src/kernel/conv/forward/implicit_gemm/launch.rs:110-117 — 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, `crates/burn-cubecl/src/kernel/conv/forward/depthwise.rs:59` calls `skip_large_filter`, `Err` and `crates/burn-cubecl/src/kernel/conv/forward/implicit_gemm/launch.rs:119` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) crates/burn-cubecl/src/kernel/fft/base.rs:39 — crates/burn-cubecl/src/kernel/fft/base.rs:39-46 | crates/burn-cubecl/src/kernel/fft/base.rs:111-118 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:278 — crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:278-285 | crates/burn-cubecl/src/kernel/pool/max_pool3d.rs:235-242 — before extracting anything, compare `crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs` and `crates/burn-cubecl/src/kernel/pool/max_pool3d.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/pool/avg_pool3d.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 (8 lines × 2) crates/burn-dispatch/src/backend.rs:442 — crates/burn-dispatch/src/backend.rs:442-449 | crates/burn-dispatch/src/backend.rs:484-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 `crates/burn-dispatch/src/backend.rs:442` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/burn-dispatch/src/backend.rs:744 — crates/burn-dispatch/src/backend.rs:744-751 | crates/burn-dispatch/src/backend.rs:772-779 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-dispatch/src/backend.rs:744` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/burn-flex/src/ops/attention.rs:364 — crates/burn-flex/src/ops/attention.rs:364-371 | crates/burn-flex/src/ops/attention.rs:872-879 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) crates/burn-flex/src/ops/conv.rs:893 — crates/burn-flex/src/ops/conv.rs:893-900 | crates/burn-flex/src/ops/conv.rs:1875-1882 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) crates/burn-flex/src/ops/gather_scatter.rs:536 — crates/burn-flex/src/ops/gather_scatter.rs:536-543 | crates/burn-flex/src/ops/gather_scatter.rs:1086-1093 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/gather_scatter.rs:536` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/burn-flex/src/ops/gather_scatter.rs:868 — crates/burn-flex/src/ops/gather_scatter.rs:868-875 | crates/burn-flex/src/ops/gather_scatter.rs:879-886 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/gather_scatter.rs:868` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/burn-flex/src/ops/reduce.rs:2140 — crates/burn-flex/src/ops/reduce.rs:2140-2147 | crates/burn-flex/src/ops/reduce.rs:2261-2268 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/reduce.rs:2140` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/burn-flex/src/ops/reduce.rs:2195 — crates/burn-flex/src/ops/reduce.rs:2195-2202 | crates/burn-flex/src/ops/reduce.rs:2318-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 `crates/burn-flex/src/ops/reduce.rs:2195` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/burn-flex/src/ops/sort.rs:140 — crates/burn-flex/src/ops/sort.rs:140-147 | crates/burn-flex/src/ops/sort.rs:473-480 — both copies are in the same file, so extract the 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) crates/burn-linalg/src/cholesky_gpu.rs:122 — crates/burn-linalg/src/cholesky_gpu.rs:122-129 | crates/burn-linalg/src/cholesky_gpu.rs:131-138 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-linalg/src/cholesky_gpu.rs:122` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/burn-nn/src/modules/conv/conv2d.rs:77 — crates/burn-nn/src/modules/conv/conv2d.rs:77-84 | crates/burn-nn/src/modules/conv/conv_transpose2d.rs:101-108 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) crates/burn-nn/src/modules/norm/group.rs:88 — crates/burn-nn/src/modules/norm/group.rs:88-95 | crates/burn-nn/src/modules/norm/instance.rs:64-71 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) crates/burn-nn/src/modules/pool/avg_pool2d.rs:72 — crates/burn-nn/src/modules/pool/avg_pool2d.rs:72-79 | crates/burn-nn/src/modules/pool/avg_pool3d.rs:68-75 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 2) crates/burn-train/src/metric/processor/full.rs:130 — crates/burn-train/src/metric/processor/full.rs:130-137 | crates/burn-train/src/metric/processor/full.rs:236-243 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) crates/burn-train/src/metric/processor/full.rs:281 — crates/burn-train/src/metric/processor/full.rs:281-288 | crates/burn-train/src/metric/processor/full.rs:354-361 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-train/src/metric/processor/full.rs:281` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • + 18 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×38
  • FunctionTooLong: burn_flex::ops::conv::conv3d_impl crates/burn-flex/src/ops/conv.rs:238 — FunctionTooLong — burn_flex::ops::conv::conv3d_impl runs 217 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 117 over it, 2.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: burn_flex::ops::conv_transpose::conv_transpose3d_impl crates/burn-flex/src/ops/conv_transpose.rs:246 — FunctionTooLong — burn_flex::ops::conv_transpose::conv_transpose3d_impl runs 217 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 117 over it, 2.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: burn_vision::backends::cube::connected_components::hardware_accelerated::hardware_accelerated crates/burn-vision/src/backends/cube/connected_components/hardware_accelerated.rs:477 — FunctionTooLong — burn_vision::backends::cube::connected_components::hardware_accelerated::hardware_accelerated runs 179 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 79 over it, 1.79× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: burn_derive::einsum::expand crates/burn-derive/src/einsum/mod.rs:44 — FunctionTooLong — burn_derive::einsum::expand runs 178 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 78 over it, 1.78× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: burn_flex::ops::deform_conv::deform_conv2d_f32 crates/burn-flex/src/ops/deform_conv.rs:124 — FunctionTooLong — burn_flex::ops::deform_conv::deform_conv2d_f32 runs 167 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 67 over it, 1.67× 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: burn_flex::ops::deform_conv::deform_conv2d_backward_f32 crates/burn-flex/src/ops/deform_conv.rs:449 — FunctionTooLong — burn_flex::ops::deform_conv::deform_conv2d_backward_f32 runs 165 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 65 over it, 1.65× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: burn_backend::backend::ops::modules::grid_sample::float_grid_sample_2d_bilinear crates/burn-backend/src/backend/ops/modules/grid_sample.rs:41 — FunctionTooLong — burn_backend::backend::ops::modules::grid_sample::float_grid_sample_2d_bilinear runs 162 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 62 over it, 1.62× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: burn_vision::backends::cpu::connected_components::spaghetti::process crates/burn-vision/src/backends/cpu/connected_components/spaghetti/mod.rs:32 — FunctionTooLong — burn_vision::backends::cpu::connected_components::spaghetti::process runs 160 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 60 over it, 1.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: burn_optim::optim::lbfgs::strong_wolfe crates/burn-optim/src/optim/lbfgs.rs:71 — FunctionTooLong — burn_optim::optim::lbfgs::strong_wolfe runs 157 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 57 over it, 1.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: burn_linalg::cholesky_gpu::panel crates/burn-linalg/src/cholesky_gpu.rs:76 — FunctionTooLong — burn_linalg::cholesky_gpu::panel runs 148 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 48 over it, 1.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: burn_backend_extension::fusion::derive_adapter crates/burn-backend-extension/src/fusion.rs:290 — FunctionTooLong — burn_backend_extension::fusion::derive_adapter runs 144 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 44 over it, 1.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: burn_cubecl::kernel::ctc::ctc_alpha_beta_kernel crates/burn-cubecl/src/kernel/ctc.rs:394 — FunctionTooLong — burn_cubecl::kernel::ctc::ctc_alpha_beta_kernel runs 141 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 41 over it, 1.41× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: burn_flex::ops::reduce::reduce_dim_f32 crates/burn-flex/src/ops/reduce.rs:858 — FunctionTooLong — burn_flex::ops::reduce::reduce_dim_f32 runs 135 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 35 over it, 1.35× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: burn_vision::backends::cube::connected_components::prefix_sum::prefix_sum_kernel crates/burn-vision/src/backends/cube/connected_components/prefix_sum.rs:18 — FunctionTooLong — burn_vision::backends::cube::connected_components::prefix_sum::prefix_sum_kernel runs 134 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 34 over it, 1.34× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: burn_flex::ops::fft::irfft_f32 crates/burn-flex/src/ops/fft.rs:1373 — FunctionTooLong — burn_flex::ops::fft::irfft_f32 runs 131 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 31 over it, 1.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: burn_linalg::solve_cubecl::blocked_rhs crates/burn-linalg/src/solve_cubecl.rs:803 — FunctionTooLong — burn_linalg::solve_cubecl::blocked_rhs runs 131 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 31 over it, 1.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: burn_flex::ops::attention::attention_naive_impl crates/burn-flex/src/ops/attention.rs:754 — FunctionTooLong — burn_flex::ops::attention::attention_naive_impl runs 130 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 30 over it, 1.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: burn_flex::ops::deform_conv::deform_conv2d_f64 crates/burn-flex/src/ops/deform_conv.rs:763 — FunctionTooLong — burn_flex::ops::deform_conv::deform_conv2d_f64 runs 130 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 30 over it, 1.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: burn_flex::ops::attention::attention_impl crates/burn-flex/src/ops/attention.rs:248 — FunctionTooLong — burn_flex::ops::attention::attention_impl runs 128 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 28 over it, 1.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: burn_cubecl::kernel::conv::backward_data::tune::dgrad_autotune crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs:25 — FunctionTooLong — burn_cubecl::kernel::conv::backward_data::tune::dgrad_autotune runs 122 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 22 over it, 1.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: burn_flex::ops::attention::flash_attention_head crates/burn-flex/src/ops/attention.rs:536 — FunctionTooLong — burn_flex::ops::attention::flash_attention_head runs 122 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 22 over it, 1.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: burn_cubecl::kernel::conv::backward_weight::tune::wgrad_autotune crates/burn-cubecl/src/kernel/conv/backward_weight/tune.rs:28 — FunctionTooLong — burn_cubecl::kernel::conv::backward_weight::tune::wgrad_autotune runs 120 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 20 over it, 1.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: burn_cubecl::ops::qtensor::new_quantized crates/burn-cubecl/src/ops/qtensor.rs:84 — FunctionTooLong — burn_cubecl::ops::qtensor::new_quantized runs 118 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 18 over it, 1.18× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: burn_linalg::solve_cubecl::solve crates/burn-linalg/src/solve_cubecl.rs:1008 — FunctionTooLong — burn_linalg::solve_cubecl::solve runs 113 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 13 over it, 1.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: burn_flex::ops::conv::conv3d_1x1_impl crates/burn-flex/src/ops/conv.rs:850 — FunctionTooLong — burn_flex::ops::conv::conv3d_1x1_impl runs 111 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 11 over it, 1.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 13 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×35
  • Duplicated block (9 lines × 2) crates/burn-autodiff/src/ops/tensor.rs:478 — crates/burn-autodiff/src/ops/tensor.rs:478-486 | crates/burn-autodiff/src/ops/tensor.rs:576-584 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/tensor.rs:478` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/burn-autodiff/src/ops/tensor.rs:1528 — crates/burn-autodiff/src/ops/tensor.rs:1528-1536 | crates/burn-autodiff/src/ops/tensor.rs:1773-1781 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/tensor.rs:1528` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/burn-autodiff/src/ops/tensor.rs:2336 — crates/burn-autodiff/src/ops/tensor.rs:2336-2344 | crates/burn-autodiff/src/ops/tensor.rs:2398-2406 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/tensor.rs:2336` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/burn-autodiff/src/ops/tensor.rs:2672 — crates/burn-autodiff/src/ops/tensor.rs:2672-2680 | crates/burn-autodiff/src/ops/tensor.rs:2709-2717 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/tensor.rs:2672` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/burn-backend/src/backend/ops/modules/conv.rs:998 — crates/burn-backend/src/backend/ops/modules/conv.rs:998-1006 | crates/burn-backend/src/backend/ops/modules/conv.rs:1279-1287 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-backend/src/backend/ops/modules/conv.rs:998` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/burn-backend/src/backend/ops/modules/ctc.rs:492 — crates/burn-backend/src/backend/ops/modules/ctc.rs:492-500 | crates/burn-backend/src/backend/ops/modules/ctc.rs:513-521 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-backend/src/backend/ops/modules/ctc.rs:492` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/burn-cubecl-fusion/src/engine/codegen/io.rs:543 — crates/burn-cubecl-fusion/src/engine/codegen/io.rs:543-551 | crates/burn-cubecl-fusion/src/engine/codegen/io.rs:573-581 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl-fusion/src/engine/codegen/io.rs:543` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/burn-cubecl/src/kernel/binary.rs:199 — crates/burn-cubecl/src/kernel/binary.rs:199-207 | crates/burn-cubecl/src/kernel/binary_int.rs:146-154 — before extracting anything, compare `crates/burn-cubecl/src/kernel/binary.rs` and `crates/burn-cubecl/src/kernel/binary_int.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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) crates/burn-cubecl/src/kernel/binary_float.rs:53 — crates/burn-cubecl/src/kernel/binary_float.rs:53-61 | crates/burn-cubecl/src/kernel/binary_float.rs:82-90 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) crates/burn-cubecl/src/kernel/comparison.rs:165 — crates/burn-cubecl/src/kernel/comparison.rs:165-173 | crates/burn-cubecl/src/kernel/comparison.rs:255-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.
  • Duplicated block (9 lines × 2) crates/burn-cubecl/src/kernel/conv/conv_transpose2d/col2im.rs:98 — crates/burn-cubecl/src/kernel/conv/conv_transpose2d/col2im.rs:98-106 | crates/burn-cubecl/src/kernel/conv/conv_transpose3d/col2im.rs:124-132 — `crates/burn-cubecl/src/kernel/conv/conv_transpose2d/col2im.rs` and `crates/burn-cubecl/src/kernel/conv/conv_transpose3d/col2im.rs` are one unit implemented 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 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 `crates/burn-cubecl/src/kernel/conv/conv_transpose2d/col2im.rs:98` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/burn-cubecl/src/kernel/conv/conv_transpose3d/col2im.rs:57 — crates/burn-cubecl/src/kernel/conv/conv_transpose3d/col2im.rs:57-80 | crates/burn-flex/src/ops/conv_transpose.rs:286-294 — 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) crates/burn-cubecl/src/kernel/conv/unit.rs:104 — crates/burn-cubecl/src/kernel/conv/unit.rs:104-112 | crates/burn-cubecl/src/kernel/conv/unit.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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/conv/unit.rs:104` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/burn-cubecl/src/kernel/fft/base.rs:13 — crates/burn-cubecl/src/kernel/fft/base.rs:13-21 | crates/burn-signal/src/backends/autodiff.rs:149-157 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/fft/base.rs:13` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/burn-cubecl/src/kernel/index/gather.rs:45 — crates/burn-cubecl/src/kernel/index/gather.rs:45-53 | crates/burn-cubecl/src/kernel/index/gather_nd.rs:82-90 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) crates/burn-cubecl/src/kernel/index/slice.rs:182 — crates/burn-cubecl/src/kernel/index/slice.rs:182-190 | crates/burn-cubecl/src/ops/bool_tensor.rs:87-95 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/index/slice.rs:182` it does not close everything it opens, so those 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 `tensor` to `CubeTensor` in one and `BoolTensor<Self>` 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) crates/burn-dataset/src/nlp/text_folder.rs:293 — crates/burn-dataset/src/nlp/text_folder.rs:293-301 | crates/burn-dataset/src/vision/image_folder.rs:750-758 — 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) crates/burn-dispatch/src/tensor.rs:39 — crates/burn-dispatch/src/tensor.rs:39-47 | crates/burn-dispatch/src/tensor.rs:50-58 — both copies are in the same file, so extract the 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) crates/burn-flex/src/ops/interpolate.rs:276 — crates/burn-flex/src/ops/interpolate.rs:276-284 | crates/burn-flex/src/ops/interpolate.rs:944-952 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/interpolate.rs:276` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (9 lines × 2) crates/burn-flex/src/ops/matmul.rs:522 — crates/burn-flex/src/ops/matmul.rs:522-530 | crates/burn-flex/src/ops/matmul.rs:758-766 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/matmul.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.
  • Duplicated block (9 lines × 2) crates/burn-flex/src/ops/matmul.rs:688 — crates/burn-flex/src/ops/matmul.rs:688-696 | crates/burn-flex/src/ops/matmul.rs:842-850 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/burn-flex/src/ops/matmul.rs:687` calls `iter`, `product` and `crates/burn-flex/src/ops/matmul.rs:840` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) crates/burn-flex/src/ops/pool.rs:363 — crates/burn-flex/src/ops/pool.rs:363-371 | crates/burn-flex/src/ops/pool.rs:795-803 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/pool.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 (9 lines × 2) crates/burn-flex/src/ops/reduce.rs:1875 — crates/burn-flex/src/ops/reduce.rs:1875-1883 | crates/burn-flex/src/ops/reduce.rs:2089-2097 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/reduce.rs:1875` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/burn-flex/src/ops/reduce.rs:1932 — crates/burn-flex/src/ops/reduce.rs:1932-1940 | crates/burn-flex/src/ops/reduce.rs:2032-2040 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/reduce.rs:1932` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) crates/burn-flex/src/ops/unary.rs:238 — crates/burn-flex/src/ops/unary.rs:238-246 | crates/burn-flex/src/ops/unary.rs:269-277 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/unary.rs:238` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 10 more in this group — see findings.md.
D35 · Change Coupling · Change coupling · ×31
  • Change coupling: int_tensor.rs ↔ int_tensor.rs crates/burn-fusion/src/ops/int_tensor.rs:1 — `crates/burn-fusion/src/ops/int_tensor.rs` and `crates/burn-router/src/ops/int_tensor.rs` change together 100% of the time (11 of the 11 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 11 shared commits counted here, the most recent 3 are `fac78653` refactor(backend): remove specialized indexing add operations (#5523); `98817560` refactor(tensor): move padding operations to backend (#5505); `8a933f84` feat(ndarray): support assign indexing updates for floats and ints (#… — run `git show` on any of them.
  • Change coupling: conv1d.rs ↔ conv2d.rs crates/burn-nn/src/modules/conv/conv1d.rs:1 — `crates/burn-nn/src/modules/conv/conv1d.rs` and `crates/burn-nn/src/modules/conv/conv2d.rs` change together 84% of the time (21 of the 25 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 21 shared commits counted here, the most recent 3 are `24e0753a` fix(nn): use effective kernels for dilated Same padding (#6286); `7b815b01` feat(backend)!: support asymmetric padding in conv1d and conv2d (#5521); `f6754f53` fix(nn): conv1d initializer fan out (#4973) — run `git show` on any of them.
  • Change coupling: dequantize.rs ↔ quantize.rs crates/burn-cubecl/src/kernel/quantization/dequantize.rs:1 — `crates/burn-cubecl/src/kernel/quantization/dequantize.rs` and `crates/burn-cubecl/src/kernel/quantization/quantize.rs` change together 80% of the time (8 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `996a7b44` Refactor/quant (#3500); `9125b55c` Add quantization params precision (#3453); `9c347226` Feat/quant block (#3442) — run `git show` on any of them.
  • Change coupling: avg_pool1d.rs ↔ avg_pool2d.rs crates/burn-nn/src/modules/pool/avg_pool1d.rs:1 — `crates/burn-nn/src/modules/pool/avg_pool1d.rs` and `crates/burn-nn/src/modules/pool/avg_pool2d.rs` change together 80% of the time (8 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `9adff026` refactor(tensor)!: move pooling args into options structs with asymme…; `986f0c1d` fix(nn): honor count_include_pad for asymmetric average pooling (#5592); `c0c12f53` [Breaking] Add asymmetric padding support for conv and pool operation… — run `git show` on any of them.
  • Change coupling: input.rs ↔ output.rs crates/burn-cubecl-fusion/src/engine/launch/input.rs:1 — `crates/burn-cubecl-fusion/src/engine/launch/input.rs` and `crates/burn-cubecl-fusion/src/engine/launch/output.rs` change together 79% of the time (11 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency 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 11 shared commits counted here, the most recent 3 are `5c1b6126` feat(fusion): fused elementwise kernels walk storage tiles; quant tes…; `9ef29431` Qa/tiled storage (#5839); `df92ec07` Feat/storage tiled carrier (#5631) — run `git show` on any of them.
  • Change coupling: task.rs ↔ base.rs crates/burn-remote/src/shared/task.rs:1 — `crates/burn-remote/src/shared/task.rs` and `crates/burn-router/src/client/base.rs` change together 76% of the time (13 of the 17 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 13 shared commits counted here, the most recent 3 are `4bf94e7d` feat(environment): ComputeEnvironment::prune keeps what the work load…; `27722e5f` ComputeEnvironment::merge: bring another environment's entries in (#6…; `f4a7b07f` ComputeEnvironment: a device's compiled kernels and autotune answers,… — run `git show` on any of them.
  • Change coupling: module.rs ↔ context.rs crates/burn-fusion/src/ops/module.rs:1 — `crates/burn-fusion/src/ops/module.rs` and `crates/burn-fusion/src/stream/context.rs` change together 76% of the time (16 of the 21 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 16 shared commits counted here, the most recent 3 are `c9b05685` feat: attention over a key/value cache; MatmulCall without routes (#6…; `3309eb6d` feat: native attention backward pass (#6209); `ff556ce6` feat(tensor)!: add dilation to average pooling (#6235) — run `git show` on any of them.
  • Change coupling: decoder.rs ↔ encoder.rs crates/burn-nn/src/modules/transformer/decoder.rs:1 — `crates/burn-nn/src/modules/transformer/decoder.rs` and `crates/burn-nn/src/modules/transformer/encoder.rs` change together 75% of the time (9 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 9 shared commits counted here, the most recent 3 are `a2ab9f84` perf(nn): avoid historical query attention in cached inference (#6125); `0788ef62` Add configurable activation and layer_norm_eps to transformer layers …; `ab162f68` Make TransformerEncoderLayer and TransformerDecoderLayer methods publ… — run `git show` on any of them.
  • Change coupling: backend.rs ↔ backend.rs crates/burn-cubecl/src/backend.rs:1 — `crates/burn-cubecl/src/backend.rs` and `crates/burn-fusion/src/backend.rs` change together 67% of the time (20 of the 30 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 20 shared commits counted here, the most recent 3 are `4bf94e7d` feat(environment): ComputeEnvironment::prune keeps what the work load…; `27722e5f` ComputeEnvironment::merge: bring another environment's entries in (#6…; `f4a7b07f` ComputeEnvironment: a device's compiled kernels and autotune answers,… — run `git show` on any of them.
  • Change coupling: context.rs ↔ module.rs crates/burn-fusion/src/stream/context.rs:1 — `crates/burn-fusion/src/stream/context.rs` and `crates/burn-router/src/ops/module.rs` change together 67% of the time (10 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `c9b05685` feat: attention over a key/value cache; MatmulCall without routes (#6…; `3309eb6d` feat: native attention backward pass (#6209); `ff556ce6` feat(tensor)!: add dilation to average pooling (#6235) — run `git show` on any of them.
  • Change coupling: server.rs ↔ base.rs crates/burn-fusion/src/server.rs:1 — `crates/burn-fusion/src/server.rs` and `crates/burn-fusion/src/tensor/base.rs` change together 62% of the time (8 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `7bc1dd62` perf(fusion): defer a cross-thread drop until its producer runs inste…; `3fb74589` fix(fusion): a panicking operation must not poison its stream (#5535) (at that commit the file was still `crates/burn-fusion/src/tensor.rs`); `62ca8c58` Fix/fusion read composition (#5282) (at that commit the file was still `crates/burn-fusion/src/tensor.rs`) — run `git show` on any of them.
  • Change coupling: dropout.rs ↔ layer.rs crates/burn-nn/src/modules/dropout.rs:1 — `crates/burn-nn/src/modules/dropout.rs` and `crates/burn-nn/src/modules/norm/layer.rs` change together 62% of the time (8 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `2c516154` Print model structure like with PyTorch - Part 1 (#1912) (at that commit the files were still `crates/burn-core/src/nn/dropout.rs` and `crates/burn-core/src/nn/norm/layer.rs`); `7d750468` Refactor/init modules (#250) (at that commit the files were still `burn-core/src/nn/dropout.rs` and `burn-core/src/nn/norm/layer.rs`); `46d06f0c` feat: module init (#117) (at that commit the files were still `burn/src/nn/dropout.rs` and `burn/src/nn/layer_norm.rs`) — run `git show` on any of them.
  • Change coupling: conv2d.rs ↔ max_pool2d.rs crates/burn-nn/src/modules/conv/conv2d.rs:1 — `crates/burn-nn/src/modules/conv/conv2d.rs` and `crates/burn-nn/src/modules/pool/max_pool2d.rs` change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `c0c12f53` [Breaking] Add asymmetric padding support for conv and pool operation…; `2c516154` Print model structure like with PyTorch - Part 1 (#1912) (at that commit the files were still `crates/burn-core/src/nn/conv/conv2d.rs` and `crates/burn-core/src/nn/pool/max_pool2d.rs`); `e066d95d` Implement padding for conv2d (#523) (at that commit the files were still `burn-core/src/nn/conv/conv2d.rs` and `burn-core/src/nn/pool/max_pool2d.rs`) — run `git show` on any of them.
  • Change coupling: tensor.rs ↔ float.rs crates/burn-fusion/src/ops/tensor.rs:1 — `crates/burn-fusion/src/ops/tensor.rs` and `crates/burn-tensor/src/bridge/ops/float.rs` change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `04e0f2de` perf(autodiff): reduce a broadcast gradient over all dims at once (#5…; `5f74b393` feat(tensor): add batched SVD decomposition to linalg (#5259); `98817560` refactor(tensor): move padding operations to backend (#5505) — run `git show` on any of them.
  • Change coupling: embedding.rs ↔ linear.rs crates/burn-nn/src/modules/embedding.rs:1 — `crates/burn-nn/src/modules/embedding.rs` and `crates/burn-nn/src/modules/linear.rs` change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `9a1bc890` feat(instrument): price components in a run of their own (#6196); `e5cc50a8` refactor/initializer (#398) (at that commit the files were still `burn-core/src/nn/embedding.rs` and `burn-core/src/nn/linear.rs`); `37b79bcc` Add init_with for nn modules (#280) (at that commit the files were still `burn-core/src/nn/embedding.rs` and `burn-core/src/nn/linear.rs`) — run `git show` on any of them.
  • Change coupling: gather.rs ↔ scatter.rs crates/burn-cubecl/src/kernel/index/gather.rs:1 — `crates/burn-cubecl/src/kernel/index/gather.rs` and `crates/burn-cubecl/src/kernel/index/scatter.rs` change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `b340f100` feat(tensor): support smaller gather/scatter indices on non-indexed d…; `79cd3d5d` Fix gather unchecked kernel (#2206) (at that commit the files were still `crates/burn-jit/src/kernel/index/gather.rs` and `crates/burn-jit/src/kernel/index/scatter.rs`); `57887e7a` Refactor/elemwise/kernel selection + dynamic fused inplace operations… (at that commit the files were still `crates/burn-wgpu/src/kernel/index/gather.rs` and `crates/burn-wgpu/src/kernel/index/scatter.rs`) — run `git show` on any of them.
  • Change coupling: binary.rs ↔ clamp.rs crates/burn-cubecl/src/kernel/binary.rs:1 — `crates/burn-cubecl/src/kernel/binary.rs` and `crates/burn-cubecl/src/kernel/clamp.rs` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — 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 `ee09bc30` chore: Update to refactor cubecl types and traits (#4297); `2b4be6ca` Refactor unary + binary kernels (#2665) (at that commit the files were still `crates/burn-jit/src/kernel/binary.rs` and `crates/burn-jit/src/kernel/clamp.rs`); `44802b98` Update CubeCL (#2310) (at that commit the files were still `crates/burn-jit/src/kernel/binary.rs` and `crates/burn-jit/src/kernel/clamp.rs`) — run `git show` on any of them.
  • Change coupling: bool_tensor.rs ↔ base.rs crates/burn-backend/src/backend/ops/bool_tensor.rs:1 — `crates/burn-backend/src/backend/ops/bool_tensor.rs` and `crates/burn-tensor/src/tensor/api/base.rs` change together 54% of the time (13 of the 24 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 13 shared commits counted here, the most recent 3 are `ed6bd9af` feat(tensor)!: support scatter_nd and gather_nd for bool tensors (#6047); `0d3e286b` feat(tensor)!: support all indexing update ops for bool scatter and s…; `d2ab1dd8` feat(backend): promote mask_select to a backend op with dispatch (#5283) — run `git show` on any of them.
  • Change coupling: int_tensor.rs ↔ numeric.rs crates/burn-autodiff/src/ops/int_tensor.rs:1 — `crates/burn-autodiff/src/ops/int_tensor.rs` and `crates/burn-tensor/src/tensor/api/numeric.rs` change together 54% of the time (15 of the 28 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 15 shared commits counted here, the most recent 3 are `7377bbe3` Feat/remainder (#1597); `47a84cc9` Add tensor sorting operations (#1488); `7a98b2f6` Add prod and prod_dim tensor ops (#1460) — run `git show` on any of them.
  • Change coupling: bool_tensor.rs ↔ base.rs crates/burn-autodiff/src/ops/bool_tensor.rs:1 — `crates/burn-autodiff/src/ops/bool_tensor.rs` and `crates/burn-tensor/src/tensor/api/base.rs` change together 53% of the time (8 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `ed6bd9af` feat(tensor)!: support scatter_nd and gather_nd for bool tensors (#6047); `0d3e286b` feat(tensor)!: support all indexing update ops for bool scatter and s…; `d2ab1dd8` feat(backend): promote mask_select to a backend op with dispatch (#5283) — run `git show` on any of them.
  • Change coupling: activation_wrapper.rs ↔ base.rs crates/burn-nn/src/activation/activation_wrapper.rs:1 — `crates/burn-nn/src/activation/activation_wrapper.rs` and `crates/burn-tensor/src/tensor/activation/base.rs` change together 53% of the time (8 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `41edd46d` Implement HardShrink, SoftShrink and Shrink Activations (#4556); `ddd6438d` Add Selu activation function (#4439); `2467282e` Add CELU activation function (#4441) — run `git show` on any of them.
  • Change coupling: module.rs ↔ module.rs crates/burn-autodiff/src/ops/module.rs:1 — `crates/burn-autodiff/src/ops/module.rs` and `crates/burn-cubecl/src/ops/module.rs` change together 53% of the time (18 of the 34 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 18 shared commits counted here, the most recent 3 are `c9b05685` feat: attention over a key/value cache; MatmulCall without routes (#6…; `3309eb6d` feat: native attention backward pass (#6209); `ff556ce6` feat(tensor)!: add dilation to average pooling (#6235) — run `git show` on any of them.
  • Change coupling: bool_tensor.rs ↔ int_tensor.rs crates/burn-cubecl/src/ops/bool_tensor.rs:1 — `crates/burn-cubecl/src/ops/bool_tensor.rs` and `crates/burn-cubecl/src/ops/int_tensor.rs` change together 53% of the time (10 of the 19 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `8288fdfb` feat(cubecl): wire logical any/all reductions (#5051); `6cf0e55d` fix: Select assign + bool cast (#3730) (at that commit the files were still `crates/burn-cubecl/src/ops/bool_ops.rs` and `crates/burn-cubecl/src/ops/int_ops.rs`); `d2747ae8` Remove from_data conversions in backends (#2783) (at that commit the files were still `crates/burn-jit/src/ops/bool_ops.rs` and `crates/burn-jit/src/ops/int_ops.rs`) — run `git show` on any of them.
  • Change coupling: base.rs ↔ builder.rs crates/burn-backend/src/backend/ops/modules/base.rs:1 — `crates/burn-backend/src/backend/ops/modules/base.rs` and `crates/burn-ir/src/builder.rs` change together 52% of the time (11 of the 21 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 11 shared commits counted here, the most recent 3 are `c9b05685` feat: attention over a key/value cache; MatmulCall without routes (#6…; `3309eb6d` feat: native attention backward pass (#6209); `ff556ce6` feat(tensor)!: add dilation to average pooling (#6235) — run `git show` on any of them.
  • Change coupling: bool_tensor.rs ↔ int_tensor.rs crates/burn-backend/src/backend/ops/bool_tensor.rs:1 — `crates/burn-backend/src/backend/ops/bool_tensor.rs` and `crates/burn-backend/src/backend/ops/int_tensor.rs` change together 50% of the time (12 of the 24 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 12 shared commits counted here, the most recent 3 are `d2ab1dd8` feat(backend): promote mask_select to a backend op with dispatch (#5283); `8fbb0a18` Handle empty tensors in cat and slice_assign ops (#4095) (at that commit the files were still `crates/burn-tensor/src/tensor/ops/bool_tensor.rs` and `crates/burn-tensor/src/tensor/ops/int_tensor.rs`); `4f53d9d8` Fix Slice operation to handle empty ranges (#4083) (at that commit the files were still `crates/burn-tensor/src/tensor/ops/bool_tensor.rs` and `crates/burn-tensor/src/tensor/ops/int_tensor.rs`) — run `git show` on any of them.
  • + 6 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×30
  • Duplicated block (5 lines × 2) crates/burn-autodiff/src/ops/tensor.rs:227 — crates/burn-autodiff/src/ops/tensor.rs:227-231 | crates/burn-autodiff/src/ops/tensor.rs:296-300 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/tensor.rs:227` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/burn-autodiff/src/ops/tensor.rs:1098 — crates/burn-autodiff/src/ops/tensor.rs:1098-1102 | crates/burn-autodiff/src/ops/tensor.rs:4635-4639 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/tensor.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 (5 lines × 2) crates/burn-autodiff/src/ops/tensor.rs:2473 — crates/burn-autodiff/src/ops/tensor.rs:2473-2477 | crates/burn-autodiff/src/ops/tensor.rs:2479-2483 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/tensor.rs:2473` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/burn-backend/src/backend/ops/pad.rs:123 — crates/burn-backend/src/backend/ops/pad.rs:123-127 | crates/burn-backend/src/backend/ops/pad.rs:137-143 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-backend/src/backend/ops/pad.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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) crates/burn-flex/src/ops/activation.rs:423 — crates/burn-flex/src/ops/activation.rs:423-427 | crates/burn-flex/src/ops/activation.rs:1052-1059 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/activation.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 (5 lines × 2) crates/burn-flex/src/ops/binary.rs:277 — crates/burn-flex/src/ops/binary.rs:277-281 | crates/burn-flex/src/ops/comparison.rs:316-321 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/binary.rs:277` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/burn-flex/src/ops/pool.rs:342 — crates/burn-flex/src/ops/pool.rs:342-346 | crates/burn-flex/src/ops/pool.rs:368-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 `crates/burn-flex/src/ops/pool.rs:342` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/burn-flex/src/ops/sort.rs:179 — crates/burn-flex/src/ops/sort.rs:179-183 | crates/burn-flex/src/ops/sort.rs:522-526 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/sort.rs:179` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/burn-flex/src/ops/sort.rs:521` calls `iter`, `to_f32`, `collect` and `crates/burn-flex/src/ops/sort.rs:178` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) crates/burn-flex/src/ops/sort.rs:307 — crates/burn-flex/src/ops/sort.rs:307-311 | crates/burn-flex/src/ops/sort.rs:343-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.
  • Duplicated block (5 lines × 2) crates/burn-ir/src/operation.rs:5029 — crates/burn-ir/src/operation.rs:5029-5033 | crates/burn-ir/src/operation.rs:5042-5046 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) crates/burn-linalg/src/functions/lu.rs:138 — crates/burn-linalg/src/functions/lu.rs:138-142 | crates/burn-linalg/src/functions/lu.rs:247-251 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) crates/burn-linalg/src/functions/lu.rs:296 — crates/burn-linalg/src/functions/lu.rs:296-302 | crates/burn-linalg/src/functions/qr.rs:69-73 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) crates/burn-nn/src/modules/conv/conv_transpose2d.rs:91 — crates/burn-nn/src/modules/conv/conv_transpose2d.rs:91-95 | crates/burn-nn/src/modules/conv/conv_transpose3d.rs:91-95 — before extracting anything, compare `crates/burn-nn/src/modules/conv/conv_transpose2d.rs` and `crates/burn-nn/src/modules/conv/conv_transpose3d.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-nn/src/modules/conv/conv_transpose2d.rs:91` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/burn-nn/src/modules/fold.rs:59 — crates/burn-nn/src/modules/fold.rs:59-63 | crates/burn-nn/src/modules/unfold.rs:52-56 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-nn/src/modules/fold.rs:59` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/burn-nn/src/modules/fold.rs:57` calls `add` and `crates/burn-nn/src/modules/unfold.rs:50` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) crates/burn-nn/src/modules/pool/max_pool2d.rs:67 — crates/burn-nn/src/modules/pool/max_pool2d.rs:67-71 | crates/burn-nn/src/modules/pool/max_pool3d.rs:69-73 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-nn/src/modules/pool/max_pool2d.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.
  • Duplicated block (5 lines × 2) crates/burn-store/src/bridge.rs:57 — crates/burn-store/src/bridge.rs:57-61 | crates/burn-store/src/safetensors/store.rs:1009-1013 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) crates/burn-train/src/metric/processor/minimal.rs:76 — crates/burn-train/src/metric/processor/minimal.rs:76-80 | crates/burn-train/src/metric/processor/minimal.rs:136-140 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-train/src/metric/processor/minimal.rs:76` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (5 lines × 2) crates/burn-vision/src/backends/cpu/connected_components/spaghetti/mod.rs:179 — crates/burn-vision/src/backends/cpu/connected_components/spaghetti/mod.rs:179-183 | crates/burn-vision/src/backends/cpu/connected_components/spaghetti/mod.rs:245-249 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-vision/src/backends/cpu/connected_components/spaghetti/mod.rs:179` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:1142 — crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:1142-1146 | crates/burn-cubecl/src/kernel/binary_float.rs:121-125 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) crates/burn-cubecl-fusion/src/optim/reduce/tune.rs:160 — crates/burn-cubecl-fusion/src/optim/reduce/tune.rs:160-164 | crates/burn-cubecl-fusion/src/optim/reduce_broadcasted/tune.rs:146-150 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl-fusion/src/optim/reduce/tune.rs:160` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `input` to `TuneInput<ReduceOptimizationTuneArg>` in one and `TuneInput<ReduceBroadcastedOptimizationTuneArg>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (5 lines × 2) crates/burn-nn/src/modules/pool/adaptive_avg_pool2d.rs:36 — crates/burn-nn/src/modules/pool/adaptive_avg_pool2d.rs:36-40 | crates/burn-nn/src/modules/pool/adaptive_avg_pool3d.rs:36-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 both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) crates/burn-train/src/renderer/cli.rs:76 — crates/burn-train/src/renderer/cli.rs:76-80 | crates/burn-train/src/renderer/tui/renderer.rs:261-265 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) crates/burn-backend-extension/src/fusion.rs:341 — crates/burn-backend-extension/src/fusion.rs:341-345 | crates/burn-backend-extension/src/remote.rs:395-399 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) crates/burn-cubecl/src/ops/collective.rs:35 — crates/burn-cubecl/src/ops/collective.rs:35-39 | crates/burn-cubecl/src/ops/collective.rs:88-92 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/ops/collective.rs:35` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/burn-flex/src/ops/mask.rs:83 — crates/burn-flex/src/ops/mask.rs:83-87 | crates/burn-flex/src/ops/mask.rs:375-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 `crates/burn-flex/src/ops/mask.rs:83` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 5 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×28
  • Duplicated block (7 lines × 2) crates/burn-backend/src/backend/ops/collective.rs:280 — crates/burn-backend/src/backend/ops/collective.rs:280-286 | crates/burn-backend/src/backend/ops/collective.rs:307-313 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-backend/src/backend/ops/collective.rs:280` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/burn-backend/src/backend/ops/modules/conv.rs:941 — crates/burn-backend/src/backend/ops/modules/conv.rs:941-947 | crates/burn-backend/src/backend/ops/modules/conv.rs:973-979 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-backend/src/backend/ops/modules/conv.rs:941` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/burn-communication/src/websocket/server.rs:168 — crates/burn-communication/src/websocket/server.rs:168-177 | crates/burn-communication/src/websocket/server.rs:246-252 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-communication/src/websocket/server.rs:168` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/burn-cubecl-fusion/src/engine/fuser.rs:389 — crates/burn-cubecl-fusion/src/engine/fuser.rs:389-395 | crates/burn-cubecl-fusion/src/engine/fuser.rs:409-415 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl-fusion/src/engine/fuser.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 (7 lines × 2) crates/burn-cubecl-fusion/src/engine/trace/block.rs:108 — crates/burn-cubecl-fusion/src/engine/trace/block.rs:108-114 | crates/burn-cubecl-fusion/src/engine/trace/block.rs:163-169 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl-fusion/src/engine/trace/block.rs:108` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/burn-cubecl/src/kernel/conv/backward_weight/fallback.rs:95 — crates/burn-cubecl/src/kernel/conv/backward_weight/fallback.rs:95-101 | crates/burn-cubecl/src/kernel/conv/backward_weight/fallback.rs:121-127 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/conv/backward_weight/fallback.rs:95` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/burn-cubecl/src/kernel/ctc.rs:342 — crates/burn-cubecl/src/kernel/ctc.rs:342-348 | crates/burn-cubecl/src/kernel/ctc.rs:637-643 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:278 — crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:278-284 | crates/burn-cubecl/src/kernel/pool/max_pool3d.rs:116-122 — before extracting anything, compare `crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs` and `crates/burn-cubecl/src/kernel/pool/max_pool3d.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 2) crates/burn-cubecl/src/kernel/pool/base.rs:101 — crates/burn-cubecl/src/kernel/pool/base.rs:101-107 | crates/burn-cubecl/src/kernel/pool/max_pool3d.rs:282-288 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) crates/burn-dataset/src/vision/mnist.rs:190 — crates/burn-dataset/src/vision/mnist.rs:190-196 | crates/burn-dataset/src/vision/mnist.rs:240-246 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-dataset/src/vision/mnist.rs:190` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/burn-flex/src/ops/binary.rs:213 — crates/burn-flex/src/ops/binary.rs:213-230 | crates/burn-flex/src/ops/binary.rs:233-239 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/binary.rs:213` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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) crates/burn-flex/src/ops/conv_transpose.rs:505 — crates/burn-flex/src/ops/conv_transpose.rs:505-511 | crates/burn-flex/src/ops/conv_transpose.rs:514-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/conv_transpose.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.
  • Duplicated block (7 lines × 2) crates/burn-flex/src/ops/cumulative.rs:79 — crates/burn-flex/src/ops/cumulative.rs:79-85 | crates/burn-flex/src/ops/cumulative.rs:130-140 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/cumulative.rs:79` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/burn-flex/src/ops/fft.rs:448 — crates/burn-flex/src/ops/fft.rs:448-455 | crates/burn-flex/src/ops/fft.rs:512-518 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/burn-flex/src/ops/fft.rs:868 — crates/burn-flex/src/ops/fft.rs:868-875 | crates/burn-flex/src/ops/fft.rs:1448-1454 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/fft.rs:868` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/burn-flex/src/ops/qtensor.rs:272 — crates/burn-flex/src/ops/qtensor.rs:272-278 | crates/burn-flex/src/ops/qtensor.rs:332-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 `crates/burn-flex/src/ops/qtensor.rs:272` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/burn-flex/src/tensor.rs:658 — crates/burn-flex/src/tensor.rs:658-664 | crates/burn-flex/src/tensor.rs:675-681 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/tensor.rs:658` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/burn-ir/src/builder.rs:587 — crates/burn-ir/src/builder.rs:587-593 | crates/burn-ir/src/builder.rs:1580-1587 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-ir/src/builder.rs:587` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/burn-ir/src/builder.rs:1579` calls `as_ref` and `crates/burn-ir/src/builder.rs:586` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) crates/burn-linalg/src/solve_cubecl.rs:219 — crates/burn-linalg/src/solve_cubecl.rs:219-225 | crates/burn-linalg/src/solve_cubecl.rs:366-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.
  • Duplicated block (7 lines × 2) crates/burn-optim/src/parallel/training.rs:321 — crates/burn-optim/src/parallel/training.rs:321-327 | crates/burn-optim/src/parallel/training.rs:448-454 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-optim/src/parallel/training.rs:321` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/burn-vision/src/backends/cpu/connected_components/spaghetti/mod.rs:165 — crates/burn-vision/src/backends/cpu/connected_components/spaghetti/mod.rs:165-171 | crates/burn-vision/src/backends/cpu/connected_components/spaghetti/mod.rs:202-208 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/burn-vision/src/backends/cube/connected_components/hardware_accelerated.rs:331 — crates/burn-vision/src/backends/cube/connected_components/hardware_accelerated.rs:331-337 | crates/burn-vision/src/backends/cube/connected_components/hardware_accelerated.rs:387-393 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-vision/src/backends/cube/connected_components/hardware_accelerated.rs:331` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/burn-vision/src/backends/cube/connected_components/hardware_accelerated.rs:384` calls `end_distance` and `crates/burn-vision/src/backends/cube/connected_components/hardware_accelerated.rs:330` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) crates/burn-autodiff/src/ops/tensor.rs:3342 — crates/burn-autodiff/src/ops/tensor.rs:3342-3348 | crates/burn-flex/src/ops/float.rs:1278-1284 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/tensor.rs:3342` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those 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 `lhs` to `FloatTensor<Self>` in one and `FloatTensor<Flex>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (7 lines × 2) crates/burn-backend/src/backend/ops/tensor.rs:1146 — crates/burn-backend/src/backend/ops/tensor.rs:1146-1152 | crates/burn-flex/src/ops/float.rs:1304-1310 — 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 first that the copies are not typed on the same thing: the declarations holding them bind `tensor` to `FloatTensor<B>` in one and `FloatTensor<Flex>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (7 lines × 2) crates/burn-nn/src/modules/interpolate/interpolate1d.rs:143 — crates/burn-nn/src/modules/interpolate/interpolate1d.rs:143-149 | crates/burn-nn/src/modules/interpolate/interpolate2d.rs:137-143 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • + 3 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×27
  • MethodTooLong: TensorInterpreter.execute_op crates/burn-router/src/interpreter.rs:287 — MethodTooLong — execute_op runs 1562 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 1462 over it, 15.62× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ModuleOperationIr.to_relative crates/burn-fusion/src/stream/context.rs:217 — MethodTooLong — to_relative 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: ModuleOperationIr.visit_mut crates/burn-ir/src/operation.rs:4717 — MethodTooLong — visit_mut runs 321 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 221 over it, 3.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Autodiff.float_select_assign crates/burn-autodiff/src/ops/tensor.rs:1875 — MethodTooLong — float_select_assign runs 315 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 215 over it, 3.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SessionHandler.process_task crates/burn-remote/src/server/worker.rs:272 — MethodTooLong — process_task runs 273 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 173 over it, 2.73× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: NumericOperationIr.to_relative crates/burn-fusion/src/stream/context.rs:1188 — MethodTooLong — to_relative runs 246 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 146 over it, 2.46× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ModuleOperationIr.mark_read_only crates/burn-ir/src/operation.rs:4386 — MethodTooLong — mark_read_only runs 239 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 139 over it, 2.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.
  • MethodTooLong: Autodiff.deform_conv2d crates/burn-autodiff/src/ops/module.rs:679 — MethodTooLong — deform_conv2d runs 232 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 132 over it, 2.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Unpickler.run crates/pytorch-reader/src/pickle_reader.rs:1341 — MethodTooLong — run runs 226 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 126 over it, 2.26× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Autodiff.float_scatter crates/burn-autodiff/src/ops/tensor.rs:1155 — MethodTooLong — float_scatter runs 213 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 113 over it, 2.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Autodiff.float_scatter_nd crates/burn-autodiff/src/ops/tensor.rs:1466 — MethodTooLong — float_scatter_nd runs 200 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 100 over it, 2.00× 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: NumericOperationIr.visit_mut crates/burn-ir/src/operation.rs:3146 — MethodTooLong — visit_mut runs 200 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 100 over it, 2.00× 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: VectorizationPlanner.run crates/burn-cubecl-fusion/src/engine/launch/vectorization/planner.rs:40 — MethodTooLong — run runs 189 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 89 over it, 1.89× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AlphaCtx.compute crates/burn-backend/src/backend/ops/modules/ctc.rs:331 — MethodTooLong — compute runs 152 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 52 over it, 1.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: BaseOperationIr.to_relative crates/burn-fusion/src/stream/context.rs:1504 — MethodTooLong — to_relative runs 140 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 40 over it, 1.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: LBFGS.step crates/burn-optim/src/optim/lbfgs.rs:674 — MethodTooLong — step runs 140 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 40 over it, 1.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: MorphColumnVec.apply crates/burn-vision/src/backends/cpu/morphology/filter.rs:212 — MethodTooLong — apply runs 137 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 37 over it, 1.37× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: FloatOperationIr.to_relative crates/burn-fusion/src/stream/context.rs:781 — MethodTooLong — to_relative runs 134 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 34 over it, 1.34× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: FloatOperationIr.visit_mut crates/burn-ir/src/operation.rs:3608 — MethodTooLong — visit_mut runs 125 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 25 over it, 1.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: NumericOperationIr.mark_read_only crates/burn-ir/src/operation.rs:2963 — MethodTooLong — mark_read_only runs 124 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 24 over it, 1.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Flex.int_select_assign crates/burn-flex/src/ops/int.rs:445 — MethodTooLong — int_select_assign runs 123 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 23 over it, 1.23× 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: TraceOperationFuser.fuse_base crates/burn-cubecl-fusion/src/engine/fuser.rs:298 — MethodTooLong — fuse_base runs 122 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 22 over it, 1.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: BaseOperationIr.visit_mut crates/burn-ir/src/operation.rs:2688 — MethodTooLong — visit_mut runs 110 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 10 over it, 1.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: Flex.int_cast crates/burn-flex/src/ops/int.rs:1016 — MethodTooLong — int_cast runs 109 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 9 over it, 1.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Flex.int_scatter crates/burn-flex/src/ops/int.rs:213 — MethodTooLong — int_scatter runs 108 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 8 over it, 1.08× 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.
  • + 2 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×23
  • Duplicated block (11 lines × 2) crates/burn-autodiff/src/ops/tensor.rs:4419 — crates/burn-autodiff/src/ops/tensor.rs:4419-4429 | crates/burn-autodiff/src/ops/tensor.rs:4493-4503 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/tensor.rs:4419` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/burn-backend/src/backend/ops/modules/attention.rs:538 — crates/burn-backend/src/backend/ops/modules/attention.rs:538-548 | crates/burn-backend/src/backend/ops/modules/attention.rs:569-579 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) crates/burn-backend/src/backend/ops/modules/conv.rs:544 — crates/burn-backend/src/backend/ops/modules/conv.rs:544-554 | crates/burn-backend/src/backend/ops/modules/conv.rs:814-824 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-backend/src/backend/ops/modules/conv.rs:544` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:121 — crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:121-131 | crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:133-143 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) crates/burn-cubecl/src/kernel/comparison.rs:211 — crates/burn-cubecl/src/kernel/comparison.rs:211-221 | crates/burn-cubecl/src/kernel/comparison.rs:280-290 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/comparison.rs:211` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/burn-cubecl/src/kernel/conv/backward_weight/tune.rs:232 — crates/burn-cubecl/src/kernel/conv/backward_weight/tune.rs:232-242 | crates/burn-cubecl/src/kernel/conv/forward/tune.rs:247-257 — `crates/burn-cubecl/src/kernel/conv/backward_weight/tune.rs` and `crates/burn-cubecl/src/kernel/conv/forward/tune.rs` are one unit implemented 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 30 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (11 lines × 2) crates/burn-cubecl/src/kernel/index/scatter.rs:98 — crates/burn-cubecl/src/kernel/index/scatter.rs:98-108 | crates/burn-cubecl/src/kernel/index/select_assign.rs:83-93 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/index/scatter.rs:98` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/burn-cubecl/src/ops/collective.rs:479 — crates/burn-cubecl/src/ops/collective.rs:479-489 | crates/burn-cubecl/src/ops/collective.rs:493-503 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `buffers` to `Vec<MemberBuffers>` in one and `MemberBuffers` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (11 lines × 2) crates/burn-dispatch/src/backend.rs:569 — crates/burn-dispatch/src/backend.rs:569-579 | crates/burn-dispatch/src/backend.rs:700-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 `crates/burn-dispatch/src/backend.rs:569` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/burn-flex/src/ops/activation.rs:723 — crates/burn-flex/src/ops/activation.rs:723-733 | crates/burn-flex/src/ops/activation.rs:852-862 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/activation.rs:723` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/burn-flex/src/ops/attention.rs:259 — crates/burn-flex/src/ops/attention.rs:259-269 | crates/burn-flex/src/ops/attention.rs:765-775 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) crates/burn-flex/src/ops/conv.rs:911 — crates/burn-flex/src/ops/conv.rs:911-921 | crates/burn-flex/src/ops/conv.rs:946-956 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/conv.rs:911` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/burn-flex/src/ops/interpolate.rs:1049 — crates/burn-flex/src/ops/interpolate.rs:1049-1059 | crates/burn-flex/src/ops/interpolate.rs:1154-1164 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/interpolate.rs:1049` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/burn-flex/src/ops/pool.rs:295 — crates/burn-flex/src/ops/pool.rs:295-305 | crates/burn-flex/src/ops/pool.rs:736-746 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/pool.rs:295` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/burn-flex/src/ops/pool.rs:770 — crates/burn-flex/src/ops/pool.rs:770-780 | crates/burn-flex/src/ops/pool.rs:800-810 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/pool.rs:770` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/burn-flex/src/ops/reduce.rs:1088 — crates/burn-flex/src/ops/reduce.rs:1088-1098 | crates/burn-flex/src/ops/reduce.rs:1132-1142 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/reduce.rs:1088` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) crates/burn-fusion/src/search/merging.rs:146 — crates/burn-fusion/src/search/merging.rs:146-156 | crates/burn-fusion/src/search/merging.rs:161-171 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-fusion/src/search/merging.rs:146` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/burn-ir/src/builder.rs:1723 — crates/burn-ir/src/builder.rs:1723-1733 | crates/burn-ir/src/builder.rs:1760-1770 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) crates/burn-router/src/interpreter.rs:1748 — crates/burn-router/src/interpreter.rs:1748-1758 | crates/burn-router/src/interpreter.rs:1771-1781 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) crates/burn-train/src/metric/vision/fid/inception.rs:89 — crates/burn-train/src/metric/vision/fid/inception.rs:89-99 | crates/burn-train/src/metric/vision/fid/inception.rs:214-224 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-train/src/metric/vision/fid/inception.rs:89` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/burn-flex/src/ops/pool.rs:788 — crates/burn-flex/src/ops/pool.rs:788-798 | crates/burn-flex/src/ops/pool.rs:1068-1078 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/pool.rs:788` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/burn-flex/src/ops/reduce.rs:684 — crates/burn-flex/src/ops/reduce.rs:684-694 | crates/burn-flex/src/ops/reduce.rs:711-721 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/reduce.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 (11 lines × 2) xtask/src/commands/test.rs:627 — xtask/src/commands/test.rs:627-637 | xtask/src/commands/test.rs:654-664 — both copies are in the same file, so extract the 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 · burn_flex · ×22
  • burn_flex::ops::reduce::reduce_dim_f32 (cyclomatic 39) crates/burn-flex/src/ops/reduce.rs:858 — burn_flex::ops::reduce::reduce_dim_f32 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.
  • burn_flex::ops::pool::avg_pool3d_backward_impl (cyclomatic 29) crates/burn-flex/src/ops/pool.rs:1446 — burn_flex::ops::pool::avg_pool3d_backward_impl 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.
  • burn_flex::ops::conv_transpose::conv_transpose3d_impl (cyclomatic 28) crates/burn-flex/src/ops/conv_transpose.rs:246 — burn_flex::ops::conv_transpose::conv_transpose3d_impl 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.
  • burn_flex::ops::mask::mask_where (cyclomatic 25) crates/burn-flex/src/ops/mask.rs:251 — burn_flex::ops::mask::mask_where 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.
  • burn_flex::ops::slice::slice_write_impl (cyclomatic 25) crates/burn-flex/src/ops/slice.rs:107 — burn_flex::ops::slice::slice_write_impl 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.
  • burn_flex::ops::reduce::argmax (cyclomatic 24) crates/burn-flex/src/ops/reduce.rs:728 — burn_flex::ops::reduce::argmax 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 shape REPEATS in the file: 5 other methods here (burn_flex::ops::reduce::argmin, burn_flex::ops::reduce::max_dim, burn_flex::ops::reduce::min_dim, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
  • burn_flex::ops::reduce::argmin (cyclomatic 24) crates/burn-flex/src/ops/reduce.rs:788 — burn_flex::ops::reduce::argmin 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 shape REPEATS in the file: 5 other methods here (burn_flex::ops::reduce::argmax, burn_flex::ops::reduce::max_dim, burn_flex::ops::reduce::min_dim, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
  • burn_flex::ops::reduce::max_dim (cyclomatic 24) crates/burn-flex/src/ops/reduce.rs:1605 — burn_flex::ops::reduce::max_dim 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 shape REPEATS in the file: 5 other methods here (burn_flex::ops::reduce::argmax, burn_flex::ops::reduce::argmin, burn_flex::ops::reduce::min_dim, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
  • burn_flex::ops::reduce::min_dim (cyclomatic 24) crates/burn-flex/src/ops/reduce.rs:1651 — burn_flex::ops::reduce::min_dim 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 shape REPEATS in the file: 5 other methods here (burn_flex::ops::reduce::argmax, burn_flex::ops::reduce::argmin, burn_flex::ops::reduce::max_dim, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
  • burn_flex::ops::reduce::max_dim_with_indices (cyclomatic 24) crates/burn-flex/src/ops/reduce.rs:1697 — burn_flex::ops::reduce::max_dim_with_indices 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 shape REPEATS in the file: 5 other methods here (burn_flex::ops::reduce::argmax, burn_flex::ops::reduce::argmin, burn_flex::ops::reduce::max_dim, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
  • burn_flex::ops::reduce::min_dim_with_indices (cyclomatic 24) crates/burn-flex/src/ops/reduce.rs:1748 — burn_flex::ops::reduce::min_dim_with_indices 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 shape REPEATS in the file: 5 other methods here (burn_flex::ops::reduce::argmax, burn_flex::ops::reduce::argmin, burn_flex::ops::reduce::max_dim, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
  • burn_flex::ops::attention::flash_attention_head (cyclomatic 23) crates/burn-flex/src/ops/attention.rs:536 — burn_flex::ops::attention::flash_attention_head 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.
  • burn_flex::tensor::copy_2d_tiled (cyclomatic 20) crates/burn-flex/src/tensor.rs:805 — burn_flex::tensor::copy_2d_tiled has cyclomatic complexity 20 (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.
  • burn_flex::ops::conv::conv3d_impl (cyclomatic 19) crates/burn-flex/src/ops/conv.rs:238 — burn_flex::ops::conv::conv3d_impl has cyclomatic complexity 19 (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.
  • burn_flex::ops::deform_conv::deform_conv2d_f32 (cyclomatic 19) crates/burn-flex/src/ops/deform_conv.rs:124 — burn_flex::ops::deform_conv::deform_conv2d_f32 has cyclomatic complexity 19 (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.
  • burn_flex::ops::deform_conv::bilinear_interpolate_backward_f32 (cyclomatic 19) crates/burn-flex/src/ops/deform_conv.rs:681 — burn_flex::ops::deform_conv::bilinear_interpolate_backward_f32 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.
  • burn_flex::ops::deform_conv::deform_conv2d_f64 (cyclomatic 18) crates/burn-flex/src/ops/deform_conv.rs:763 — burn_flex::ops::deform_conv::deform_conv2d_f64 has cyclomatic complexity 18 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • burn_flex::ops::bool::bool_binary_op_simd (cyclomatic 17) crates/burn-flex/src/ops/bool.rs:457 — burn_flex::ops::bool::bool_binary_op_simd 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.
  • burn_flex::ops::gather_scatter::select (cyclomatic 17) crates/burn-flex/src/ops/gather_scatter.rs:655 — burn_flex::ops::gather_scatter::select 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.
  • burn_flex::ops::reduce::mean_dim (cyclomatic 17) crates/burn-flex/src/ops/reduce.rs:278 — burn_flex::ops::reduce::mean_dim 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.
  • burn_flex::ops::attention::naive_attention_head (cyclomatic 16) crates/burn-flex/src/ops/attention.rs:932 — burn_flex::ops::attention::naive_attention_head 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.
  • burn_flex::ops::gather_scatter::gather_2d (cyclomatic 16) crates/burn-flex/src/ops/gather_scatter.rs:283 — burn_flex::ops::gather_scatter::gather_2d has cyclomatic complexity 16 (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.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×22
  • Duplicated block (10 lines × 2) crates/burn-autodiff/src/ops/base.rs:224 — crates/burn-autodiff/src/ops/base.rs:224-233 | crates/burn-autodiff/src/ops/base.rs:255-264 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) crates/burn-autodiff/src/ops/tensor.rs:1068 — crates/burn-autodiff/src/ops/tensor.rs:1068-1077 | crates/burn-autodiff/src/ops/tensor.rs:4595-4604 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/tensor.rs:1068` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/burn-autodiff/src/ops/tensor.rs:1775 — crates/burn-autodiff/src/ops/tensor.rs:1775-1784 | crates/burn-autodiff/src/ops/tensor.rs:2338-2347 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/tensor.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.
  • Duplicated block (10 lines × 2) crates/burn-cubecl/src/kernel/conv/conv_transpose2d/col2im.rs:193 — crates/burn-cubecl/src/kernel/conv/conv_transpose2d/col2im.rs:193-202 | crates/burn-cubecl/src/kernel/conv/conv_transpose3d/col2im.rs:195-204 — `crates/burn-cubecl/src/kernel/conv/conv_transpose2d/col2im.rs` and `crates/burn-cubecl/src/kernel/conv/conv_transpose3d/col2im.rs` are one unit implemented 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 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 `crates/burn-cubecl/src/kernel/conv/conv_transpose2d/col2im.rs:193` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/burn-derive/src/config/analyzer_enum.rs:122 — crates/burn-derive/src/config/analyzer_enum.rs:122-131 | crates/burn-derive/src/config/analyzer_struct.rs:375-384 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-derive/src/config/analyzer_enum.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.
  • Duplicated block (10 lines × 2) crates/burn-flex/src/ops/binary.rs:125 — crates/burn-flex/src/ops/binary.rs:125-134 | crates/burn-flex/src/ops/binary.rs:150-159 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/binary.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.
  • Duplicated block (10 lines × 2) crates/burn-flex/src/ops/interpolate.rs:623 — crates/burn-flex/src/ops/interpolate.rs:623-632 | crates/burn-flex/src/ops/interpolate.rs:842-851 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/interpolate.rs:623` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (10 lines × 2) crates/burn-flex/src/ops/interpolate.rs:698 — crates/burn-flex/src/ops/interpolate.rs:698-707 | crates/burn-flex/src/ops/interpolate.rs:894-903 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/interpolate.rs:698` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/burn-flex/src/ops/reduce.rs:1022 — crates/burn-flex/src/ops/reduce.rs:1022-1031 | crates/burn-flex/src/ops/reduce.rs:1252-1261 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) crates/burn-flex/src/ops/reduce.rs:1326 — crates/burn-flex/src/ops/reduce.rs:1326-1335 | crates/burn-flex/src/ops/reduce.rs:1395-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 `crates/burn-flex/src/ops/reduce.rs:1326` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/burn-flex/src/ops/slice.rs:195 — crates/burn-flex/src/ops/slice.rs:195-204 | crates/burn-flex/src/ops/slice.rs:226-235 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) crates/burn-instrument-report/src/components.rs:137 — crates/burn-instrument-report/src/components.rs:137-146 | crates/burn-instrument/src/breakdown/base.rs:405-414 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-instrument-report/src/components.rs:137` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/burn-nn/src/modules/transformer/decoder.rs:103 — crates/burn-nn/src/modules/transformer/decoder.rs:103-112 | crates/burn-nn/src/modules/transformer/encoder.rs:101-110 — before extracting anything, compare `crates/burn-nn/src/modules/transformer/decoder.rs` and `crates/burn-nn/src/modules/transformer/encoder.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 2) crates/burn-nn/src/modules/transformer/decoder.rs:377 — crates/burn-nn/src/modules/transformer/decoder.rs:377-386 | crates/burn-nn/src/modules/transformer/encoder.rs:344-354 — before extracting anything, compare `crates/burn-nn/src/modules/transformer/decoder.rs` and `crates/burn-nn/src/modules/transformer/encoder.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-nn/src/modules/transformer/decoder.rs:377` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/burn-train/src/learner/rl/paradigm.rs:90 — crates/burn-train/src/learner/rl/paradigm.rs:90-99 | crates/burn-train/src/learner/supervised/paradigm.rs:99-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 `crates/burn-train/src/learner/rl/paradigm.rs:90` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/burn-train/src/metric/precision.rs:107 — crates/burn-train/src/metric/precision.rs:107-116 | crates/burn-train/src/metric/recall.rs:104-113 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-train/src/metric/precision.rs:107` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/burn-train/src/metric/processor/full.rs:364 — crates/burn-train/src/metric/processor/full.rs:364-373 | crates/burn-train/src/metric/processor/minimal.rs:144-153 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/burn-train/src/metric/processor/full.rs:374` calls `end_split` and `crates/burn-train/src/metric/processor/minimal.rs:154` 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 (10 lines × 2) crates/burn-cubecl/src/kernel/binary.rs:215 — crates/burn-cubecl/src/kernel/binary.rs:215-224 | crates/burn-cubecl/src/kernel/binary_int.rs:162-171 — before extracting anything, compare `crates/burn-cubecl/src/kernel/binary.rs` and `crates/burn-cubecl/src/kernel/binary_int.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/binary.rs:215` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/burn-store/src/applier.rs:324 — crates/burn-store/src/applier.rs:324-333 | crates/burn-store/src/collector.rs:187-196 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) crates/burn-train/src/metric/auc_pr.rs:123 — crates/burn-train/src/metric/auc_pr.rs:123-132 | crates/burn-train/src/metric/auroc.rs:161-170 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-train/src/metric/auc_pr.rs:123` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/burn-tensor/src/tensor/module.rs:462 — crates/burn-tensor/src/tensor/module.rs:462-471 | crates/burn-tensor/src/tensor/module.rs:998-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/burn-tensor/src/tensor/module.rs:996` calls `device`, `get_or_init_settings` and `crates/burn-tensor/src/tensor/module.rs:460` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) crates/burn-no-std-tests/src/safetensors.rs:39 — crates/burn-no-std-tests/src/safetensors.rs:39-49 | crates/burn-no-std-tests/src/safetensors.rs:92-101 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×22
  • Duplicated block (6 lines × 2) crates/burn-cubecl-fusion/src/optim/reduce/optimization.rs:358 — crates/burn-cubecl-fusion/src/optim/reduce/optimization.rs:358-363 | crates/burn-cubecl-fusion/src/optim/reduce_broadcasted/launch.rs:66-71 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) crates/burn-flex/src/ops/bool.rs:165 — crates/burn-flex/src/ops/bool.rs:165-171 | crates/burn-flex/src/ops/comparison.rs:692-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 `crates/burn-flex/src/ops/bool.rs:165` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `lhs` to `BoolTensor<Flex>` in one and `FlexTensor` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (6 lines × 2) crates/burn-flex/src/ops/matmul.rs:782 — crates/burn-flex/src/ops/matmul.rs:782-787 | crates/burn-flex/src/ops/matmul.rs:852-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 `crates/burn-flex/src/ops/matmul.rs:782` it does not close everything it opens, so those 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 `lhs` to `&FlexTensor` in one and `FlexTensor` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (6 lines × 2) crates/burn-flex/src/ops/pool.rs:285 — crates/burn-flex/src/ops/pool.rs:285-290 | crates/burn-flex/src/ops/pool.rs:725-730 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/burn-flex/src/ops/reduce.rs:670 — crates/burn-flex/src/ops/reduce.rs:670-675 | crates/burn-flex/src/ops/reduce.rs:697-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 `crates/burn-flex/src/ops/reduce.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 × 2) crates/burn-flex/src/ops/sort.rs:171 — crates/burn-flex/src/ops/sort.rs:171-176 | crates/burn-flex/src/ops/sort.rs:514-519 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/burn-flex/src/ops/sort.rs:521` calls `iter`, `to_f32`, `collect` and `crates/burn-flex/src/ops/sort.rs:179` 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) crates/burn-flex/src/simd/portable.rs:240 — crates/burn-flex/src/simd/portable.rs:240-245 | crates/burn-flex/src/simd/portable.rs:371-376 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/simd/portable.rs:240` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/burn-flex/src/tensor.rs:849 — crates/burn-flex/src/tensor.rs:849-854 | crates/burn-flex/src/tensor.rs:896-901 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/tensor.rs:849` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/burn-store/src/safetensors/store.rs:825 — crates/burn-store/src/safetensors/store.rs:825-830 | crates/burn-store/src/safetensors/store.rs:836-841 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/burn-backend/src/backend/ops/modules/conv.rs:433 — crates/burn-backend/src/backend/ops/modules/conv.rs:433-438 | crates/burn-backend/src/backend/ops/modules/conv.rs:733-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-backend/src/backend/ops/modules/conv.rs:433` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/burn-cubecl/src/kernel/conv/deform_conv_transpose2d.rs:380 — crates/burn-cubecl/src/kernel/conv/deform_conv_transpose2d.rs:380-385 | crates/burn-cubecl/src/kernel/conv/deform_conv_transpose2d.rs:626-631 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/burn-cubecl/src/kernel/conv/deform_conv_transpose2d.rs:378` calls `stride` and `crates/burn-cubecl/src/kernel/conv/deform_conv_transpose2d.rs:624` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) crates/burn-flex/src/ops/reduce.rs:732 — crates/burn-flex/src/ops/reduce.rs:732-737 | crates/burn-flex/src/ops/reduce.rs:792-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 `crates/burn-flex/src/ops/reduce.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.
  • Duplicated block (6 lines × 2) crates/burn-store/src/pytorch/store.rs:41 — crates/burn-store/src/pytorch/store.rs:41-46 | crates/burn-store/src/safetensors/store.rs:55-60 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-store/src/pytorch/store.rs:41` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/burn-train/src/renderer/cli.rs:44 — crates/burn-train/src/renderer/cli.rs:44-49 | crates/burn-train/src/renderer/tui/renderer.rs:253-258 — 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 before the matched lines, `crates/burn-train/src/renderer/tui/renderer.rs:252` calls `send_event`, `LabelUpdate` and `crates/burn-train/src/renderer/cli.rs:43` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) crates/burn-train/src/metric/processor/metrics.rs:81 — crates/burn-train/src/metric/processor/metrics.rs:81-86 | crates/burn-train/src/metric/processor/rl_metrics.rs:150-155 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) crates/burn-train/src/metric/rl/cum_reward.rs:46 — crates/burn-train/src/metric/rl/cum_reward.rs:46-51 | crates/burn-train/src/metric/rl/ep_len.rs:46-51 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-train/src/metric/rl/cum_reward.rs:46` it begins part-way through the construct above it, so those 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 `item` to `&CumulativeRewardInput` in one and `&EpisodeLengthInput` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (6 lines × 2) crates/burn-flex/src/ops/reduce.rs:677 — crates/burn-flex/src/ops/reduce.rs:677-682 | crates/burn-flex/src/ops/reduce.rs:704-709 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/reduce.rs:677` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/burn-flex/src/ops/reduce.rs:1606 — crates/burn-flex/src/ops/reduce.rs:1606-1611 | crates/burn-flex/src/ops/reduce.rs:1652-1657 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/reduce.rs:1606` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/burn-flex/src/ops/matmul.rs:86 — crates/burn-flex/src/ops/matmul.rs:86-91 | crates/burn-flex/src/ops/matmul.rs:501-506 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/burn-train/src/metric/mae.rs:45 — crates/burn-train/src/metric/mae.rs:45-50 | crates/burn-train/src/metric/mse.rs:45-50 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-train/src/metric/mae.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.
  • Duplicated block (6 lines × 2) crates/burn-backend/src/backend/ops/modules/grid_sample.rs:59 — crates/burn-backend/src/backend/ops/modules/grid_sample.rs:59-64 | crates/burn-backend/src/backend/ops/modules/grid_sample.rs:65-70 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) crates/burn-nn/src/modules/conv/conv2d.rs:169 — crates/burn-nn/src/modules/conv/conv2d.rs:169-174 | crates/burn-nn/src/modules/conv/conv3d.rs:174-179 — before extracting anything, compare `crates/burn-nn/src/modules/conv/conv2d.rs` and `crates/burn-nn/src/modules/conv/conv3d.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 `input` to `&Tensor<4>` in one and `&Tensor<5>` 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.
D2 · Cognitive Complexity · burn_linalg · ×17
  • burn_linalg::solve_cubecl::blocked_rhs (cognitive 138) crates/burn-linalg/src/solve_cubecl.rs:803 — burn_linalg::solve_cubecl::blocked_rhs has cognitive complexity 138 (threshold 15). Drivers by points: if/else 25 (79 pts), loops 15 (50 pts), boolean chains 9 (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.
  • burn_linalg::cholesky_gpu::panel (cognitive 100) crates/burn-linalg/src/cholesky_gpu.rs:76 — burn_linalg::cholesky_gpu::panel has cognitive complexity 100 (threshold 15). Drivers by points: if/else 28 (71 pts), loops 10 (21 pts), boolean chains 8 (nesting depth added 54). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • burn_linalg::svd_host::bidiag_host (cognitive 90) crates/burn-linalg/src/svd_host.rs:268 — burn_linalg::svd_host::bidiag_host has cognitive complexity 90 (threshold 15). Drivers by points: loops 24 (81 pts), if/else 4 (9 pts) (nesting depth added 62). 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.
  • burn_linalg::solve_cubecl::factor_panel (cognitive 89) crates/burn-linalg/src/solve_cubecl.rs:352 — burn_linalg::solve_cubecl::factor_panel has cognitive complexity 89 (threshold 15). Drivers by points: if/else 18 (56 pts), loops 13 (29 pts), boolean chains 4 (nesting depth added 54). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • burn_linalg::solve_cubecl::factor_panel_shared (cognitive 69) crates/burn-linalg/src/solve_cubecl.rs:206 — burn_linalg::solve_cubecl::factor_panel_shared has cognitive complexity 69 (threshold 15). Drivers by points: if/else 15 (41 pts), loops 11 (27 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.
  • burn_linalg::svd_host::svd_host (cognitive 38) crates/burn-linalg/src/svd_host.rs:85 — burn_linalg::svd_host::svd_host has cognitive complexity 38 (threshold 15). Drivers by points: loops 13 (34 pts), if/else 3 (4 pts) (nesting depth added 22). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • burn_linalg::solve_cubecl::solve_rhs_shared (cognitive 30) crates/burn-linalg/src/solve_cubecl.rs:619 — burn_linalg::solve_cubecl::solve_rhs_shared has cognitive complexity 30 (threshold 15). Drivers by points: loops 13 (25 pts), if/else 3 (5 pts) (nesting depth added 14). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • burn_linalg::solve_cubecl::solve_impl (cognitive 30) crates/burn-linalg/src/solve_cubecl.rs:1017 — burn_linalg::solve_cubecl::solve_impl has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 4 (8 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.
  • burn_linalg::functions::solve::solve_impl (cognitive 29) crates/burn-linalg/src/functions/solve.rs:69 — burn_linalg::functions::solve::solve_impl has cognitive complexity 29 (threshold 15). Drivers by points: if/else 20 (24 pts), loops 4, boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • burn_linalg::solve_cubecl::swap_and_solve_upper (cognitive 29) crates/burn-linalg/src/solve_cubecl.rs:502 — burn_linalg::solve_cubecl::swap_and_solve_upper has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 5 (10 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • burn_linalg::solve_cubecl::reduce_pivot (cognitive 25) crates/burn-linalg/src/solve_cubecl.rs:60 — burn_linalg::solve_cubecl::reduce_pivot has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 2 (4 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.
  • burn_linalg::svd_host::dbdsqr (cognitive 23) crates/burn-linalg/src/svd_host.rs:401 — burn_linalg::svd_host::dbdsqr has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 4 (6 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.
  • burn_linalg::solve_host::substitute (cognitive 22) crates/burn-linalg/src/solve_host.rs:240 — burn_linalg::solve_host::substitute has cognitive complexity 22 (threshold 15). Drivers by points: loops 8 (16 pts), if/else 3 (6 pts) (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • burn_linalg::functions::cholesky::cholesky (cognitive 20) crates/burn-linalg/src/functions/cholesky.rs:47 — burn_linalg::functions::cholesky::cholesky has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (14 pts), loops 2 (3 pts), boolean chains 2, match/switch 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.
  • burn_linalg::cholesky_cpu::factor_batch (cognitive 18) crates/burn-linalg/src/cholesky_cpu.rs:37 — burn_linalg::cholesky_cpu::factor_batch has cognitive complexity 18 (threshold 15). Drivers by points: loops 5 (12 pts), if/else 3 (6 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.
  • burn_linalg::solve_host::factor (cognitive 18) crates/burn-linalg/src/solve_host.rs:116 — burn_linalg::solve_host::factor has cognitive complexity 18 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 3 (6 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.
  • burn_linalg::solve_host::factor_panel (cognitive 17) crates/burn-linalg/src/solve_host.rs:190 — burn_linalg::solve_host::factor_panel has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 4 (8 pts) (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×17
  • Duplicated block (12 lines × 2) crates/burn-backend-extension/src/routing.rs:1036 — crates/burn-backend-extension/src/routing.rs:1036-1048 | crates/burn-backend-extension/src/routing.rs:1137-1148 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-backend-extension/src/routing.rs:1036` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/burn-cubecl/src/kernel/conv/conv_transpose2d/col2im.rs:276 — crates/burn-cubecl/src/kernel/conv/conv_transpose2d/col2im.rs:276-287 | crates/burn-cubecl/src/kernel/conv/conv_transpose3d/col2im.rs:288-299 — `crates/burn-cubecl/src/kernel/conv/conv_transpose2d/col2im.rs` and `crates/burn-cubecl/src/kernel/conv/conv_transpose3d/col2im.rs` are one unit implemented 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 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.
  • Duplicated block (12 lines × 2) crates/burn-cubecl/src/kernel/conv/deform_conv_transpose2d.rs:349 — crates/burn-cubecl/src/kernel/conv/deform_conv_transpose2d.rs:349-360 | crates/burn-cubecl/src/kernel/conv/deform_conv_transpose2d.rs:601-612 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) crates/burn-cubecl/src/kernel/reduce/base.rs:504 — crates/burn-cubecl/src/kernel/reduce/base.rs:504-515 | crates/burn-cubecl/src/kernel/reduce/base.rs:616-627 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/reduce/base.rs:504` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/burn-cubecl/src/kernel/reduce/base.rs:615` calls `clone`, `binding` and `crates/burn-cubecl/src/kernel/reduce/base.rs:503` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) crates/burn-dataset/src/nlp/ag_news.rs:100 — crates/burn-dataset/src/nlp/ag_news.rs:100-111 | crates/burn-dataset/src/vision/cifar.rs:144-155 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-dataset/src/nlp/ag_news.rs:100` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/burn-dataset/src/nlp/text_folder.rs:214 — crates/burn-dataset/src/nlp/text_folder.rs:214-225 | crates/burn-dataset/src/vision/image_folder.rs:576-587 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-dataset/src/nlp/text_folder.rs:214` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/burn-flex/src/ops/bool.rs:478 — crates/burn-flex/src/ops/bool.rs:478-489 | crates/burn-flex/src/ops/bool.rs:496-507 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) crates/burn-flex/src/ops/pool.rs:1477 — crates/burn-flex/src/ops/pool.rs:1477-1488 | crates/burn-flex/src/ops/pool.rs:1670-1681 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/pool.rs:1477` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/burn-flex/src/ops/pool.rs:1555 — crates/burn-flex/src/ops/pool.rs:1555-1566 | crates/burn-flex/src/ops/pool.rs:1705-1716 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/pool.rs:1555` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) crates/burn-flex/src/simd/kernels.rs:210 — crates/burn-flex/src/simd/kernels.rs:210-221 | crates/burn-flex/src/simd/kernels.rs:240-251 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/simd/kernels.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.
  • Duplicated block (12 lines × 2) crates/burn-nn/src/modules/rnn/basic.rs:333 — crates/burn-nn/src/modules/rnn/basic.rs:333-344 | crates/burn-nn/src/modules/rnn/gru.rs:385-396 — before extracting anything, compare `crates/burn-nn/src/modules/rnn/basic.rs` and `crates/burn-nn/src/modules/rnn/gru.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-nn/src/modules/rnn/basic.rs:333` it does not close everything it opens, so those 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 `state` to `Option<RnnState<3>>` in one and `Option<Tensor<3>>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (12 lines × 2) crates/burn-train/src/metric/processor/metrics.rs:285 — crates/burn-train/src/metric/processor/metrics.rs:285-296 | crates/burn-train/src/metric/processor/metrics.rs:317-328 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-train/src/metric/processor/metrics.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.
  • Duplicated block (12 lines × 2) crates/burn-train/src/renderer/tui/full_history.rs:125 — crates/burn-train/src/renderer/tui/full_history.rs:125-136 | crates/burn-train/src/renderer/tui/recent_history.rs:94-105 — 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 (12 lines × 2) crates/burn-flex/src/simd/portable.rs:1619 — crates/burn-flex/src/simd/portable.rs:1619-1630 | crates/burn-flex/src/simd/portable.rs:1668-1679 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/simd/portable.rs:1619` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `a` to `&[u8]` in one and `&mut [u8]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (12 lines × 2) crates/burn-flex/src/ops/interpolate.rs:263 — crates/burn-flex/src/ops/interpolate.rs:263-274 | crates/burn-flex/src/ops/interpolate.rs:931-942 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) crates/burn-vision/src/backends/cpu/morphology/filter.rs:462 — crates/burn-vision/src/backends/cpu/morphology/filter.rs:462-473 | crates/burn-vision/src/backends/cpu/morphology/filter.rs:510-521 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) crates/burn-vision/src/backends/cpu/morphology/filter.rs:234 — crates/burn-vision/src/backends/cpu/morphology/filter.rs:234-245 | crates/burn-vision/src/backends/cpu/morphology/filter.rs:353-364 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D15 · Churn × Complexity Hotspots · Hotspot · ×16
  • Hotspot: crates/burn-router/src/interpreter.rs crates/burn-router/src/interpreter.rs:287 — crates/burn-router/src/interpreter.rs changed 30 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 340 in TensorInterpreter::execute_op at line 287. 3 of those changes were fix/bug commits, and the other 27 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 17:50:42 -05:00' --until='2026-11-12 17:50:42 -05:00' --full-history --no-merges -- crates/burn-router/src/interpreter.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/burn-ir/src/operation.rs crates/burn-ir/src/operation.rs:4717 — crates/burn-ir/src/operation.rs changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 84 in ModuleOperationIr::visit_mut at line 4717. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 17:50:42 -05:00' --until='2026-11-12 17:50:42 -05:00' --full-history --no-merges -- crates/burn-ir/src/operation.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/pytorch-reader/src/pickle_reader.rs crates/pytorch-reader/src/pickle_reader.rs:1341 — crates/pytorch-reader/src/pickle_reader.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 68 in Unpickler::run at line 1341. 3 of those changes were fix/bug commits, and the other 10 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 17:50:42 -05:00' --until='2026-11-12 17:50:42 -05:00' --full-history --no-merges -- crates/pytorch-reader/src/pickle_reader.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/burn-remote/src/server/worker.rs crates/burn-remote/src/server/worker.rs:272 — crates/burn-remote/src/server/worker.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 45 in SessionHandler::process_task at line 272. 2 of those changes were fix/bug commits, and the other 11 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 17:50:42 -05:00' --until='2026-11-12 17:50:42 -05:00' --full-history --no-merges -- crates/burn-remote/src/server/worker.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/burn-cubecl/src/ops/base.rs crates/burn-cubecl/src/ops/base.rs:346 — crates/burn-cubecl/src/ops/base.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in burn_cubecl::ops::base::q_reshape at line 346. 3 of those changes were fix/bug commits, and the other 9 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 17:50:42 -05:00' --until='2026-11-12 17:50:42 -05:00' --full-history --no-merges -- crates/burn-cubecl/src/ops/base.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/burn-flex/src/ops/reduce.rs crates/burn-flex/src/ops/reduce.rs:858 — crates/burn-flex/src/ops/reduce.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in burn_flex::ops::reduce::reduce_dim_f32 at line 858. 3 of those changes were fix/bug commits, and the other 3 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 17:50:42 -05:00' --until='2026-11-12 17:50:42 -05:00' --full-history --no-merges -- crates/burn-flex/src/ops/reduce.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/burn-flex/src/ops/pool.rs crates/burn-flex/src/ops/pool.rs:1446 — crates/burn-flex/src/ops/pool.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in burn_flex::ops::pool::avg_pool3d_backward_impl at line 1446. 3 of those changes were fix/bug commits, and the other 5 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 17:50:42 -05:00' --until='2026-11-12 17:50:42 -05:00' --full-history --no-merges -- crates/burn-flex/src/ops/pool.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:109 — crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in burn_cubecl_fusion::engine::codegen::kernel::init_locals at line 109. 6 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 17:50:42 -05:00' --until='2026-11-12 17:50:42 -05:00' --full-history --no-merges -- crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/burn-backend-extension/src/extension.rs crates/burn-backend-extension/src/extension.rs:143 — crates/burn-backend-extension/src/extension.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in burn_backend_extension::extension::lower_extension at line 143. 2 of those changes were fix/bug commits, and the other 4 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 17:50:42 -05:00' --until='2026-11-12 17:50:42 -05:00' --full-history --no-merges -- crates/burn-backend-extension/src/extension.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/burn-flex/src/ops/conv_transpose.rs crates/burn-flex/src/ops/conv_transpose.rs:246 — crates/burn-flex/src/ops/conv_transpose.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in burn_flex::ops::conv_transpose::conv_transpose3d_impl at line 246. 1 of those changes was a fix/bug commit, and the other 3 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 17:50:42 -05:00' --until='2026-11-12 17:50:42 -05:00' --full-history --no-merges -- crates/burn-flex/src/ops/conv_transpose.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/burn-optim/src/optim/lbfgs.rs crates/burn-optim/src/optim/lbfgs.rs:674 — crates/burn-optim/src/optim/lbfgs.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in LBFGS::step at line 674. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 17:50:42 -05:00' --until='2026-11-12 17:50:42 -05:00' --full-history --no-merges -- crates/burn-optim/src/optim/lbfgs.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/burn-vision/src/backends/cube/connected_components/hardware_accelerated.rs crates/burn-vision/src/backends/cube/connected_components/hardware_accelerated.rs:477 — crates/burn-vision/src/backends/cube/connected_components/hardware_accelerated.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in burn_vision::backends::cube::connected_components::hardware_accelerated::hardware_accelerated at line 477. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 17:50:42 -05:00' --until='2026-11-12 17:50:42 -05:00' --full-history --no-merges -- crates/burn-vision/src/backends/cube/connected_components/hardware_accelerated.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/burn-cubecl-fusion/src/engine/launch/vectorization/planner.rs crates/burn-cubecl-fusion/src/engine/launch/vectorization/planner.rs:40 — crates/burn-cubecl-fusion/src/engine/launch/vectorization/planner.rs changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in VectorizationPlanner::run at line 40. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 17:50:42 -05:00' --until='2026-11-12 17:50:42 -05:00' --full-history --no-merges -- crates/burn-cubecl-fusion/src/engine/launch/vectorization/planner.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/burn-flex/src/ops/conv.rs crates/burn-flex/src/ops/conv.rs:238 — crates/burn-flex/src/ops/conv.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in burn_flex::ops::conv::conv3d_impl at line 238. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 17:50:42 -05:00' --until='2026-11-12 17:50:42 -05:00' --full-history --no-merges -- crates/burn-flex/src/ops/conv.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/burn-cubecl-fusion/src/engine/launch/executor.rs crates/burn-cubecl-fusion/src/engine/launch/executor.rs:40 — crates/burn-cubecl-fusion/src/engine/launch/executor.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in LaunchPlanExecutor::execute at line 40. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 17:50:42 -05:00' --until='2026-11-12 17:50:42 -05:00' --full-history --no-merges -- crates/burn-cubecl-fusion/src/engine/launch/executor.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: crates/burn-vision/src/utils/save.rs crates/burn-vision/src/utils/save.rs:65 — crates/burn-vision/src/utils/save.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in burn_vision::utils::save::save_tensor_as_image at line 65. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 17:50:42 -05:00' --until='2026-11-12 17:50:42 -05:00' --full-history --no-merges -- crates/burn-vision/src/utils/save.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×16
  • Edited copy of a member (15 corresponding lines) crates/burn-cubecl/src/kernel/conv/conv_transpose2d/col2im.rs:155 — crates/burn-cubecl/src/kernel/conv/conv_transpose2d/col2im.rs:155-174 | crates/burn-cubecl/src/kernel/conv/conv_transpose3d/col2im.rs:159-183 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/burn-flex/src/ops/unary.rs:237 — crates/burn-flex/src/ops/unary.rs:237-251 | crates/burn-flex/src/ops/unary.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) crates/burn-std/src/data/tensor/base.rs:692 — crates/burn-std/src/data/tensor/base.rs:692-706 | crates/burn-std/src/data/tensor/base.rs:712-728 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/burn-flex/src/ops/float.rs:1106 — crates/burn-flex/src/ops/float.rs:1106-1120 | crates/burn-flex/src/ops/float.rs:1335-1349 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/burn-cubecl/src/kernel/reduce/bounds.rs:31 — crates/burn-cubecl/src/kernel/reduce/bounds.rs:31-45 | crates/burn-cubecl/src/kernel/reduce/bounds.rs:50-68 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/burn-instrument-report/src/components.rs:132 — crates/burn-instrument-report/src/components.rs:132-146 | crates/burn-instrument/src/breakdown/base.rs:400-414 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/burn-cubecl-fusion/src/engine/fuser.rs:741 — crates/burn-cubecl-fusion/src/engine/fuser.rs:741-755 | crates/burn-cubecl-fusion/src/engine/fuser.rs:783-798 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/burn-flex/src/ops/matmul.rs:521 — crates/burn-flex/src/ops/matmul.rs:521-535 | crates/burn-flex/src/ops/matmul.rs:757-771 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/pytorch-reader/src/pickle_reader.rs:1308 — crates/pytorch-reader/src/pickle_reader.rs:1308-1322 | crates/pytorch-reader/src/pickle_reader.rs:1325-1339 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/burn-tensor/src/tensor/api/base.rs:2858 — crates/burn-tensor/src/tensor/api/base.rs:2858-2872 | crates/burn-tensor/src/tensor/api/base.rs:2903-2922 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/burn-nn/src/modules/pool/avg_pool2d.rs:97 — crates/burn-nn/src/modules/pool/avg_pool2d.rs:97-111 | crates/burn-nn/src/modules/pool/avg_pool3d.rs:93-109 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/burn-signal/src/backends/fusion.rs:30 — crates/burn-signal/src/backends/fusion.rs:30-44 | crates/burn-signal/src/backends/fusion.rs:51-66 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/pytorch-reader/src/nested/de.rs:432 — crates/pytorch-reader/src/nested/de.rs:432-449 | crates/pytorch-reader/src/nested/de.rs:459-473 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/burn-train/src/metric/processor/async_wrapper.rs:224 — crates/burn-train/src/metric/processor/async_wrapper.rs:224-238 | crates/burn-train/src/metric/processor/async_wrapper.rs:267-281 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/burn-cubecl-fusion/src/optim/reduce/fuser.rs:161 — crates/burn-cubecl-fusion/src/optim/reduce/fuser.rs:161-175 | crates/burn-cubecl-fusion/src/optim/reduce/fuser.rs:177-191 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) crates/burn-train/src/learner/classification.rs:33 — crates/burn-train/src/learner/classification.rs:33-47 | crates/burn-train/src/learner/regression.rs:32-46 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×16
  • Edited copy of a member (9 corresponding lines) crates/burn-ir/src/operation.rs:3812 — crates/burn-ir/src/operation.rs:3812-3864 | crates/burn-ir/src/operation.rs:5408-5506 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/burn-flex/src/ops/float.rs:299 — crates/burn-flex/src/ops/float.rs:299-307 | crates/burn-flex/src/ops/float.rs:432-440 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/burn-store/src/pytorch/store.rs:38 — crates/burn-store/src/pytorch/store.rs:38-46 | crates/burn-store/src/safetensors/store.rs:51-60 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/burn-backend/src/backend/ops/modules/base.rs:308 — crates/burn-backend/src/backend/ops/modules/base.rs:308-316 | crates/burn-flex/src/ops/module.rs:890-900 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/burn-backend/src/backend/ops/int_tensor.rs:540 — crates/burn-backend/src/backend/ops/int_tensor.rs:540-548 | crates/burn-flex/src/ops/int.rs:1405-1413 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/burn-cubecl-fusion/src/engine/codegen/io.rs:281 — crates/burn-cubecl-fusion/src/engine/codegen/io.rs:281-290 | crates/burn-cubecl-fusion/src/engine/codegen/io.rs:460-468 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/burn-cubecl-fusion/src/base.rs:155 — crates/burn-cubecl-fusion/src/base.rs:155-163 | crates/burn-cubecl/src/tensor/base.rs:302-310 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/burn-nn/src/modules/pos_encoding.rs:94 — crates/burn-nn/src/modules/pos_encoding.rs:94-102 | crates/burn-nn/src/modules/rope_encoding.rs:139-148 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/burn-flex/src/ops/fft.rs:1208 — crates/burn-flex/src/ops/fft.rs:1208-1216 | crates/burn-flex/src/ops/fft.rs:1218-1226 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/burn-backend/src/backend/ops/int_tensor.rs:1473 — crates/burn-backend/src/backend/ops/int_tensor.rs:1473-1482 | crates/burn-backend/src/backend/ops/tensor.rs:1919-1927 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/burn-train/src/metric/processor/async_wrapper.rs:214 — crates/burn-train/src/metric/processor/async_wrapper.rs:214-222 | crates/burn-train/src/metric/processor/async_wrapper.rs:254-265 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/burn-train/src/learner/supervised/step/train.rs:85 — crates/burn-train/src/learner/supervised/step/train.rs:85-93 | crates/burn-train/src/learner/supervised/strategies/ddp/strategy.rs:49-57 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/burn-train/src/renderer/tui/full_history.rs:101 — crates/burn-train/src/renderer/tui/full_history.rs:101-109 | crates/burn-train/src/renderer/tui/recent_history.rs:83-91 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/burn-train/src/metric/cpu_use.rs:20 — crates/burn-train/src/metric/cpu_use.rs:20-28 | crates/burn-train/src/metric/memory_use.rs:23-32 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/burn-train/src/metric/vision/dice.rs:43 — crates/burn-train/src/metric/vision/dice.rs:43-52 | crates/burn-train/src/metric/vision/ms_ssim.rs:55-63 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) crates/burn-nn/src/modules/pool/avg_pool1d.rs:84 — crates/burn-nn/src/modules/pool/avg_pool1d.rs:84-92 | crates/burn-nn/src/modules/pool/max_pool1d.rs:76-84 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×16
  • Edited copy of a member (11 corresponding lines) crates/burn-backend/src/backend/ops/int_tensor.rs:1377 — crates/burn-backend/src/backend/ops/int_tensor.rs:1377-1388 | crates/burn-backend/src/backend/ops/tensor.rs:1817-1827 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/burn-nn/src/padding.rs:73 — crates/burn-nn/src/padding.rs:73-83 | crates/burn-nn/src/padding.rs:131-144 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/burn-backend/src/backend/ops/modules/conv.rs:341 — crates/burn-backend/src/backend/ops/modules/conv.rs:341-351 | crates/burn-backend/src/backend/ops/modules/conv.rs:446-456 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/burn-store/src/bridge.rs:50 — crates/burn-store/src/bridge.rs:50-67 | crates/burn-store/src/safetensors/store.rs:1007-1017 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/burn-nn/src/modules/norm/group.rs:134 — crates/burn-nn/src/modules/norm/group.rs:134-148 | crates/burn-nn/src/modules/norm/instance.rs:109-119 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/burn-autodiff/src/ops/collective.rs:222 — crates/burn-autodiff/src/ops/collective.rs:222-232 | crates/burn-autodiff/src/ops/collective.rs:252-262 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/burn-backend-extension/src/ir.rs:210 — crates/burn-backend-extension/src/ir.rs:210-223 | crates/burn-derive/src/record_state/mod.rs:31-41 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/burn-store/src/collector.rs:132 — crates/burn-store/src/collector.rs:132-144 | crates/burn-store/src/collector.rs:152-162 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/burn-backend-extension/src/routing.rs:62 — crates/burn-backend-extension/src/routing.rs:62-74 | crates/burn-backend-extension/src/routing.rs:76-86 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/burn-shard/src/rules/reduce.rs:30 — crates/burn-shard/src/rules/reduce.rs:30-40 | crates/burn-shard/src/rules/reshape.rs:30-40 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/burn-core/src/module/display.rs:423 — crates/burn-core/src/module/display.rs:423-435 | crates/burn-core/src/module/display.rs:449-459 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/burn-cubecl-fusion/src/engine/trace/base.rs:428 — crates/burn-cubecl-fusion/src/engine/trace/base.rs:428-438 | crates/burn-cubecl-fusion/src/engine/trace/base.rs:441-451 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/burn-backend/src/backend/ops/sort.rs:400 — crates/burn-backend/src/backend/ops/sort.rs:400-410 | crates/burn-cubecl-fusion/src/base.rs:201-211 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/burn-communication/src/websocket/client.rs:92 — crates/burn-communication/src/websocket/client.rs:92-105 | crates/burn-communication/src/websocket/client.rs:133-143 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/burn-flex/src/simd/portable.rs:1534 — crates/burn-flex/src/simd/portable.rs:1534-1544 | crates/burn-flex/src/simd/portable.rs:1604-1706 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/burn-nn/src/loss/cross_entropy.rs:48 — crates/burn-nn/src/loss/cross_entropy.rs:48-59 | crates/burn-nn/src/loss/binary_cross_entropy.rs:30-40 — 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.
D15 · Churn × Complexity Hotspots · Repeated repair · ×15
  • Repeated repair: crates/burn-autodiff/src/ops/tensor.rs crates/burn-autodiff/src/ops/tensor.rs:1155 — crates/burn-autodiff/src/ops/tensor.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 9 (its worst body is Autodiff::float_scatter at line 1155), 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(backend)!: separate device settings queries from initialization (#5869)”; “fix(tensor): make TensorData fields private and validate construction (#5838)”; “fix(autodiff): correct repeat_dim gradient ordering (#5837)”; “fix(autodiff): preserve gradients for zero scalar exponents (#5692)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 17:50:42 -05:00' --until='2026-11-12 17:50:42 -05:00' --full-history --no-merges -- crates/burn-autodiff/src/ops/tensor.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: crates/burn-std/src/data/tensor/base.rs crates/burn-std/src/data/tensor/base.rs:444 — crates/burn-std/src/data/tensor/base.rs changed 12 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 15 (its worst body is TensorData::random_dtype 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(std)!: validate quantized tensor data lengths (#5978)”; “fix(std): preserve Flex32 dtype in full data (#6069)”; “fix: preserve Flex32 dtype in TensorData conversions (#6062)”; “fix(tensor): display quantized tensors as metadata without panicking (#5868)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 17:50:42 -05:00' --until='2026-11-12 17:50:42 -05:00' --full-history --no-merges -- crates/burn-std/src/data/tensor/base.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: crates/burn-core/src/backend.rs crates/burn-core/src/backend.rs:105 — crates/burn-core/src/backend.rs changed 8 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 2 (its worst body is ExtensionType::autodiff_routing at line 105), 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(dispatch): route autodiff only for associated float inputs (#6109)”; “fix(metal): require native MSL for explicit Metal devices (#5921)”; “fix(dispatch): require explicit backend selection and support backend-free builds (#5722)”; “fix(dispatch): decouple CubeCL runtime facade crates (#5570)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 17:50:42 -05:00' --until='2026-11-12 17:50:42 -05:00' --full-history --no-merges -- crates/burn-core/src/backend.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: crates/burn-store/src/applier.rs crates/burn-store/src/applier.rs:211 — crates/burn-store/src/applier.rs changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is Applier::apply_tensor at line 211), 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(nn): train and persist stateful PWFF activations (#5932)”; “fix(tensor): make TensorData fields private and validate construction (#5838)”; “fix(store): reject a loaded tensor whose dtype is the wrong kind (#5490)”; “fix(store): exclude adapter-matched tensors from unused (#5536)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 17:50:42 -05:00' --until='2026-11-12 17:50:42 -05:00' --full-history --no-merges -- crates/burn-store/src/applier.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: crates/burn-pack/src/writer.rs crates/burn-pack/src/writer.rs:281 — crates/burn-pack/src/writer.rs changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is Writer::resolve_path at line 281), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(store): enforce overwrite(false) at publish time, not just before the save (#5781)”; “fix(pack): validate tensor byte lengths when reading (#5576)”; “fix(store): write safetensors files atomically (#5489)”; “fix(store): preserve extensionless burnpack paths (#5494)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 17:50:42 -05:00' --until='2026-11-12 17:50:42 -05:00' --full-history --no-merges -- crates/burn-pack/src/writer.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: crates/burn-cubecl-fusion/src/optim/reduce/optimization.rs crates/burn-cubecl-fusion/src/optim/reduce/optimization.rs:473 — crates/burn-cubecl-fusion/src/optim/reduce/optimization.rs changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is burn_cubecl_fusion::optim::reduce::optimization::reduce_instruction2config at line 473), 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(fusion): tune index-reading fused blocks on zeroed indices under CompileAndAutotune (#6076)”; “fix(cubecl): skip the reduce launch when another axis leaves the output empty (#5881)”; “fix(fusion): resolve reduce reference strides against the reference's argument list (#5847)”; “fix!: address fusion and autodiff edge cases (#5400)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 17:50:42 -05:00' --until='2026-11-12 17:50:42 -05:00' --full-history --no-merges -- crates/burn-cubecl-fusion/src/optim/reduce/optimization.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: crates/burn-cubecl-fusion/src/optim/reduce_broadcasted/optimization.rs crates/burn-cubecl-fusion/src/optim/reduce_broadcasted/optimization.rs:170 — crates/burn-cubecl-fusion/src/optim/reduce_broadcasted/optimization.rs changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is ReduceBroadcastedOptimization::execute at line 170), 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(fusion): tune index-reading fused blocks on zeroed indices under CompileAndAutotune (#6076)”; “fix(cubecl): skip the reduce launch when another axis leaves the output empty (#5881)”; “fix(fusion): avoid autotuning empty reductions (#5725)”; “fix!: address fusion and autodiff edge cases (#5400)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 17:50:42 -05:00' --until='2026-11-12 17:50:42 -05:00' --full-history --no-merges -- crates/burn-cubecl-fusion/src/optim/reduce_broadcasted/optimization.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: crates/burn-tensor/src/tensor/api/orderable.rs crates/burn-tensor/src/tensor/api/orderable.rs:1223 — crates/burn-tensor/src/tensor/api/orderable.rs changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is burn_tensor::tensor::api::orderable::one_hot_classes at line 1223), 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(tensor): return off-value rows for out-of-range one_hot_fill indices (#6065)”; “fix(cube): propagate NaNs in clamp and stabilize GPU tests (#5909)”; “fix(tensor): reject quantized inputs in *_like ops and one_hot (#5827)”; “fix(tensor): keep input dtype on empty slice/repeat/cat results and one_hot_fill (#5790)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 17:50:42 -05:00' --until='2026-11-12 17:50:42 -05:00' --full-history --no-merges -- crates/burn-tensor/src/tensor/api/orderable.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: crates/burn-router/src/channel/base.rs crates/burn-router/src/channel/base.rs:46 — crates/burn-router/src/channel/base.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is RouterChannel::change_client_backend at line 46), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(router)!: move quantized tensors between router clients (#6474)”; “fix(tensor): enforce destination bool storage during transfers (#6414)”; “fix(router): move unsigned int tensors between router clients (#6230)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 17:50:42 -05:00' --until='2026-11-12 17:50:42 -05:00' --full-history --no-merges -- crates/burn-router/src/channel/base.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: crates/burn-derive/src/module/codegen_struct.rs crates/burn-derive/src/module/codegen_struct.rs:378 — crates/burn-derive/src/module/codegen_struct.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is burn_derive::module::codegen_struct::is_primitive_type at line 378), 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(derive): preserve generic submodules with primitive type arguments (#6000)”; “fix(module): clarify derive field handling and suggest `#[module(skip)]` (#5997)”; “fix(module): preserve reparameterizations during validation (#5821)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 17:50:42 -05:00' --until='2026-11-12 17:50:42 -05:00' --full-history --no-merges -- crates/burn-derive/src/module/codegen_struct.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: crates/burn-fusion/src/ops/qtensor.rs crates/burn-fusion/src/ops/qtensor.rs:460 — crates/burn-fusion/src/ops/qtensor.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is Fusion::q_matmul at line 460), 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(fusion): register uploads as materialized instead of queuing an Init (#5970)”; “fix(backend)!: separate device settings queries from initialization (#5869)”; “fix(tensor): make TensorData fields private and validate construction (#5838)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 17:50:42 -05:00' --until='2026-11-12 17:50:42 -05:00' --full-history --no-merges -- crates/burn-fusion/src/ops/qtensor.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: crates/burn-optim/src/optim/module/module_optimizer.rs crates/burn-optim/src/optim/module/module_optimizer.rs:247 — crates/burn-optim/src/optim/module/module_optimizer.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is ModuleOptimizer::load_record at line 247), 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(tensor): make TensorData fields private and validate construction (#5838)”; “fix(optim): keep a parameter's checkpointing strategy across an update (#5618)”; “fix(optim): keep tensor data in optimizer records (#5407)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 17:50:42 -05:00' --until='2026-11-12 17:50:42 -05:00' --full-history --no-merges -- crates/burn-optim/src/optim/module/module_optimizer.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: crates/pytorch-reader/src/nested/de.rs crates/pytorch-reader/src/nested/de.rs:119 — crates/pytorch-reader/src/nested/de.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is Deserializer::deserialize_struct at line 119), 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(pytorch-reader): handle unsupported values in deserialize_any (#5764)”; “fix(pytorch-reader): remove unsafe visitor cloning and deserialization panics (#5700)”; “fix(pytorch-reader): report values load_config cannot represent instead of defaulting (#5728)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 17:50:42 -05:00' --until='2026-11-12 17:50:42 -05:00' --full-history --no-merges -- crates/pytorch-reader/src/nested/de.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: crates/burn-pack/src/reader.rs crates/burn-pack/src/reader.rs:349 — crates/burn-pack/src/reader.rs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is burn_pack::reader::read_header at line 349), 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(pack): validate tensor byte lengths when reading (#5576)”; “fix(pack): validate size from aligned data offset (#5530)”; “fix(store): preserve extensionless burnpack paths (#5494)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 17:50:42 -05:00' --until='2026-11-12 17:50:42 -05:00' --full-history --no-merges -- crates/burn-pack/src/reader.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: crates/burn-communication/src/websocket/client.rs crates/burn-communication/src/websocket/client.rs:64 — crates/burn-communication/src/websocket/client.rs changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is WsClientChannel::recv at line 64), 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(remote): let a WebSocket server read what its clients send (#5903)”; “fix(remote): notice a WebSocket peer that vanished without closing (#5825)”; “fix(remote): try again while a server is not reachable yet (#5824)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 17:50:42 -05:00' --until='2026-11-12 17:50:42 -05:00' --full-history --no-merges -- crates/burn-communication/src/websocket/client.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
D2 · Cognitive Complexity · burn_cubecl · ×15
  • burn_cubecl::kernel::pool::max_pool3d::max_pool3d_forward_kernel (cognitive 60) crates/burn-cubecl/src/kernel/pool/max_pool3d.rs:31 — burn_cubecl::kernel::pool::max_pool3d::max_pool3d_forward_kernel has cognitive complexity 60 (threshold 15). Drivers by points: if/else 11 (47 pts), loops 3 (12 pts), boolean chains 1 (nesting depth added 45). 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.
  • burn_cubecl::kernel::pool::avg_pool3d::avg_pool3d_forward_kernel (cognitive 51) crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:31 — burn_cubecl::kernel::pool::avg_pool3d::avg_pool3d_forward_kernel has cognitive complexity 51 (threshold 15). Drivers by points: if/else 12 (39 pts), loops 3 (12 pts) (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.
  • burn_cubecl::kernel::ctc::ctc_alpha_beta_kernel (cognitive 47) crates/burn-cubecl/src/kernel/ctc.rs:394 — burn_cubecl::kernel::ctc::ctc_alpha_beta_kernel has cognitive complexity 47 (threshold 15). Drivers by points: if/else 15 (31 pts), loops 8 (12 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.
  • burn_cubecl::kernel::pool::avg_pool3d::avg_pool3d_backward_kernel (cognitive 44) crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:162 — burn_cubecl::kernel::pool::avg_pool3d::avg_pool3d_backward_kernel has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (35 pts), loops 3 (9 pts) (nesting depth added 27). 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.
  • burn_cubecl::kernel::conv::conv_transpose3d::transpose_direct::conv_transpose3d_kernel (cognitive 33) crates/burn-cubecl/src/kernel/conv/conv_transpose3d/transpose_direct.rs:31 — burn_cubecl::kernel::conv::conv_transpose3d::transpose_direct::conv_transpose3d_kernel has cognitive complexity 33 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 4 (13 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.
  • burn_cubecl::ops::base::q_reshape (cognitive 28) crates/burn-cubecl/src/ops/base.rs:346 — burn_cubecl::ops::base::q_reshape has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 6, match/switch 4 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • burn_cubecl::kernel::ctc::ctc_loss_kernel (cognitive 26) crates/burn-cubecl/src/kernel/ctc.rs:176 — burn_cubecl::kernel::ctc::ctc_loss_kernel has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 4 (6 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.
  • burn_cubecl::kernel::pool::max_pool3d::max_pool3d_backward_kernel (cognitive 24) crates/burn-cubecl/src/kernel/pool/max_pool3d.rs:136 — burn_cubecl::kernel::pool::max_pool3d::max_pool3d_backward_kernel has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (18 pts), loops 3 (6 pts) (nesting depth added 6). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • burn_cubecl::kernel::reduce::tune::with_routine_tunables (cognitive 21) crates/burn-cubecl/src/kernel/reduce/tune.rs:159 — burn_cubecl::kernel::reduce::tune::with_routine_tunables has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (3 pts), match/switch 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.
  • burn_cubecl::kernel::conv::conv_transpose3d::col2im::col2im_3d_kernel (cognitive 20) crates/burn-cubecl/src/kernel/conv/conv_transpose3d/col2im.rs:261 — burn_cubecl::kernel::conv::conv_transpose3d::col2im::col2im_3d_kernel has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 3 (6 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.
  • burn_cubecl::kernel::conv::deform_conv2d::bilinear_interpolate (cognitive 18) crates/burn-cubecl/src/kernel/conv/deform_conv2d.rs:130 — burn_cubecl::kernel::conv::deform_conv2d::bilinear_interpolate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 5 (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.
  • burn_cubecl::kernel::conv::deform_conv_transpose2d::get_coordinate_weight (cognitive 18) crates/burn-cubecl/src/kernel/conv/deform_conv_transpose2d.rs:417 — burn_cubecl::kernel::conv::deform_conv_transpose2d::get_coordinate_weight has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, boolean chains 8. 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.
  • burn_cubecl::ops::qtensor::new_quantized (cognitive 18) crates/burn-cubecl/src/ops/qtensor.rs:84 — burn_cubecl::ops::qtensor::new_quantized has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 7 (12 pts), if/else 3 (6 pts) (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • burn_cubecl::kernel::conv::conv_transpose2d::transpose_direct::conv_transpose2d_direct_nhwc_kernel (cognitive 17) crates/burn-cubecl/src/kernel/conv/conv_transpose2d/transpose_direct.rs:106 — burn_cubecl::kernel::conv::conv_transpose2d::transpose_direct::conv_transpose2d_direct_nhwc_kernel has cognitive complexity 17 (threshold 15). Drivers by points: loops 3 (9 pts), if/else 4 (8 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.
  • burn_cubecl::kernel::conv::im2col::plan_taps (cognitive 17) crates/burn-cubecl/src/kernel/conv/im2col.rs:656 — burn_cubecl::kernel::conv::im2col::plan_taps has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 2 (6 pts), if/else 2 (5 pts), loops 3 (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.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×14
  • Edited copy of a member (10 corresponding lines) crates/burn-ir/src/operation.rs:3936 — crates/burn-ir/src/operation.rs:3936-3945 | crates/burn-ir/src/operation.rs:3946-3955 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/burn-flex/src/ops/comparison.rs:733 — crates/burn-flex/src/ops/comparison.rs:733-742 | crates/burn-flex/src/ops/comparison.rs:750-759 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/burn-backend/src/backend/ops/tensor.rs:1096 — crates/burn-backend/src/backend/ops/tensor.rs:1096-1105 | crates/burn-flex/src/ops/float.rs:1275-1284 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/burn-backend/src/backend/ops/modules/pool.rs:68 — crates/burn-backend/src/backend/ops/modules/pool.rs:68-77 | crates/burn-backend/src/backend/ops/modules/pool.rs:82-92 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/burn-derive/src/module/codegen_enum.rs:356 — crates/burn-derive/src/module/codegen_enum.rs:356-366 | crates/burn-derive/src/module/codegen_enum.rs:368-377 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/burn-dispatch/src/tensor.rs:61 — crates/burn-dispatch/src/tensor.rs:61-70 | crates/burn-dispatch/src/tensor.rs:73-82 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/burn-store/src/safetensors/store.rs:823 — crates/burn-store/src/safetensors/store.rs:823-832 | crates/burn-store/src/safetensors/store.rs:834-843 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/burn-backend/src/backend/ops/activation.rs:124 — crates/burn-backend/src/backend/ops/activation.rs:124-133 | crates/burn-backend/src/backend/ops/activation.rs:164-175 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/burn-std/src/data/tensor/base.rs:659 — crates/burn-std/src/data/tensor/base.rs:659-668 | crates/burn-std/src/data/tensor/base.rs:674-686 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/burn-nn/src/modules/transformer/decoder.rs:517 — crates/burn-nn/src/modules/transformer/decoder.rs:517-526 | crates/burn-nn/src/modules/transformer/encoder.rs:207-223 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/burn-tensor/src/tensor/api/orderable.rs:706 — crates/burn-tensor/src/tensor/api/orderable.rs:706-715 | crates/burn-tensor/src/tensor/api/orderable.rs:963-972 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/burn-cubecl-fusion/src/base.rs:67 — crates/burn-cubecl-fusion/src/base.rs:67-77 | crates/burn-cubecl/src/tensor/base.rs:82-91 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/burn-dataset/src/nlp/text_folder.rs:312 — crates/burn-dataset/src/nlp/text_folder.rs:312-321 | crates/burn-dataset/src/vision/image_folder.rs:781-793 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) crates/burn-cubecl-fusion/src/engine/settings.rs:36 — crates/burn-cubecl-fusion/src/engine/settings.rs:36-45 | crates/burn-cubecl-fusion/src/optim/nhwc_relayout/fuser.rs:59-70 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×13
  • Edited copy of a member (13 corresponding lines) crates/burn-backend/src/backend/ops/modules/base.rs:333 — crates/burn-backend/src/backend/ops/modules/base.rs:333-345 | crates/burn-flex/src/ops/module.rs:915-937 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/burn-shard/src/backend/tensor.rs:229 — crates/burn-shard/src/backend/tensor.rs:229-241 | crates/burn-shard/src/backend/tensor.rs:272-289 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/burn-backend/src/backend/ops/pad.rs:159 — crates/burn-backend/src/backend/ops/pad.rs:159-171 | crates/burn-backend/src/backend/ops/pad.rs:177-189 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/burn-fusion/src/inspect.rs:298 — crates/burn-fusion/src/inspect.rs:298-312 | crates/burn-fusion/src/inspect.rs:315-327 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/burn-core/src/data/dataloader/batch.rs:108 — crates/burn-core/src/data/dataloader/batch.rs:108-120 | crates/burn-core/src/data/dataloader/batch.rs:122-135 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/burn-remote/src/transport/iroh/transfer.rs:156 — crates/burn-remote/src/transport/iroh/transfer.rs:156-170 | crates/burn-remote/src/transport/iroh/transfer.rs:236-248 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/burn-core/src/module/parallel/pipeline.rs:90 — crates/burn-core/src/module/parallel/pipeline.rs:90-102 | crates/burn-core/src/module/parallel/pipeline.rs:110-122 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/burn-tensor/src/tensor/api/base.rs:3245 — crates/burn-tensor/src/tensor/api/base.rs:3245-3257 | crates/burn-tensor/src/tensor/api/base.rs:3267-3279 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/burn-flex/src/zip.rs:63 — crates/burn-flex/src/zip.rs:63-75 | crates/burn-flex/src/zip.rs:338-350 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/burn-tensor/src/tensor/module.rs:487 — crates/burn-tensor/src/tensor/module.rs:487-499 | crates/burn-tensor/src/tensor/module.rs:553-565 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/burn-flex/src/ops/gather_scatter.rs:1443 — crates/burn-flex/src/ops/gather_scatter.rs:1443-1455 | crates/burn-flex/src/ops/gather_scatter.rs:1479-1491 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/burn-linalg/src/check.rs:10 — crates/burn-linalg/src/check.rs:10-22 | crates/burn-tensor/src/tensor/api/check.rs:1295-1308 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/burn-rl/src/policy/async_policy.rs:274 — crates/burn-rl/src/policy/async_policy.rs:274-286 | crates/burn-rl/src/policy/async_policy.rs:292-306 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×13
  • Duplicated block (16 lines × 2) crates/burn-cubecl-fusion/src/engine/codegen/io.rs:90 — crates/burn-cubecl-fusion/src/engine/codegen/io.rs:90-105 | crates/burn-cubecl-fusion/src/engine/codegen/io.rs:123-138 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl-fusion/src/engine/codegen/io.rs:90` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 2) crates/burn-cubecl-fusion/src/engine/fuser.rs:354 — crates/burn-cubecl-fusion/src/engine/fuser.rs:354-369 | crates/burn-cubecl-fusion/src/engine/fuser.rs:371-386 — both copies are in the same file, so extract the 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 (16 lines × 2) crates/burn-cubecl-fusion/src/engine/trace/block.rs:306 — crates/burn-cubecl-fusion/src/engine/trace/block.rs:306-321 | crates/burn-cubecl-fusion/src/engine/trace/block.rs:387-402 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl-fusion/src/engine/trace/block.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 (16 lines × 2) crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:345 — crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:345-360 | crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:401-416 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:345` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) crates/burn-cubecl/src/kernel/unary_float.rs:87 — crates/burn-cubecl/src/kernel/unary_float.rs:87-102 | crates/burn-cubecl/src/kernel/unary_numeric.rs:86-101 — before extracting anything, compare `crates/burn-cubecl/src/kernel/unary_float.rs` and `crates/burn-cubecl/src/kernel/unary_numeric.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/unary_float.rs:87` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) crates/burn-dispatch/src/backend.rs:466 — crates/burn-dispatch/src/backend.rs:466-481 | crates/burn-dispatch/src/backend.rs:508-523 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-dispatch/src/backend.rs:466` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) crates/burn-flex/src/ops/activation.rs:372 — crates/burn-flex/src/ops/activation.rs:372-387 | crates/burn-flex/src/ops/activation.rs:548-563 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/activation.rs:372` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `input` to `&[f32]` in one and `&[f64]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (16 lines × 2) crates/burn-flex/src/ops/conv.rs:1993 — crates/burn-flex/src/ops/conv.rs:1993-2008 | crates/burn-flex/src/ops/conv_transpose.rs:563-578 — before extracting anything, compare `crates/burn-flex/src/ops/conv.rs` and `crates/burn-flex/src/ops/conv_transpose.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/conv.rs:1993` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 2) crates/burn-flex/src/ops/fft.rs:786 — crates/burn-flex/src/ops/fft.rs:786-801 | crates/burn-flex/src/ops/fft.rs:976-991 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/fft.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.
  • Duplicated block (16 lines × 2) crates/burn-flex/src/ops/gather_scatter.rs:719 — crates/burn-flex/src/ops/gather_scatter.rs:719-734 | crates/burn-flex/src/ops/gather_scatter.rs:737-752 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/gather_scatter.rs:719` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) crates/burn-flex/src/tensor.rs:857 — crates/burn-flex/src/tensor.rs:857-872 | crates/burn-flex/src/tensor.rs:903-918 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/tensor.rs:857` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) crates/burn-nn/src/modules/conv/conv2d.rs:82 — crates/burn-nn/src/modules/conv/conv2d.rs:82-97 | crates/burn-nn/src/modules/conv/conv3d.rs:86-101 — before extracting anything, compare `crates/burn-nn/src/modules/conv/conv2d.rs` and `crates/burn-nn/src/modules/conv/conv3d.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-nn/src/modules/conv/conv2d.rs:82` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 2) crates/burn-train/src/learner/supervised/strategies/multi/strategy.rs:91 — crates/burn-train/src/learner/supervised/strategies/multi/strategy.rs:91-106 | crates/burn-train/src/learner/supervised/strategies/single/strategy.rs:103-118 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-train/src/learner/supervised/strategies/multi/strategy.rs:91` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted 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 × 3) · ×13
  • Duplicated block (8 lines × 3) crates/burn-dataset/src/vision/image_folder.rs:635 — crates/burn-dataset/src/vision/image_folder.rs:635-642 | crates/burn-dataset/src/vision/image_folder.rs:665-672 | crates/burn-dataset/src/vision/image_folder.rs:695-702 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-dataset/src/vision/image_folder.rs:635` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) crates/burn-flex/src/ops/int.rs:1048 — crates/burn-flex/src/ops/int.rs:1048-1055 | crates/burn-flex/src/ops/int.rs:1063-1070 | crates/burn-flex/src/ops/int.rs:1078-1085 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/int.rs:1048` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) crates/burn-flex/src/ops/pool.rs:1241 — crates/burn-flex/src/ops/pool.rs:1241-1248 | crates/burn-flex/src/ops/pool.rs:1462-1469 | crates/burn-flex/src/ops/pool.rs:1660-1667 — all 3 copies are in the same file, so extract the block into one function there and call 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, `crates/burn-flex/src/ops/pool.rs:1240` calls `to_contiguous` and `crates/burn-flex/src/ops/pool.rs:1461` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 3) crates/burn-fusion/src/stream/context.rs:422 — crates/burn-fusion/src/stream/context.rs:422-429 | crates/burn-fusion/src/stream/context.rs:432-439 | crates/burn-fusion/src/stream/context.rs:468-475 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-fusion/src/stream/context.rs:422` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) crates/burn-fusion/src/stream/context.rs:722 — crates/burn-fusion/src/stream/context.rs:722-729 | crates/burn-fusion/src/stream/context.rs:741-748 | crates/burn-fusion/src/stream/context.rs:760-767 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-fusion/src/stream/context.rs:722` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) crates/burn-train/src/metric/bleu.rs:349 — crates/burn-train/src/metric/bleu.rs:349-357 | crates/burn-train/src/metric/cer.rs:98-105 | crates/burn-train/src/metric/wer.rs:76-84 — before extracting anything, compare `crates/burn-train/src/metric/cer.rs` and `crates/burn-train/src/metric/wer.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-train/src/metric/bleu.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.
  • Duplicated block (8 lines × 3) crates/burn-train/src/metric/vision/fid/inception.rs:59 — crates/burn-train/src/metric/vision/fid/inception.rs:59-66 | crates/burn-train/src/metric/vision/fid/inception.rs:115-122 | crates/burn-train/src/metric/vision/fid/inception.rs:309-316 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-train/src/metric/vision/fid/inception.rs:59` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (8 lines × 3) crates/burn-train/src/metric/vision/lpips/metric.rs:157 — crates/burn-train/src/metric/vision/lpips/metric.rs:157-164 | crates/burn-train/src/metric/vision/lpips/metric.rs:179-186 | crates/burn-train/src/metric/vision/lpips/metric.rs:190-205 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-train/src/metric/vision/lpips/metric.rs:157` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8 lines × 3) crates/burn-train/src/metric/vision/lpips/weights.rs:204 — crates/burn-train/src/metric/vision/lpips/weights.rs:204-211 | crates/burn-train/src/metric/vision/lpips/weights.rs:215-222 | crates/burn-train/src/metric/vision/lpips/weights.rs:225-232 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-train/src/metric/vision/lpips/weights.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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8 lines × 3) crates/burn-tensor/src/tensor/api/check.rs:1615 — crates/burn-tensor/src/tensor/api/check.rs:1615-1622 | crates/burn-tensor/src/tensor/api/check.rs:1667-1674 | crates/burn-tensor/src/tensor/api/check.rs:1681-1688 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-tensor/src/tensor/api/check.rs:1615` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) crates/burn-nn/src/loss/gaussian_nll.rs:86 — crates/burn-nn/src/loss/gaussian_nll.rs:86-93 | crates/burn-nn/src/loss/margin_ranking.rs:83-90 | crates/burn-nn/src/loss/triplet_margin.rs:86-93 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-nn/src/loss/gaussian_nll.rs:86` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) crates/burn-nn/src/modules/conv/conv_transpose1d.rs:171 — crates/burn-nn/src/modules/conv/conv_transpose1d.rs:171-178 | crates/burn-nn/src/modules/conv/conv_transpose2d.rs:172-179 | crates/burn-nn/src/modules/conv/conv_transpose3d.rs:173-180 — before extracting anything, compare `crates/burn-nn/src/modules/conv/conv_transpose1d.rs` and `crates/burn-nn/src/modules/conv/conv_transpose2d.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `input` to `Tensor<3>` in one and `Tensor<4>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (8 lines × 3) crates/burn-tensor/src/tensor/module.rs:446 — crates/burn-tensor/src/tensor/module.rs:446-453 | crates/burn-tensor/src/tensor/module.rs:513-520 | crates/burn-tensor/src/tensor/module.rs:980-987 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-tensor/src/tensor/module.rs:446` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `options` to `MaxPoolOptions<3>` in one and `AvgPoolOptions<3>` 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.
D3 · God Classes · ClassTooLong · ×12
  • ClassTooLong: TensorInterpreter crates/burn-router/src/interpreter.rs:62 — ClassTooLong — 1805 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 45 methods, 4 blocks, lines 62-2628. The bar is 400 significant lines; this is 1405 over it, 4.51× 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: TensorCheck crates/burn-tensor/src/tensor/api/check.rs:36 — ClassTooLong — 1111 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 58 methods, 2 blocks, lines 36-1834. The bar is 400 significant lines; this is 711 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: ModuleOperationIr crates/burn-ir/src/operation.rs:224 — ClassTooLong — 889 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 4 methods, 2 blocks, lines 224-5124. The bar is 400 significant lines; this is 489 over it, 2.22× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Tensor crates/burn-tensor/src/tensor/api/base.rs:76 — ClassTooLong — 731 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 293 methods, 7 blocks, lines 76-3843. The bar is 400 significant lines; this is 331 over it, 1.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: RemoteService crates/burn-remote/src/client/service.rs:84 — ClassTooLong — 651 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 58 methods, 5 blocks, lines 84-1297. The bar is 400 significant lines; this is 251 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.
  • ClassTooLong: ModuleOps crates/burn-backend/src/backend/ops/modules/base.rs:161 — ClassTooLong — 641 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 68 methods. The bar is 400 significant lines; this is 241 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: OutputPlanner crates/burn-cubecl-fusion/src/engine/launch/output.rs:32 — ClassTooLong — 578 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 13 methods, 2 blocks, lines 32-955. The bar is 400 significant lines; this is 178 over it, 1.45× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: NumericOperationIr crates/burn-ir/src/operation.rs:539 — ClassTooLong — 502 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 4 methods, 2 blocks, lines 539-3405. The bar is 400 significant lines; this is 102 over it, 1.26× 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: TraceOperationFuser crates/burn-cubecl-fusion/src/engine/fuser.rs:33 — ClassTooLong — 501 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 20 methods, 4 blocks, lines 33-886. The bar is 400 significant lines; this is 101 over it, 1.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: SessionHandler crates/burn-remote/src/server/worker.rs:89 — ClassTooLong — 489 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 89-814. The bar is 400 significant lines; this is 89 over it, 1.22× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Dispatch crates/burn-dispatch/src/backend.rs:160 — ClassTooLong — 471 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, 6 blocks, lines 163-1259. The bar is 400 significant lines; this is 71 over it, 1.18× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: FloatTensorOps crates/burn-backend/src/backend/ops/tensor.rs:15 — ClassTooLong — 428 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 130 methods. The bar is 400 significant lines; this is 28 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
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 (6 corresponding lines) · ×12
  • Edited copy of a member (6 corresponding lines) crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:347 — crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:347-1100 | crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:1128-1133 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/burn-backend/src/backend/ops/activation.rs:19 — crates/burn-backend/src/backend/ops/activation.rs:19-26 | crates/burn-backend/src/backend/ops/activation.rs:81-86 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/burn-signal/src/custom.rs:27 — crates/burn-signal/src/custom.rs:27-35 | crates/burn-signal/src/custom.rs:43-48 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/burn-fusion/src/custom.rs:143 — crates/burn-fusion/src/custom.rs:143-191 | crates/burn-fusion/src/custom.rs:396-481 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/burn-train/src/renderer/cli.rs:100 — crates/burn-train/src/renderer/cli.rs:100-109 | crates/burn-train/src/renderer/tui/renderer.rs:305-310 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/burn-backend/src/backend/ops/activation.rs:235 — crates/burn-backend/src/backend/ops/activation.rs:235-241 | crates/burn-backend/src/backend/ops/activation.rs:256-261 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/burn-backend/src/backend/ops/int_tensor.rs:969 — crates/burn-backend/src/backend/ops/int_tensor.rs:969-974 | crates/burn-backend/src/backend/ops/int_tensor.rs:986-991 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/burn-backend/src/backend/ops/tensor.rs:1505 — crates/burn-backend/src/backend/ops/tensor.rs:1505-1514 | crates/burn-backend/src/backend/ops/tensor.rs:1528-1533 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/burn-fusion/src/custom.rs:143 — crates/burn-fusion/src/custom.rs:143-177 | crates/burn-fusion/src/custom.rs:396-463 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/burn-backend/src/backend/ops/qtensor.rs:1178 — crates/burn-backend/src/backend/ops/qtensor.rs:1178-1183 | crates/burn-backend/src/backend/ops/tensor.rs:1665-1670 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/burn-cubecl/src/fusion/registry.rs:299 — crates/burn-cubecl/src/fusion/registry.rs:299-304 | crates/burn-shard/src/backend/plan.rs:54-60 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) crates/burn-no-std-tests/src/burnpack.rs:20 — crates/burn-no-std-tests/src/burnpack.rs:20-26 | crates/burn-no-std-tests/src/safetensors.rs:19-24 — 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 · Edited copy of a member (8 corresponding lines) · ×12
  • Edited copy of a member (8 corresponding lines) crates/burn-flex/src/ops/activation.rs:993 — crates/burn-flex/src/ops/activation.rs:993-1001 | crates/burn-flex/src/ops/activation.rs:1012-1019 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/burn-flex/src/ops/activation.rs:785 — crates/burn-flex/src/ops/activation.rs:785-792 | crates/burn-flex/src/ops/activation.rs:801-808 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/burn-router/src/interpreter.rs:2639 — crates/burn-router/src/interpreter.rs:2639-2646 | crates/burn-shard/src/backend/tensor.rs:406-413 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/burn-communication/src/websocket/client.rs:184 — crates/burn-communication/src/websocket/client.rs:184-192 | crates/burn-communication/src/websocket/server.rs:278-285 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/burn-flex/src/layout.rs:18 — crates/burn-flex/src/layout.rs:18-25 | crates/burn-flex/src/ops/gather_scatter.rs:1213-1220 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/burn-autodiff/src/ops/collective.rs:270 — crates/burn-autodiff/src/ops/collective.rs:270-280 | crates/burn-backend/src/backend/ops/collective.rs:371-378 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/burn-nn/src/modules/attention/mha.rs:483 — crates/burn-nn/src/modules/attention/mha.rs:483-490 | crates/burn-nn/src/modules/attention/mha.rs:494-501 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/burn-backend/src/backend/ops/modules/conv.rs:394 — crates/burn-backend/src/backend/ops/modules/conv.rs:394-401 | crates/burn-backend/src/backend/ops/modules/conv.rs:507-514 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/burn-optim/src/lr_scheduler/module_lr_scheduler.rs:159 — crates/burn-optim/src/lr_scheduler/module_lr_scheduler.rs:159-167 | crates/burn-optim/src/lr_scheduler/composed.rs:132-139 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/burn-nn/src/activation/swiglu.rs:55 — crates/burn-nn/src/activation/swiglu.rs:55-62 | crates/burn-nn/src/modules/linear.rs:173-180 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/burn-train/src/checkpoint/async_checkpoint.rs:95 — crates/burn-train/src/checkpoint/async_checkpoint.rs:95-102 | crates/burn-train/src/logger/async_logger.rs:49-56 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/burn-tensor/src/bridge/ops/float.rs:250 — crates/burn-tensor/src/bridge/ops/float.rs:250-257 | crates/burn-tensor/src/tensor/api/float.rs:1219-1226 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×12
  • Duplicated block (9 lines × 3) crates/burn-autodiff/src/ops/tensor.rs:1020 — crates/burn-autodiff/src/ops/tensor.rs:1020-1028 | crates/burn-autodiff/src/ops/tensor.rs:2817-2825 | crates/burn-autodiff/src/ops/tensor.rs:4779-4787 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/tensor.rs:1020` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) crates/burn-cubecl/src/kernel/conv/backward_data/implicit_gemm/launch.rs:112 — crates/burn-cubecl/src/kernel/conv/backward_data/implicit_gemm/launch.rs:112-120 | crates/burn-cubecl/src/kernel/conv/backward_weight/implicit_gemm/launch.rs:112-120 | crates/burn-cubecl/src/kernel/conv/forward/implicit_gemm/launch.rs:147-155 — before extracting anything, compare `crates/burn-cubecl/src/kernel/conv/backward_data/implicit_gemm/launch.rs` and `crates/burn-cubecl/src/kernel/conv/backward_weight/implicit_gemm/launch.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/conv/backward_data/implicit_gemm/launch.rs:112` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) crates/burn-cubecl/src/kernel/unary_float.rs:56 — crates/burn-cubecl/src/kernel/unary_float.rs:56-64 | crates/burn-cubecl/src/kernel/unary_int.rs:50-58 | crates/burn-cubecl/src/kernel/unary_numeric.rs:55-63 — before extracting anything, compare `crates/burn-cubecl/src/kernel/unary_float.rs` and `crates/burn-cubecl/src/kernel/unary_int.rs` as WHOLE FILES: this scan already matched 5 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 `crates/burn-cubecl/src/kernel/unary_float.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.
  • Duplicated block (9 lines × 3) crates/burn-fusion/src/stream/context.rs:444 — crates/burn-fusion/src/stream/context.rs:444-452 | crates/burn-fusion/src/stream/context.rs:457-465 | crates/burn-fusion/src/stream/context.rs:480-488 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-fusion/src/stream/context.rs:444` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) crates/burn-fusion/src/stream/context.rs:543 — crates/burn-fusion/src/stream/context.rs:543-551 | crates/burn-fusion/src/stream/context.rs:577-585 | crates/burn-fusion/src/stream/context.rs:611-619 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-fusion/src/stream/context.rs:543` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) crates/burn-fusion/src/stream/context.rs:556 — crates/burn-fusion/src/stream/context.rs:556-564 | crates/burn-fusion/src/stream/context.rs:590-598 | crates/burn-fusion/src/stream/context.rs:624-632 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-fusion/src/stream/context.rs:556` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) crates/burn-train/src/learner/rl/env_runner/async_runner.rs:243 — crates/burn-train/src/learner/rl/env_runner/async_runner.rs:243-254 | crates/burn-train/src/learner/rl/env_runner/async_runner.rs:474-485 | crates/burn-train/src/learner/rl/env_runner/base.rs:248-256 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-train/src/learner/rl/env_runner/async_runner.rs:243` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 3) crates/burn-backend/src/backend/ops/bool_tensor.rs:216 — crates/burn-backend/src/backend/ops/bool_tensor.rs:216-224 | crates/burn-backend/src/backend/ops/int_tensor.rs:171-179 | crates/burn-backend/src/backend/ops/tensor.rs:631-639 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-backend/src/backend/ops/bool_tensor.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 (9 lines × 3) crates/burn-nn/src/modules/pool/avg_pool1d.rs:111 — crates/burn-nn/src/modules/pool/avg_pool1d.rs:111-119 | crates/burn-nn/src/modules/pool/avg_pool2d.rs:114-122 | crates/burn-nn/src/modules/pool/avg_pool3d.rs:112-120 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `input` to `&Tensor<3>` in one and `&Tensor<4>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 3) crates/burn-nn/src/modules/pool/max_pool1d.rs:104 — crates/burn-nn/src/modules/pool/max_pool1d.rs:104-112 | crates/burn-nn/src/modules/pool/max_pool2d.rs:108-116 | crates/burn-nn/src/modules/pool/max_pool3d.rs:112-120 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `input` to `&Tensor<3>` in one and `&Tensor<4>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 3) crates/burn-nn/src/modules/conv/conv1d.rs:173 — crates/burn-nn/src/modules/conv/conv1d.rs:173-181 | crates/burn-nn/src/modules/conv/conv2d.rs:198-206 | crates/burn-nn/src/modules/conv/conv3d.rs:190-198 — before extracting anything, compare `crates/burn-nn/src/modules/conv/conv2d.rs` and `crates/burn-nn/src/modules/conv/conv3d.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `input` to `Tensor<3>` in one and `Tensor<4>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 3) crates/burn-flex/src/tensor.rs:168 — crates/burn-flex/src/tensor.rs:168-176 | crates/burn-flex/src/tensor.rs:192-200 | crates/burn-flex/src/tensor.rs:214-222 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/tensor.rs:168` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those 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 · burn_cubecl_fusion · ×11
  • burn_cubecl_fusion::engine::launch::vectorization::base::vectorization_swapped (cognitive 30) crates/burn-cubecl-fusion/src/engine/launch/vectorization/base.rs:384 — burn_cubecl_fusion::engine::launch::vectorization::base::vectorization_swapped has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 4, loops 2 (4 pts), 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.
  • burn_cubecl_fusion::engine::launch::vectorization::planner::vector_sizes_quants (cognitive 28) crates/burn-cubecl-fusion/src/engine/launch/vectorization/planner.rs:387 — burn_cubecl_fusion::engine::launch::vectorization::planner::vector_sizes_quants has cognitive complexity 28 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 3 (8 pts), match/switch 4 (8 pts) (nesting depth added 17). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • burn_cubecl_fusion::engine::codegen::kernel::init_locals (cognitive 27) crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:109 — burn_cubecl_fusion::engine::codegen::kernel::init_locals has cognitive complexity 27 (threshold 15). Drivers by points: loops 6 (18 pts), match/switch 5 (9 pts) (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • burn_cubecl_fusion::engine::launch::vectorization::base::vectorization_reshape (cognitive 25) crates/burn-cubecl-fusion/src/engine/launch/vectorization/base.rs:313 — burn_cubecl_fusion::engine::launch::vectorization::base::vectorization_reshape has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 2 (4 pts), boolean chains 3, 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.
  • burn_cubecl_fusion::engine::launch::vectorization::planner::apply_vectorization_block (cognitive 25) crates/burn-cubecl-fusion/src/engine/launch/vectorization/planner.rs:336 — burn_cubecl_fusion::engine::launch::vectorization::planner::apply_vectorization_block has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 2 (5 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.
  • burn_cubecl_fusion::engine::codegen::kernel::concat (cognitive 22) crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:745 — burn_cubecl_fusion::engine::codegen::kernel::concat has cognitive complexity 22 (threshold 15). Drivers by points: loops 4 (11 pts), if/else 4 (9 pts), boolean chains 2 (nesting depth added 12). 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.
  • burn_cubecl_fusion::engine::launch::vectorization::base::vectorization_default (cognitive 20) crates/burn-cubecl-fusion/src/engine/launch/vectorization/base.rs:89 — burn_cubecl_fusion::engine::launch::vectorization::base::vectorization_default has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 4 (14 pts), if/else 2 (3 pts), loops 3 (nesting depth added 11). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own 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.
  • burn_cubecl_fusion::engine::codegen::io::read (cognitive 18) crates/burn-cubecl-fusion/src/engine/codegen/io.rs:40 — burn_cubecl_fusion::engine::codegen::io::read has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 4 (7 pts) (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • burn_cubecl_fusion::engine::launch::vectorization::base::vectorization_input (cognitive 17) crates/burn-cubecl-fusion/src/engine/launch/vectorization/base.rs:213 — burn_cubecl_fusion::engine::launch::vectorization::base::vectorization_input has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (4 pts), boolean chains 2, 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.
  • burn_cubecl_fusion::engine::codegen::kernel::select_indices (cognitive 16) crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:589 — burn_cubecl_fusion::engine::codegen::kernel::select_indices has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (4 pts), match/switch 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.
  • burn_cubecl_fusion::engine::launch::output::remove_concrete_write (cognitive 16) crates/burn-cubecl-fusion/src/engine/launch/output.rs:1029 — burn_cubecl_fusion::engine::launch::output::remove_concrete_write has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 1 (2 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.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×11
  • Duplicated block (13 lines × 2) crates/burn-autodiff/src/ops/module.rs:181 — crates/burn-autodiff/src/ops/module.rs:181-193 | crates/burn-autodiff/src/ops/module.rs:214-226 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/module.rs:181` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/burn-cubecl/src/kernel/binary.rs:251 — crates/burn-cubecl/src/kernel/binary.rs:251-263 | crates/burn-cubecl/src/kernel/binary_int.rs:200-212 — before extracting anything, compare `crates/burn-cubecl/src/kernel/binary.rs` and `crates/burn-cubecl/src/kernel/binary_int.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/binary.rs:251` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/burn-flex/src/ops/fft.rs:201 — crates/burn-flex/src/ops/fft.rs:201-213 | crates/burn-flex/src/ops/fft.rs:1169-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.
  • Duplicated block (13 lines × 2) crates/burn-flex/src/ops/reduce.rs:1039 — crates/burn-flex/src/ops/reduce.rs:1039-1051 | crates/burn-flex/src/ops/reduce.rs:1268-1280 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/burn-flex/src/ops/reduce.rs:1038` calls `with_capacity` and `crates/burn-flex/src/ops/reduce.rs:1266` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 2) crates/burn-flex/src/ops/reduce.rs:1851 — crates/burn-flex/src/ops/reduce.rs:1851-1863 | crates/burn-flex/src/ops/reduce.rs:2005-2017 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/reduce.rs:1851` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) crates/burn-nn/src/loss/binary_cross_entropy.rs:43 — crates/burn-nn/src/loss/binary_cross_entropy.rs:43-55 | crates/burn-nn/src/loss/cross_entropy.rs:62-74 — 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) crates/burn-nn/src/modules/conv/conv_transpose2d.rs:106 — crates/burn-nn/src/modules/conv/conv_transpose2d.rs:106-118 | crates/burn-nn/src/modules/conv/conv_transpose3d.rs:107-119 — before extracting anything, compare `crates/burn-nn/src/modules/conv/conv_transpose2d.rs` and `crates/burn-nn/src/modules/conv/conv_transpose3d.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-nn/src/modules/conv/conv_transpose2d.rs:106` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 2) crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs:152 — crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs:152-164 | crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs:252-264 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-train/src/learner/supervised/strategies/multi/epoch.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.
  • Duplicated block (13 lines × 2) crates/burn-flex/src/ops/gather_scatter.rs:1232 — crates/burn-flex/src/ops/gather_scatter.rs:1232-1244 | crates/burn-flex/src/ops/gather_scatter.rs:1304-1316 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/burn-flex/src/ops/gather_scatter.rs:1231` calls `to_contiguous` and `crates/burn-flex/src/ops/gather_scatter.rs:1303` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 2) crates/burn-signal/src/functions/stft.rs:88 — crates/burn-signal/src/functions/stft.rs:88-101 | crates/burn-signal/src/functions/stft.rs:210-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-signal/src/functions/stft.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. Note first that the copies are not typed on the same thing: the declarations holding them bind `window` to `Option<Tensor<1>>` in one and `Tensor<1>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (13 lines × 2) crates/burn-tensor/src/tensor/api/check.rs:1546 — crates/burn-tensor/src/tensor/api/check.rs:1546-1558 | crates/burn-tensor/src/tensor/api/check.rs:1601-1613 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-tensor/src/tensor/api/check.rs:1546` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×11
  • Duplicated block (6 lines × 3) crates/burn-cubecl/src/kernel/binary.rs:241 — crates/burn-cubecl/src/kernel/binary.rs:241-246 | crates/burn-cubecl/src/kernel/binary_float.rs:161-166 | crates/burn-cubecl/src/kernel/binary_int.rs:189-194 — before extracting anything, compare `crates/burn-cubecl/src/kernel/binary.rs` and `crates/burn-cubecl/src/kernel/binary_float.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 105 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 3) crates/burn-flex/src/ops/int.rs:1120 — crates/burn-flex/src/ops/int.rs:1120-1125 | crates/burn-flex/src/ops/int.rs:1135-1140 | crates/burn-flex/src/ops/int.rs:1150-1155 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/int.rs:1120` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) crates/burn-flex/src/ops/pool.rs:363 — crates/burn-flex/src/ops/pool.rs:363-368 | crates/burn-flex/src/ops/pool.rs:795-800 | crates/burn-flex/src/ops/pool.rs:1075-1080 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/pool.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 (6 lines × 3) crates/burn-flex/src/ops/reduce.rs:1850 — crates/burn-flex/src/ops/reduce.rs:1850-1855 | crates/burn-flex/src/ops/reduce.rs:2160-2165 | crates/burn-flex/src/ops/reduce.rs:2281-2286 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/reduce.rs:1850` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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) crates/burn-flex/src/ops/reduce.rs:1904 — crates/burn-flex/src/ops/reduce.rs:1904-1909 | crates/burn-flex/src/ops/reduce.rs:2004-2009 | crates/burn-flex/src/ops/reduce.rs:2109-2114 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/reduce.rs:1904` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (6 lines × 3) crates/burn-fusion/src/stream/context.rs:396 — crates/burn-fusion/src/stream/context.rs:396-401 | crates/burn-fusion/src/stream/context.rs:405-410 | crates/burn-fusion/src/stream/context.rs:414-419 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-fusion/src/stream/context.rs:396` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) crates/burn-flex/src/ops/fft.rs:286 — crates/burn-flex/src/ops/fft.rs:286-291 | crates/burn-flex/src/ops/fft.rs:303-308 | crates/burn-flex/src/ops/fft.rs:321-326 — all 3 copies are in the same file, so extract the block into one function there and call it from 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) crates/burn-backend/src/backend/ops/qtensor.rs:1070 — crates/burn-backend/src/backend/ops/qtensor.rs:1070-1075 | crates/burn-backend/src/backend/ops/qtensor.rs:1124-1129 | crates/burn-backend/src/backend/ops/tensor.rs:1610-1615 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Note first that the copies are not typed on the same thing: the declarations holding them bind `tensor` to `QuantizedTensor<B>` in one and `FloatTensor<B>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (6 lines × 3) crates/burn-backend/src/backend/ops/qtensor.rs:1091 — crates/burn-backend/src/backend/ops/qtensor.rs:1091-1096 | crates/burn-backend/src/backend/ops/qtensor.rs:1145-1150 | crates/burn-backend/src/backend/ops/tensor.rs:1632-1637 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-backend/src/backend/ops/qtensor.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. Note first that the copies are not typed on the same thing: the declarations holding them bind `tensor` to `QuantizedTensor<B>` in one and `FloatTensor<B>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (6 lines × 3) crates/burn-flex/src/ops/conv.rs:282 — crates/burn-flex/src/ops/conv.rs:282-287 | crates/burn-flex/src/ops/conv.rs:1433-1439 | crates/burn-flex/src/ops/conv.rs:1659-1665 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/conv.rs:282` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6 lines × 3) crates/burn-flex/src/ops/mask.rs:424 — crates/burn-flex/src/ops/mask.rs:424-429 | crates/burn-flex/src/ops/mask.rs:464-469 | crates/burn-flex/src/ops/mask.rs:514-519 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/mask.rs:424` it does not close everything it opens, so those 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 · burn_linalg · ×10
  • burn_linalg::solve_cubecl::blocked_rhs (cyclomatic 46) crates/burn-linalg/src/solve_cubecl.rs:803 — burn_linalg::solve_cubecl::blocked_rhs 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.
  • burn_linalg::cholesky_gpu::panel (cyclomatic 45) crates/burn-linalg/src/cholesky_gpu.rs:76 — burn_linalg::cholesky_gpu::panel 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.
  • burn_linalg::solve_cubecl::factor_panel (cyclomatic 36) crates/burn-linalg/src/solve_cubecl.rs:352 — burn_linalg::solve_cubecl::factor_panel 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.
  • burn_linalg::svd_host::bidiag_host (cyclomatic 29) crates/burn-linalg/src/svd_host.rs:268 — burn_linalg::svd_host::bidiag_host has cyclomatic complexity 29 (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.
  • burn_linalg::solve_cubecl::factor_panel_shared (cyclomatic 28) crates/burn-linalg/src/solve_cubecl.rs:206 — burn_linalg::solve_cubecl::factor_panel_shared 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.
  • burn_linalg::functions::solve::solve_impl (cyclomatic 19) crates/burn-linalg/src/functions/solve.rs:69 — burn_linalg::functions::solve::solve_impl 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.
  • burn_linalg::solve_cubecl::solve_rhs_shared (cyclomatic 17) crates/burn-linalg/src/solve_cubecl.rs:619 — burn_linalg::solve_cubecl::solve_rhs_shared has cyclomatic complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
  • burn_linalg::functions::cholesky::cholesky (cyclomatic 16) crates/burn-linalg/src/functions/cholesky.rs:47 — burn_linalg::functions::cholesky::cholesky 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.
  • burn_linalg::solve_cubecl::swap_and_solve_upper (cyclomatic 16) crates/burn-linalg/src/solve_cubecl.rs:502 — burn_linalg::solve_cubecl::swap_and_solve_upper 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.
  • burn_linalg::svd_host::svd_host (cyclomatic 16) crates/burn-linalg/src/svd_host.rs:85 — burn_linalg::svd_host::svd_host has cyclomatic complexity 16 (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.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×10
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/burn-autodiff/src/ops/tensor.rs:238 — crates/burn-autodiff/src/ops/tensor.rs:238-263 | crates/burn-autodiff/src/ops/tensor.rs:307-332 | crates/burn-autodiff/src/ops/tensor.rs:594-619 | crates/burn-autodiff/src/ops/tensor.rs:685-710 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/burn-autodiff/src/ops/tensor.rs:3167 — crates/burn-autodiff/src/ops/tensor.rs:3167-3182 | crates/burn-autodiff/src/ops/tensor.rs:4320-4335 | crates/burn-autodiff/src/ops/tensor.rs:4364-4379 | crates/burn-autodiff/src/ops/tensor.rs:4646-4667 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/burn-cubecl-fusion/src/engine/launch/vectorization/base.rs:219 — crates/burn-cubecl-fusion/src/engine/launch/vectorization/base.rs:219-274 | crates/burn-cubecl-fusion/src/engine/launch/vectorization/base.rs:282-311 | crates/burn-cubecl-fusion/src/engine/launch/vectorization/base.rs:321-381 | crates/burn-cubecl-fusion/src/engine/launch/vectorization/base.rs:394-474 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:38 — crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:38-130 | crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:169-285 | crates/burn-cubecl/src/kernel/pool/max_pool3d.rs:39-133 | crates/burn-cubecl/src/kernel/pool/max_pool3d.rs:143-242 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/burn-flex/src/ops/mask.rs:101 — crates/burn-flex/src/ops/mask.rs:101-132 | crates/burn-flex/src/ops/mask.rs:135-166 | crates/burn-flex/src/ops/mask.rs:179-210 | crates/burn-flex/src/ops/mask.rs:218-246 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/burn-flex/src/ops/mask.rs:423 — crates/burn-flex/src/ops/mask.rs:423-460 | crates/burn-flex/src/ops/mask.rs:463-500 | crates/burn-flex/src/ops/mask.rs:513-550 | crates/burn-flex/src/ops/mask.rs:553-588 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/burn-flex/src/ops/pool.rs:843 — crates/burn-flex/src/ops/pool.rs:843-855 | crates/burn-flex/src/ops/pool.rs:866-878 | crates/burn-flex/src/ops/pool.rs:889-901 | crates/burn-flex/src/ops/pool.rs:912-924 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/burn-flex/src/simd/portable.rs:1730 — crates/burn-flex/src/simd/portable.rs:1730-1750 | crates/burn-flex/src/simd/portable.rs:1775-1795 | crates/burn-flex/src/simd/portable.rs:2057-2082 | crates/burn-flex/src/simd/portable.rs:2101-2124 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/burn-fusion/src/client.rs:333 — crates/burn-fusion/src/client.rs:333-367 | crates/burn-fusion/src/client.rs:378-412 | crates/burn-fusion/src/client.rs:424-458 | crates/burn-fusion/src/client.rs:469-503 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/burn-train/src/metric/bleu.rs:331 — crates/burn-train/src/metric/bleu.rs:331-405 | crates/burn-train/src/metric/cer.rs:84-142 | crates/burn-train/src/metric/rouge.rs:78-154 | crates/burn-train/src/metric/wer.rs:61-125 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×10
  • Edited copy of a member (12 corresponding lines) crates/burn-router/src/interpreter.rs:112 — crates/burn-router/src/interpreter.rs:112-123 | crates/burn-router/src/interpreter.rs:2433-2446 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/burn-flex/src/ops/qtensor.rs:294 — crates/burn-flex/src/ops/qtensor.rs:294-305 | crates/burn-flex/src/ops/qtensor.rs:311-322 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/burn-backend/src/backend/ops/collective.rs:279 — crates/burn-backend/src/backend/ops/collective.rs:279-290 | crates/burn-backend/src/backend/ops/collective.rs:306-317 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/burn-cubecl/src/ops/bool_tensor.rs:197 — crates/burn-cubecl/src/ops/bool_tensor.rs:197-208 | crates/burn-cubecl/src/ops/bool_tensor.rs:261-272 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/burn-train/src/metric/vision/afine/weights.rs:125 — crates/burn-train/src/metric/vision/afine/weights.rs:125-137 | crates/burn-train/src/metric/vision/afine/weights.rs:139-150 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/burn-train/src/learner/rl/paradigm.rs:294 — crates/burn-train/src/learner/rl/paradigm.rs:294-305 | crates/burn-train/src/learner/supervised/paradigm.rs:323-336 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/burn-train/src/metric/processor/metrics.rs:412 — crates/burn-train/src/metric/processor/metrics.rs:412-423 | crates/burn-train/src/metric/processor/metrics.rs:425-436 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/burn-flex/src/ops/pool.rs:596 — crates/burn-flex/src/ops/pool.rs:596-607 | crates/burn-flex/src/ops/pool.rs:939-951 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/burn-optim/src/lr_scheduler/composed.rs:141 — crates/burn-optim/src/lr_scheduler/composed.rs:141-152 | crates/burn-optim/src/lr_scheduler/module_lr_scheduler.rs:170-187 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/burn-train/src/metric/processor/error.rs:139 — crates/burn-train/src/metric/processor/error.rs:139-150 | crates/burn-train/src/learner/supervised/step/train.rs:45-56 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×10
  • Duplicated block (18 lines × 2) crates/burn-autodiff/src/ops/module.rs:1517 — crates/burn-autodiff/src/ops/module.rs:1517-1534 | crates/burn-autodiff/src/ops/module.rs:1621-1638 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/module.rs:1517` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) crates/burn-flex/src/ops/conv.rs:1417 — crates/burn-flex/src/ops/conv.rs:1417-1434 | crates/burn-flex/src/ops/conv.rs:1643-1660 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (18 lines × 2) crates/burn-flex/src/ops/conv.rs:1493 — crates/burn-flex/src/ops/conv.rs:1493-1510 | crates/burn-flex/src/ops/conv.rs:1728-1745 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/conv.rs:1493` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) crates/burn-flex/src/ops/deform_conv.rs:173 — crates/burn-flex/src/ops/deform_conv.rs:173-190 | crates/burn-flex/src/ops/deform_conv.rs:810-827 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (18 lines × 2) crates/burn-flex/src/ops/pool.rs:1042 — crates/burn-flex/src/ops/pool.rs:1042-1059 | crates/burn-flex/src/ops/pool.rs:1088-1105 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/pool.rs:1042` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) crates/burn-flex/src/ops/reduce.rs:1900 — crates/burn-flex/src/ops/reduce.rs:1900-1917 | crates/burn-flex/src/ops/reduce.rs:2105-2122 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/reduce.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 (18 lines × 2) crates/burn-flex/src/ops/reduce.rs:2156 — crates/burn-flex/src/ops/reduce.rs:2156-2173 | crates/burn-flex/src/ops/reduce.rs:2277-2294 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/reduce.rs:2156` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) crates/burn-train/src/metric/processor/full.rs:55 — crates/burn-train/src/metric/processor/full.rs:55-72 | crates/burn-train/src/metric/processor/rl_processor.rs:71-88 — 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) crates/burn-train/src/metric/processor/full.rs:75 — crates/burn-train/src/metric/processor/full.rs:75-92 | crates/burn-train/src/metric/processor/rl_processor.rs:91-108 — 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) crates/burn-vision/src/backends/cpu/connected_components/spaghetti/mod.rs:147 — crates/burn-vision/src/backends/cpu/connected_components/spaghetti/mod.rs:147-164 | crates/burn-vision/src/backends/cpu/connected_components/spaghetti/mod.rs:227-244 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-vision/src/backends/cpu/connected_components/spaghetti/mod.rs:147` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/burn-vision/src/backends/cpu/connected_components/spaghetti/mod.rs:165` calls `to_u8`, `update` and `crates/burn-vision/src/backends/cpu/connected_components/spaghetti/mod.rs:245` 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 × 3) · ×10
  • Duplicated block (7 lines × 3) crates/burn-autodiff/src/ops/module.rs:1721 — crates/burn-autodiff/src/ops/module.rs:1721-1727 | crates/burn-autodiff/src/ops/module.rs:1851-1857 | crates/burn-autodiff/src/ops/module.rs:1972-1978 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/module.rs:1721` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 3) crates/burn-cubecl/src/kernel/index/gather_nd.rs:41 — crates/burn-cubecl/src/kernel/index/gather_nd.rs:41-47 | crates/burn-cubecl/src/kernel/index/scatter_nd.rs:42-48 | crates/burn-cubecl/src/kernel/index/scatter_nd.rs:56-62 — before extracting anything, compare `crates/burn-cubecl/src/kernel/index/gather_nd.rs` and `crates/burn-cubecl/src/kernel/index/scatter_nd.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 `crates/burn-cubecl/src/kernel/index/gather_nd.rs:41` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 3) crates/burn-flex/src/ops/deform_conv.rs:414 — crates/burn-flex/src/ops/deform_conv.rs:414-420 | crates/burn-flex/src/ops/deform_conv.rs:711-718 | crates/burn-flex/src/ops/deform_conv.rs:992-998 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 3) crates/burn-flex/src/ops/pool.rs:1250 — crates/burn-flex/src/ops/pool.rs:1250-1256 | crates/burn-flex/src/ops/pool.rs:1476-1482 | crates/burn-flex/src/ops/pool.rs:1669-1675 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/burn-flex/src/ops/pool.rs:1257` calls `storage` and `crates/burn-flex/src/ops/pool.rs:1484` 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) crates/burn-flex/src/ops/pool.rs:1318 — crates/burn-flex/src/ops/pool.rs:1318-1324 | crates/burn-flex/src/ops/pool.rs:1342-1348 | crates/burn-flex/src/ops/pool.rs:1366-1372 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/pool.rs:1318` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 3) crates/burn-nn/src/modules/conv/conv2d.rs:77 — crates/burn-nn/src/modules/conv/conv2d.rs:77-83 | crates/burn-nn/src/modules/conv/conv_transpose2d.rs:101-107 | crates/burn-nn/src/modules/conv/conv_transpose3d.rs:101-107 — before extracting anything, compare `crates/burn-nn/src/modules/conv/conv_transpose2d.rs` and `crates/burn-nn/src/modules/conv/conv_transpose3d.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-nn/src/modules/conv/conv2d.rs:77` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 3) crates/burn-flex/src/ops/conv_common.rs:69 — crates/burn-flex/src/ops/conv_common.rs:69-75 | crates/burn-flex/src/ops/interpolate.rs:1222-1228 | crates/burn-flex/src/ops/pool.rs:1779-1785 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/conv_common.rs:69` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 3) crates/burn-flex/src/ops/conv_common.rs:79 — crates/burn-flex/src/ops/conv_common.rs:79-85 | crates/burn-flex/src/ops/interpolate.rs:1233-1239 | crates/burn-flex/src/ops/pool.rs:1789-1795 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/conv_common.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.
  • Duplicated block (7 lines × 3) crates/burn-flex/src/ops/bool.rs:402 — crates/burn-flex/src/ops/bool.rs:402-408 | crates/burn-flex/src/ops/float.rs:1225-1231 | crates/burn-flex/src/ops/int.rs:1360-1366 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `tensor` to `BoolTensor<Flex>` in one and `FloatTensor<Flex>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (7 lines × 3) crates/burn-cubecl/src/kernel/pool/base.rs:119 — crates/burn-cubecl/src/kernel/pool/base.rs:119-125 | crates/burn-cubecl/src/kernel/pool/base.rs:258-264 | crates/burn-cubecl/src/kernel/pool/base.rs:369-375 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/pool/base.rs:119` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D2 · Cognitive Complexity · burn_vision · ×9
  • burn_vision::backends::cpu::connected_components::spaghetti::process (cognitive 77) crates/burn-vision/src/backends/cpu/connected_components/spaghetti/mod.rs:32 — burn_vision::backends::cpu::connected_components::spaghetti::process has cognitive complexity 77 (threshold 15). Drivers by points: if/else 32 (70 pts), loops 4 (7 pts) (nesting depth added 41). 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.
  • burn_vision::backends::cube::connected_components::prefix_sum::prefix_sum_kernel (cognitive 68) crates/burn-vision/src/backends/cube/connected_components/prefix_sum.rs:18 — burn_vision::backends::cube::connected_components::prefix_sum::prefix_sum_kernel has cognitive complexity 68 (threshold 15). Drivers by points: if/else 24 (46 pts), loops 10 (21 pts), boolean chains 1 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • burn_vision::backends::cube::connected_components::hardware_accelerated::strip_merge (cognitive 56) crates/burn-vision/src/backends/cube/connected_components/hardware_accelerated.rs:199 — burn_vision::backends::cube::connected_components::hardware_accelerated::strip_merge has cognitive complexity 56 (threshold 15). Drivers by points: if/else 24 (48 pts), boolean chains 7, match/switch 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • burn_vision::backends::cube::connected_components::hardware_accelerated::strip_labeling (cognitive 41) crates/burn-vision/src/backends/cube/connected_components/hardware_accelerated.rs:85 — burn_vision::backends::cube::connected_components::hardware_accelerated::strip_labeling has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (30 pts), boolean chains 8, match/switch 1 (2 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.
  • burn_vision::backends::cube::connected_components::hardware_accelerated::hardware_accelerated (cognitive 36) crates/burn-vision/src/backends/cube/connected_components/hardware_accelerated.rs:477 — burn_vision::backends::cube::connected_components::hardware_accelerated::hardware_accelerated has cognitive complexity 36 (threshold 15). Drivers by points: if/else 29 (30 pts), boolean chains 6 (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.
  • burn_vision::utils::save::save_tensor_as_image (cognitive 30) crates/burn-vision/src/utils/save.rs:65 — burn_vision::utils::save::save_tensor_as_image has cognitive complexity 30 (threshold 15). Drivers by points: loops 4 (10 pts), match/switch 3 (10 pts), if/else 5 (8 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.
  • burn_vision::backends::cpu::median::base::select_windows (cognitive 21) crates/burn-vision/src/backends/cpu/median/base.rs:169 — burn_vision::backends::cpu::median::base::select_windows has cognitive complexity 21 (threshold 15). Drivers by points: loops 4 (11 pts), if/else 4 (9 pts), boolean chains 1 (nesting depth added 12). 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.
  • burn_vision::backends::cpu::morphology::filter_engine::border_interpolate (cognitive 19) crates/burn-vision/src/backends/cpu/morphology/filter_engine.rs:379 — burn_vision::backends::cpu::morphology::filter_engine::border_interpolate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, loops 1 (2 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.
  • burn_vision::backends::cpu::morphology::create_structuring_element::create_kernel (cognitive 18) crates/burn-vision/src/backends/cpu/morphology/mod.rs:243 — burn_vision::backends::cpu::morphology::create_structuring_element::create_kernel has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D3 · God Classes · TooManyMethods · ×9
  • TooManyMethods: Tensor crates/burn-tensor/src/tensor/api/base.rs:76 — TooManyMethods — 293 methods, declared across 15 files: api/base.rs (95), api/float.rs (57), api/orderable.rs (44), api/numeric.rs (34), +11 more file(s). The bar is 30 methods; this is 263 over it, 9.77× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: TensorData crates/burn-std/src/data/tensor/base.rs:126 — TooManyMethods — 61 methods, declared across 4 files: tensor/base.rs (29), tensor/conversion.rs (23), data/compare.rs (5), tensor/view.rs (4). The bar is 30 methods; this is 31 over it, 2.03× 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: RemoteService crates/burn-remote/src/client/service.rs:84 — TooManyMethods — 58 methods. The bar is 30 methods; this is 28 over it, 1.93× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: TensorCheck crates/burn-tensor/src/tensor/api/check.rs:36 — TooManyMethods — 58 methods. The bar is 30 methods; this is 28 over it, 1.93× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Device crates/burn-tensor/src/device.rs:112 — TooManyMethods — 47 methods, declared across 5 files: src/device.rs (43), src/remote.rs (1), src/shard.rs (1), api/shard.rs (1), +1 more file(s). The bar is 30 methods; this is 17 over it, 1.57× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: TensorInterpreter crates/burn-router/src/interpreter.rs:62 — TooManyMethods — 45 methods. The bar is 30 methods; this is 15 over it, 1.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SafetensorsStore crates/burn-store/src/safetensors/store.rs:79 — TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: HandleContainer crates/burn-ir/src/handle.rs:14 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: CubeTensor crates/burn-cubecl/src/tensor/base.rs:19 — TooManyMethods — 31 methods, declared across 3 files: tensor/base.rs (23), tensor/quantization.rs (6), tensor/stored.rs (2). The bar is 30 methods; this is 1 over it, 1.03× 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.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×9
  • Edited copy of a member (20 corresponding lines) crates/burn-cubecl/src/kernel/fft/base.rs:12 — crates/burn-cubecl/src/kernel/fft/base.rs:12-31 | crates/burn-signal/src/backends/autodiff.rs:148-167 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) crates/burn-flex/src/ops/binary.rs:40 — crates/burn-flex/src/ops/binary.rs:40-59 | crates/burn-flex/src/ops/comparison.rs:32-51 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) crates/burn-train/src/metric/mae.rs:43 — crates/burn-train/src/metric/mae.rs:43-62 | crates/burn-train/src/metric/mse.rs:43-62 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) crates/burn-dataset/src/nlp/text_folder.rs:290 — crates/burn-dataset/src/nlp/text_folder.rs:290-309 | crates/burn-dataset/src/vision/image_folder.rs:747-766 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) crates/burn-autodiff/src/ops/base.rs:223 — crates/burn-autodiff/src/ops/base.rs:223-244 | crates/burn-autodiff/src/ops/base.rs:254-273 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) crates/burn-remote/src/client/service.rs:580 — crates/burn-remote/src/client/service.rs:580-599 | crates/burn-remote/src/client/service.rs:610-632 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) crates/burn-tensor/src/tensor/module.rs:844 — crates/burn-tensor/src/tensor/module.rs:844-863 | crates/burn-tensor/src/tensor/module.rs:871-890 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) crates/burn-tensor/src/tensor/module.rs:389 — crates/burn-tensor/src/tensor/module.rs:389-408 | crates/burn-tensor/src/tensor/module.rs:413-432 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) crates/burn-no-std-tests/src/burnpack.rs:96 — crates/burn-no-std-tests/src/burnpack.rs:96-118 | crates/burn-no-std-tests/src/safetensors.rs:85-104 — 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 (14 lines × 2) · ×9
  • Duplicated block (14 lines × 2) crates/burn-autodiff/src/ops/module.rs:320 — crates/burn-autodiff/src/ops/module.rs:320-333 | crates/burn-autodiff/src/ops/module.rs:357-370 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/module.rs:320` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) crates/burn-backend/src/backend/ops/modules/conv.rs:643 — crates/burn-backend/src/backend/ops/modules/conv.rs:643-656 | crates/burn-backend/src/backend/ops/modules/conv.rs:901-914 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-backend/src/backend/ops/modules/conv.rs:643` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) crates/burn-cubecl/src/kernel/reduce/tune.rs:334 — crates/burn-cubecl/src/kernel/reduce/tune.rs:334-347 | crates/burn-cubecl/src/kernel/reduce/tune.rs:424-437 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/reduce/tune.rs:334` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) crates/burn-flex/src/ops/attention.rs:387 — crates/burn-flex/src/ops/attention.rs:387-400 | crates/burn-flex/src/ops/attention.rs:897-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 `crates/burn-flex/src/ops/attention.rs:387` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) crates/burn-flex/src/ops/attention.rs:402 — crates/burn-flex/src/ops/attention.rs:402-415 | crates/burn-flex/src/ops/attention.rs:912-925 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/attention.rs:402` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) crates/burn-flex/src/ops/interpolate.rs:320 — crates/burn-flex/src/ops/interpolate.rs:320-333 | crates/burn-flex/src/ops/interpolate.rs:982-995 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/interpolate.rs:320` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) crates/burn-flex/src/ops/pool.rs:1241 — crates/burn-flex/src/ops/pool.rs:1241-1254 | crates/burn-flex/src/ops/pool.rs:1660-1673 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) crates/burn-tensor/src/tensor/module.rs:850 — crates/burn-tensor/src/tensor/module.rs:850-863 | crates/burn-tensor/src/tensor/module.rs:877-890 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-tensor/src/tensor/module.rs:850` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs:95 — crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs:95-108 | crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs:199-212 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs:95` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs:93` calls `first`, `expect`, `clone` and `crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs:197` 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 · Edited copy of a member (17 corresponding lines) · ×8
  • Edited copy of a member (17 corresponding lines) crates/burn-flex/src/ops/reduce.rs:57 — crates/burn-flex/src/ops/reduce.rs:57-73 | crates/burn-flex/src/ops/reduce.rs:348-364 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) crates/burn-dispatch/src/backend.rs:318 — crates/burn-dispatch/src/backend.rs:318-334 | crates/burn-dispatch/src/device.rs:642-662 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) crates/burn-train/src/renderer/tui/metric_numeric.rs:112 — crates/burn-train/src/renderer/tui/metric_numeric.rs:112-130 | crates/burn-train/src/renderer/tui/metric_numeric.rs:133-149 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) crates/burn-flex/src/ops/module.rs:571 — crates/burn-flex/src/ops/module.rs:571-587 | crates/burn-flex/src/ops/module.rs:669-685 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) crates/burn-optim/src/lr_scheduler/cosine.rs:33 — crates/burn-optim/src/lr_scheduler/cosine.rs:33-54 | crates/burn-optim/src/lr_scheduler/linear.rs:27-43 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) crates/burn-std/src/data/tensor/view.rs:174 — crates/burn-std/src/data/tensor/view.rs:174-190 | crates/burn-std/src/data/tensor/view.rs:281-297 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) crates/burn-train/src/metric/store/client.rs:57 — crates/burn-train/src/metric/store/client.rs:57-73 | crates/burn-train/src/metric/store/client.rs:82-98 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) crates/burn-cubecl/src/kernel/reduce/tune.rs:331 — crates/burn-cubecl/src/kernel/reduce/tune.rs:331-347 | crates/burn-cubecl/src/kernel/reduce/tune.rs:421-437 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (35 corresponding lines) · ×8
  • Edited copy of a member (35 corresponding lines) crates/burn-optim/src/parallel/training.rs:320 — crates/burn-optim/src/parallel/training.rs:320-354 | crates/burn-optim/src/parallel/training.rs:447-483 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) crates/burn-flex/src/ops/activation.rs:284 — crates/burn-flex/src/ops/activation.rs:284-329 | crates/burn-flex/src/ops/activation.rs:477-568 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) crates/burn-train/src/learner/rl/paradigm.rs:80 — crates/burn-train/src/learner/rl/paradigm.rs:80-114 | crates/burn-train/src/learner/supervised/paradigm.rs:87-125 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) crates/burn-flex/src/ops/conv.rs:1989 — crates/burn-flex/src/ops/conv.rs:1989-2029 | crates/burn-flex/src/ops/conv_transpose.rs:557-602 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) crates/burn-store/src/burnpack.rs:485 — crates/burn-store/src/burnpack.rs:485-524 | crates/burn-store/src/pytorch/store.rs:437-471 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) crates/burn-flex/src/ops/conv.rs:1989 — crates/burn-flex/src/ops/conv.rs:1989-2027 | crates/burn-flex/src/ops/conv_transpose.rs:557-596 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) crates/burn-flex/src/ops/conv.rs:1989 — crates/burn-flex/src/ops/conv.rs:1989-2028 | crates/burn-flex/src/ops/conv_transpose.rs:557-597 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) crates/burn-tensor/src/tensor/api/check.rs:682 — crates/burn-tensor/src/tensor/api/check.rs:682-719 | crates/burn-tensor/src/tensor/api/check.rs:721-755 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×8
  • Edited copy of a member (7 corresponding lines) crates/burn-shard/src/backend/tensor.rs:291 — crates/burn-shard/src/backend/tensor.rs:291-297 | crates/burn-shard/src/backend/tensor.rs:299-309 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/burn-flex/src/ops/fft.rs:1572 — crates/burn-flex/src/ops/fft.rs:1572-1578 | crates/burn-flex/src/ops/fft.rs:1585-1591 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/burn-nn/src/modules/transformer/encoder.rs:166 — crates/burn-nn/src/modules/transformer/encoder.rs:166-178 | crates/burn-nn/src/modules/transformer/decoder.rs:493-499 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/burn-nn/src/modules/norm/layer.rs:130 — crates/burn-nn/src/modules/norm/layer.rs:130-137 | crates/burn-nn/src/modules/norm/rms.rs:106-112 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/burn-nn/src/modules/norm/layer.rs:76 — crates/burn-nn/src/modules/norm/layer.rs:76-84 | crates/burn-nn/src/modules/norm/rms.rs:67-73 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/burn-nn/src/modules/rope_encoding.rs:125 — crates/burn-nn/src/modules/rope_encoding.rs:125-131 | crates/burn-nn/src/modules/transformer/pwff.rs:73-81 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/burn-nn/src/modules/norm/group.rs:69 — crates/burn-nn/src/modules/norm/group.rs:69-76 | crates/burn-nn/src/modules/norm/instance.rs:52-58 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) crates/burn-cubecl/src/kernel/cast/base.rs:16 — crates/burn-cubecl/src/kernel/cast/base.rs:16-22 | crates/burn-cubecl/src/kernel/cast/bool_cast.rs:21-30 — 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 (15 lines × 2) · ×8
  • Duplicated block (15 lines × 2) crates/burn-autodiff/src/ops/tensor.rs:203 — crates/burn-autodiff/src/ops/tensor.rs:203-217 | crates/burn-autodiff/src/ops/tensor.rs:272-286 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/tensor.rs:203` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/burn-autodiff/src/ops/tensor.rs:545 — crates/burn-autodiff/src/ops/tensor.rs:545-559 | crates/burn-autodiff/src/ops/tensor.rs:638-652 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/tensor.rs:545` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/burn-cubecl-fusion/src/engine/launch/vectorization/base.rs:234 — crates/burn-cubecl-fusion/src/engine/launch/vectorization/base.rs:234-248 | crates/burn-cubecl-fusion/src/engine/launch/vectorization/base.rs:426-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl-fusion/src/engine/launch/vectorization/base.rs:234` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:373 — crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:373-387 | crates/burn-cubecl/src/kernel/pool/max_pool3d.rs:341-355 — before extracting anything, compare `crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs` and `crates/burn-cubecl/src/kernel/pool/max_pool3d.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) crates/burn-flex/src/ops/bool.rs:80 — crates/burn-flex/src/ops/bool.rs:80-94 | crates/burn-flex/src/ops/float.rs:138-152 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/bool.rs:80` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/burn-store/src/burnpack.rs:115 — crates/burn-store/src/burnpack.rs:115-129 | crates/burn-store/src/burnpack.rs:154-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 `crates/burn-store/src/burnpack.rs:115` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/burn-tensor/src/tensor/api/check.rs:1482 — crates/burn-tensor/src/tensor/api/check.rs:1482-1496 | crates/burn-tensor/src/tensor/api/check.rs:1510-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-tensor/src/tensor/api/check.rs:1482` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/burn-vision/src/backends/cube/connected_components/hardware_accelerated.rs:316 — crates/burn-vision/src/backends/cube/connected_components/hardware_accelerated.rs:316-330 | crates/burn-vision/src/backends/cube/connected_components/hardware_accelerated.rs:369-383 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/burn-vision/src/backends/cube/connected_components/hardware_accelerated.rs:384` calls `end_distance` and `crates/burn-vision/src/backends/cube/connected_components/hardware_accelerated.rs:331` 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 (11 lines × 3) · ×8
  • Duplicated block (11 lines × 3) crates/burn-flex/src/ops/mask.rs:443 — crates/burn-flex/src/ops/mask.rs:443-453 | crates/burn-flex/src/ops/mask.rs:483-493 | crates/burn-flex/src/ops/mask.rs:533-543 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/mask.rs:443` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those 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) crates/burn-flex/src/ops/matmul.rs:336 — crates/burn-flex/src/ops/matmul.rs:336-346 | crates/burn-flex/src/ops/matmul.rs:673-683 | crates/burn-flex/src/ops/matmul.rs:827-837 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/burn-flex/src/ops/matmul.rs:688` calls `iter`, `product` and `crates/burn-flex/src/ops/matmul.rs:843` 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 × 3) crates/burn-nn/src/modules/conv/conv_transpose1d.rs:110 — crates/burn-nn/src/modules/conv/conv_transpose1d.rs:110-120 | crates/burn-nn/src/modules/conv/conv_transpose2d.rs:111-121 | crates/burn-nn/src/modules/conv/conv_transpose3d.rs:112-122 — before extracting anything, compare `crates/burn-nn/src/modules/conv/conv_transpose1d.rs` and `crates/burn-nn/src/modules/conv/conv_transpose2d.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 3) crates/burn-nn/src/modules/conv/conv_transpose1d.rs:150 — crates/burn-nn/src/modules/conv/conv_transpose1d.rs:150-160 | crates/burn-nn/src/modules/conv/conv_transpose2d.rs:151-161 | crates/burn-nn/src/modules/conv/conv_transpose3d.rs:152-162 — before extracting anything, compare `crates/burn-nn/src/modules/conv/conv_transpose1d.rs` and `crates/burn-nn/src/modules/conv/conv_transpose2d.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `input` to `&Tensor<3>` in one and `&Tensor<4>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (11 lines × 3) crates/burn-router/src/interpreter.rs:1985 — crates/burn-router/src/interpreter.rs:1985-1995 | crates/burn-router/src/interpreter.rs:2030-2040 | crates/burn-router/src/interpreter.rs:2075-2085 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-router/src/interpreter.rs:1985` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) crates/burn-signal/src/functions/blackman_window.rs:59 — crates/burn-signal/src/functions/blackman_window.rs:59-69 | crates/burn-signal/src/functions/hamming_window.rs:38-48 | crates/burn-signal/src/functions/hann_window.rs:38-48 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 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 (11 lines × 3) crates/burn-cubecl-fusion/src/engine/trace/block.rs:190 — crates/burn-cubecl-fusion/src/engine/trace/block.rs:190-200 | crates/burn-cubecl-fusion/src/engine/trace/block.rs:308-318 | crates/burn-cubecl-fusion/src/engine/trace/block.rs:389-399 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (11 lines × 3) crates/burn-backend/src/backend/ops/bool_tensor.rs:325 — crates/burn-backend/src/backend/ops/bool_tensor.rs:325-335 | crates/burn-backend/src/backend/ops/int_tensor.rs:251-261 | crates/burn-backend/src/backend/ops/tensor.rs:168-178 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `tensor` to `BoolTensor<B>` in one and `IntTensor<B>` 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 (24 corresponding lines) · ×7
  • Edited copy of a member (24 corresponding lines) crates/burn-flex/src/ops/sort.rs:139 — crates/burn-flex/src/ops/sort.rs:139-162 | crates/burn-flex/src/ops/sort.rs:472-506 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) crates/burn-backend/src/backend/ops/modules/attention.rs:531 — crates/burn-backend/src/backend/ops/modules/attention.rs:531-554 | crates/burn-backend/src/backend/ops/modules/attention.rs:562-591 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) crates/burn-train/src/metric/vision/fid/inception.rs:52 — crates/burn-train/src/metric/vision/fid/inception.rs:52-77 | crates/burn-train/src/metric/vision/fid/inception.rs:238-261 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) crates/burn-derive/src/config/analyzer_enum.rs:35 — crates/burn-derive/src/config/analyzer_enum.rs:35-59 | crates/burn-derive/src/config/analyzer_enum.rs:61-84 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) crates/burn-remote/src/client/service.rs:854 — crates/burn-remote/src/client/service.rs:854-881 | crates/burn-remote/src/client/service.rs:1032-1055 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) crates/burn-no-std-tests/src/burnpack.rs:69 — crates/burn-no-std-tests/src/burnpack.rs:69-93 | crates/burn-no-std-tests/src/safetensors.rs:59-82 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) crates/burn-no-std-tests/src/burnpack.rs:39 — crates/burn-no-std-tests/src/burnpack.rs:39-66 | crates/burn-no-std-tests/src/burnpack.rs:125-148 — 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 (28 corresponding lines) · ×7
  • Edited copy of a member (28 corresponding lines) crates/burn-flex/src/ops/fft.rs:693 — crates/burn-flex/src/ops/fft.rs:693-725 | crates/burn-flex/src/ops/fft.rs:1275-1302 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) crates/burn-flex/src/simd/kernels.rs:209 — crates/burn-flex/src/simd/kernels.rs:209-236 | crates/burn-flex/src/simd/kernels.rs:239-266 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) crates/burn-cubecl/src/ops/base.rs:151 — crates/burn-cubecl/src/ops/base.rs:151-179 | crates/burn-cubecl/src/ops/base.rs:182-209 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) crates/burn-remote/src/client/runner.rs:585 — crates/burn-remote/src/client/runner.rs:585-612 | crates/burn-remote/src/client/runner.rs:619-652 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) crates/burn-train/src/metric/processor/async_wrapper.rs:90 — crates/burn-train/src/metric/processor/async_wrapper.rs:90-119 | crates/burn-train/src/metric/processor/async_wrapper.rs:126-153 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) crates/burn-cubecl/src/kernel/conv/base.rs:108 — crates/burn-cubecl/src/kernel/conv/base.rs:108-135 | crates/burn-cubecl/src/kernel/conv/base.rs:150-177 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (28 corresponding lines) crates/burn-flex/src/ops/reduce.rs:1074 — crates/burn-flex/src/ops/reduce.rs:1074-1110 | crates/burn-flex/src/ops/reduce.rs:1122-1149 — 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 · Duplicated block (19 lines × 2) · ×7
  • Duplicated block (19 lines × 2) crates/burn-backend/src/backend/ops/modules/conv.rs:87 — crates/burn-backend/src/backend/ops/modules/conv.rs:87-105 | crates/burn-backend/src/backend/ops/modules/conv.rs:130-148 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-backend/src/backend/ops/modules/conv.rs:87` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:627 — crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:627-645 | crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:687-705 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:627` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) crates/burn-cubecl-fusion/src/engine/launch/output.rs:807 — crates/burn-cubecl-fusion/src/engine/launch/output.rs:807-825 | crates/burn-cubecl-fusion/src/engine/launch/output.rs:884-902 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl-fusion/src/engine/launch/output.rs:807` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/burn-cubecl-fusion/src/engine/launch/output.rs:882` calls `swap` and `crates/burn-cubecl-fusion/src/engine/launch/output.rs:806` 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 (19 lines × 2) crates/burn-cubecl/src/kernel/index/slice.rs:147 — crates/burn-cubecl/src/kernel/index/slice.rs:147-165 | crates/burn-cubecl/src/kernel/index/slice_assign.rs:62-80 — before extracting anything, compare `crates/burn-cubecl/src/kernel/index/slice.rs` and `crates/burn-cubecl/src/kernel/index/slice_assign.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/index/slice.rs:147` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) crates/burn-derive/src/config/analyzer_struct.rs:291 — crates/burn-derive/src/config/analyzer_struct.rs:291-309 | crates/burn-derive/src/config/analyzer_struct.rs:316-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 `crates/burn-derive/src/config/analyzer_struct.rs:291` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) crates/burn-flex/src/ops/conv.rs:1283 — crates/burn-flex/src/ops/conv.rs:1283-1301 | crates/burn-flex/src/ops/conv.rs:1345-1363 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/conv.rs:1283` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) crates/burn-flex/src/ops/gather_scatter.rs:1105 — crates/burn-flex/src/ops/gather_scatter.rs:1105-1123 | crates/burn-flex/src/ops/gather_scatter.rs:1151-1169 — both copies are in the same file, so extract the 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 · burn_vision · ×6
  • burn_vision::backends::cube::connected_components::prefix_sum::prefix_sum_kernel (cyclomatic 32) crates/burn-vision/src/backends/cube/connected_components/prefix_sum.rs:18 — burn_vision::backends::cube::connected_components::prefix_sum::prefix_sum_kernel 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.
  • burn_vision::backends::cube::connected_components::hardware_accelerated::hardware_accelerated (cyclomatic 28) crates/burn-vision/src/backends/cube/connected_components/hardware_accelerated.rs:477 — burn_vision::backends::cube::connected_components::hardware_accelerated::hardware_accelerated 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.
  • burn_vision::backends::cube::connected_components::hardware_accelerated::strip_merge (cyclomatic 25) crates/burn-vision/src/backends/cube/connected_components/hardware_accelerated.rs:199 — burn_vision::backends::cube::connected_components::hardware_accelerated::strip_merge 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.
  • burn_vision::backends::cpu::connected_components::spaghetti::process (cyclomatic 23) crates/burn-vision/src/backends/cpu/connected_components/spaghetti/mod.rs:32 — burn_vision::backends::cpu::connected_components::spaghetti::process 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.
  • burn_vision::backends::cube::connected_components::hardware_accelerated::strip_labeling (cyclomatic 22) crates/burn-vision/src/backends/cube/connected_components/hardware_accelerated.rs:85 — burn_vision::backends::cube::connected_components::hardware_accelerated::strip_labeling 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.
  • burn_vision::utils::save::save_tensor_as_image (cyclomatic 19) crates/burn-vision/src/utils/save.rs:65 — burn_vision::utils::save::save_tensor_as_image 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.
D4 · Code Duplication · Edited copy of a member (37 corresponding lines) · ×6
  • Edited copy of a member (37 corresponding lines) crates/burn-flex/src/ops/fft.rs:436 — crates/burn-flex/src/ops/fft.rs:436-492 | crates/burn-flex/src/ops/fft.rs:511-547 — 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) crates/burn-train/src/metric/vision/dists/vgg16_l2pool.rs:129 — crates/burn-train/src/metric/vision/dists/vgg16_l2pool.rs:129-168 | crates/burn-train/src/metric/vision/lpips/vgg.rs:75-111 — 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) crates/burn-dataset/src/vision/mnist.rs:185 — crates/burn-dataset/src/vision/mnist.rs:185-232 | crates/burn-dataset/src/vision/mnist.rs:235-271 — 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) crates/burn-derive/src/module/codegen_enum.rs:34 — crates/burn-derive/src/module/codegen_enum.rs:34-70 | crates/burn-derive/src/module/codegen_enum.rs:123-165 — 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) crates/burn-backend/src/backend/ops/modules/conv.rs:463 — crates/burn-backend/src/backend/ops/modules/conv.rs:463-499 | crates/burn-backend/src/backend/ops/modules/conv.rs:562-612 — 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) crates/burn-cubecl/src/kernel/index/gather.rs:42 — crates/burn-cubecl/src/kernel/index/gather.rs:42-81 | crates/burn-cubecl/src/kernel/index/select.rs:45-81 — 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 (5 corresponding lines) · ×6
  • Edited copy of a member (5 corresponding lines) crates/burn-ir/src/operation.rs:3776 — crates/burn-ir/src/operation.rs:3776-3792 | crates/burn-ir/src/operation.rs:5396-5506 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) crates/burn-ir/src/operation.rs:3794 — crates/burn-ir/src/operation.rs:3794-3810 | crates/burn-ir/src/operation.rs:5402-5506 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) crates/burn-backend/src/backend/ops/int_tensor.rs:593 — crates/burn-backend/src/backend/ops/int_tensor.rs:593-597 | crates/burn-backend/src/backend/ops/tensor.rs:214-218 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) crates/burn-backend/src/backend/ops/int_tensor.rs:609 — crates/burn-backend/src/backend/ops/int_tensor.rs:609-613 | crates/burn-backend/src/backend/ops/tensor.rs:230-234 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) crates/burn-cubecl/src/kernel/attention/backward.rs:32 — crates/burn-cubecl/src/kernel/attention/backward.rs:32-36 | crates/burn-cubecl/src/kernel/attention/tile.rs:100-106 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) crates/burn-cubecl/src/ops/base.rs:138 — crates/burn-cubecl/src/ops/base.rs:138-149 | crates/burn-cubecl/src/ops/numeric.rs:169-173 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×6
  • Edited copy of a member (21 corresponding lines) crates/burn-train/src/metric/vision/lpips/metric.rs:299 — crates/burn-train/src/metric/vision/lpips/metric.rs:299-319 | crates/burn-train/src/metric/vision/lpips/metric.rs:349-371 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) crates/burn-train/src/metric/vision/fid/inception.rs:79 — crates/burn-train/src/metric/vision/fid/inception.rs:79-99 | crates/burn-train/src/metric/vision/fid/inception.rs:201-224 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) crates/burn-flex/src/ops/matmul.rs:83 — crates/burn-flex/src/ops/matmul.rs:83-106 | crates/burn-flex/src/ops/matmul.rs:498-518 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) crates/burn-tensor/src/tensor/api/check.rs:1476 — crates/burn-tensor/src/tensor/api/check.rs:1476-1496 | crates/burn-tensor/src/tensor/api/check.rs:1504-1524 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) crates/burn-cubecl/src/kernel/clamp.rs:22 — crates/burn-cubecl/src/kernel/clamp.rs:22-42 | crates/burn-cubecl/src/kernel/clamp.rs:49-71 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) crates/burn-nn/src/modules/pixel_shuffle.rs:57 — crates/burn-nn/src/modules/pixel_shuffle.rs:57-77 | crates/burn-nn/src/modules/pixel_shuffle.rs:130-160 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×6
  • Edited copy of a member (16 corresponding lines) crates/burn-linalg/src/functions/lu.rs:377 — crates/burn-linalg/src/functions/lu.rs:377-393 | crates/burn-linalg/src/functions/lu.rs:396-411 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/burn-flex/src/ops/bool.rs:322 — crates/burn-flex/src/ops/bool.rs:322-342 | crates/burn-flex/src/ops/comparison.rs:335-350 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/burn-vision/src/backends/cpu/median/network.rs:9 — crates/burn-vision/src/backends/cpu/median/network.rs:9-26 | crates/burn-vision/src/backends/cpu/median/network.rs:34-49 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/burn-flex/src/ops/qtensor.rs:268 — crates/burn-flex/src/ops/qtensor.rs:268-283 | crates/burn-flex/src/ops/qtensor.rs:328-343 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/burn-core/src/store/mod.rs:202 — crates/burn-core/src/store/mod.rs:202-217 | crates/burn-optim/src/optim/module/record/mod.rs:97-117 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) crates/burn-nn/src/modules/transformer/decoder.rs:117 — crates/burn-nn/src/modules/transformer/decoder.rs:117-132 | crates/burn-nn/src/modules/transformer/encoder.rs:145-160 — 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 (18 corresponding lines) · ×6
  • Edited copy of a member (18 corresponding lines) crates/burn-flex/src/simd/portable.rs:141 — crates/burn-flex/src/simd/portable.rs:141-158 | crates/burn-flex/src/simd/portable.rs:179-199 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) crates/burn-flex/src/ops/activation.rs:370 — crates/burn-flex/src/ops/activation.rs:370-387 | crates/burn-flex/src/ops/activation.rs:523-565 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) crates/burn-cubecl-fusion/src/base.rs:121 — crates/burn-cubecl-fusion/src/base.rs:121-145 | crates/burn-cubecl/src/kernel/contiguous.rs:16-33 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) crates/burn-nn/src/modules/norm/group.rs:81 — crates/burn-nn/src/modules/norm/group.rs:81-105 | crates/burn-nn/src/modules/norm/instance.rs:63-80 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) crates/burn-cubecl/src/kernel/conv/im2col.rs:390 — crates/burn-cubecl/src/kernel/conv/im2col.rs:390-409 | crates/burn-cubecl/src/kernel/conv/im2col.rs:423-440 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) crates/burn-cubecl-fusion/src/engine/codegen/io.rs:849 — crates/burn-cubecl-fusion/src/engine/codegen/io.rs:849-866 | crates/burn-cubecl-fusion/src/engine/codegen/io.rs:875-892 — 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 (13–14 lines × 2) · ×6
  • Duplicated block (13–14 lines × 2) crates/burn-autodiff/src/ops/module.rs:443 — crates/burn-autodiff/src/ops/module.rs:443-456 | crates/burn-autodiff/src/ops/module.rs:484-496 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/module.rs:443` it does not close everything it opens, so those 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) crates/burn-autodiff/src/ops/module.rs:1031 — crates/burn-autodiff/src/ops/module.rs:1031-1044 | crates/burn-autodiff/src/ops/module.rs:1072-1084 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/module.rs:1031` it does not close everything it opens, so those 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) crates/burn-autodiff/src/ops/module.rs:1294 — crates/burn-autodiff/src/ops/module.rs:1294-1307 | crates/burn-autodiff/src/ops/module.rs:1335-1347 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/module.rs:1294` it does not close everything it opens, so those 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) crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:668 — crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:668-680 | crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:795-808 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:795` it begins part-way through the construct above it, so those exact lines 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) crates/burn-nn/src/modules/transformer/decoder.rs:467 — crates/burn-nn/src/modules/transformer/decoder.rs:467-479 | crates/burn-nn/src/modules/transformer/encoder.rs:403-416 — before extracting anything, compare `crates/burn-nn/src/modules/transformer/decoder.rs` and `crates/burn-nn/src/modules/transformer/encoder.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-nn/src/modules/transformer/decoder.rs:467` it begins part-way through the construct above it, so those exact lines 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) crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs:142 — crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs:142-154 | crates/burn-train/src/learner/supervised/strategies/single/epoch.rs:171-184 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs:142` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×6
  • Duplicated block (12 lines × 3) crates/burn-autodiff/src/ops/tensor.rs:205 — crates/burn-autodiff/src/ops/tensor.rs:205-216 | crates/burn-autodiff/src/ops/tensor.rs:274-285 | crates/burn-autodiff/src/ops/tensor.rs:1913-1924 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/tensor.rs:205` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) crates/burn-backend/src/backend/ops/modules/conv.rs:990 — crates/burn-backend/src/backend/ops/modules/conv.rs:990-1001 | crates/burn-backend/src/backend/ops/modules/conv.rs:1017-1028 | crates/burn-backend/src/backend/ops/modules/conv.rs:1045-1056 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-backend/src/backend/ops/modules/conv.rs:990` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/burn-backend/src/backend/ops/modules/conv.rs:1029` calls `from` and `crates/burn-backend/src/backend/ops/modules/conv.rs:1002` 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 × 3) crates/burn-flex/src/ops/attention.rs:584 — crates/burn-flex/src/ops/attention.rs:584-595 | crates/burn-flex/src/ops/attention.rs:955-966 | crates/burn-flex/src/ops/attention.rs:1036-1047 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/attention.rs:584` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 3) crates/burn-flex/src/ops/interpolate.rs:476 — crates/burn-flex/src/ops/interpolate.rs:476-487 | crates/burn-flex/src/ops/interpolate.rs:679-690 | crates/burn-flex/src/ops/interpolate.rs:875-886 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/interpolate.rs:476` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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) crates/burn-tensor/src/tensor/module.rs:595 — crates/burn-tensor/src/tensor/module.rs:595-606 | crates/burn-tensor/src/tensor/module.rs:639-650 | crates/burn-tensor/src/tensor/module.rs:1038-1049 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-tensor/src/tensor/module.rs:595` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those 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 `options` to `MaxPoolOptions<1>` in one and `MaxPoolOptions<2>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (12 lines × 3) crates/burn-cubecl/src/kernel/conv/backward_data/implicit_gemm/launch.rs:67 — crates/burn-cubecl/src/kernel/conv/backward_data/implicit_gemm/launch.rs:67-78 | crates/burn-cubecl/src/kernel/conv/backward_weight/implicit_gemm/launch.rs:67-78 | crates/burn-cubecl/src/kernel/conv/forward/implicit_gemm/launch.rs:79-90 — before extracting anything, compare `crates/burn-cubecl/src/kernel/conv/backward_data/implicit_gemm/launch.rs` and `crates/burn-cubecl/src/kernel/conv/backward_weight/implicit_gemm/launch.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/conv/backward_data/implicit_gemm/launch.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.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×6
  • Duplicated block (10 lines × 3) crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs:282 — crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs:282-291 | crates/burn-cubecl/src/kernel/conv/backward_weight/tune.rs:291-300 | crates/burn-cubecl/src/kernel/conv/forward/tune.rs:297-306 — `crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs` and `crates/burn-cubecl/src/kernel/conv/backward_weight/tune.rs` are one unit implemented 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 39 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 × 3) crates/burn-flex/src/ops/pool.rs:264 — crates/burn-flex/src/ops/pool.rs:264-273 | crates/burn-flex/src/ops/pool.rs:696-705 | crates/burn-flex/src/ops/pool.rs:1006-1015 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (10 lines × 3) crates/burn-flex/src/ops/reduce.rs:1238 — crates/burn-flex/src/ops/reduce.rs:1238-1247 | crates/burn-flex/src/ops/reduce.rs:1320-1329 | crates/burn-flex/src/ops/reduce.rs:1389-1398 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/reduce.rs:1238` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/burn-flex/src/ops/reduce.rs:1249` calls `is_contiguous` and `crates/burn-flex/src/ops/reduce.rs:1331` 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 (10 lines × 3) crates/burn-cubecl/src/kernel/unary_float.rs:33 — crates/burn-cubecl/src/kernel/unary_float.rs:33-42 | crates/burn-cubecl/src/kernel/unary_int.rs:32-41 | crates/burn-cubecl/src/kernel/unary_numeric.rs:33-42 — before extracting anything, compare `crates/burn-cubecl/src/kernel/unary_float.rs` and `crates/burn-cubecl/src/kernel/unary_int.rs` as WHOLE FILES: this scan already matched 5 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 `crates/burn-cubecl/src/kernel/unary_float.rs:33` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) crates/burn-cubecl/src/kernel/pool/base.rs:58 — crates/burn-cubecl/src/kernel/pool/base.rs:58-67 | crates/burn-cubecl/src/kernel/pool/base.rs:214-225 | crates/burn-cubecl/src/kernel/pool/base.rs:339-348 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/pool/base.rs:214` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) crates/burn-no-std-tests/src/burnpack.rs:45 — crates/burn-no-std-tests/src/burnpack.rs:45-55 | crates/burn-no-std-tests/src/burnpack.rs:104-113 | crates/burn-no-std-tests/src/burnpack.rs:130-139 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×6
  • Duplicated block (5 lines × 3) crates/burn-flex/src/ops/int.rs:1047 — crates/burn-flex/src/ops/int.rs:1047-1051 | crates/burn-flex/src/ops/int.rs:1062-1066 | crates/burn-flex/src/ops/int.rs:1153-1157 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (5 lines × 3) crates/burn-flex/src/ops/int.rs:1046 — crates/burn-flex/src/ops/int.rs:1046-1050 | crates/burn-flex/src/ops/int.rs:1137-1141 | crates/burn-flex/src/ops/int.rs:1152-1156 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (5 lines × 3) crates/burn-fusion/src/stream/context.rs:269 — crates/burn-fusion/src/stream/context.rs:269-273 | crates/burn-fusion/src/stream/context.rs:302-306 | crates/burn-fusion/src/stream/context.rs:335-339 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-fusion/src/stream/context.rs:269` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 3) crates/burn-train/src/metric/processor/minimal.rs:125 — crates/burn-train/src/metric/processor/minimal.rs:125-129 | crates/burn-train/src/metric/processor/rl_processor.rs:209-213 | crates/burn-train/src/metric/processor/rl_processor.rs:225-229 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (5 lines × 3) crates/burn-backend-extension/src/lib.rs:63 — crates/burn-backend-extension/src/lib.rs:63-67 | crates/burn-backend-extension/src/lib.rs:289-293 | crates/burn-instrument-macros/src/lib.rs:54-58 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (5 lines × 3) crates/burn-flex/src/ops/fft.rs:878 — crates/burn-flex/src/ops/fft.rs:878-882 | crates/burn-flex/src/ops/fft.rs:1077-1081 | crates/burn-flex/src/ops/fft.rs:1457-1461 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/fft.rs:878` it begins part-way through the construct above it, so those 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 · burn_backend_extension · ×5
  • burn_backend_extension::dispatch::expand (cognitive 38) crates/burn-backend-extension/src/dispatch.rs:17 — burn_backend_extension::dispatch::expand has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (34 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.
  • burn_backend_extension::extension::lower_extension (cognitive 36) crates/burn-backend-extension/src/extension.rs:143 — burn_backend_extension::extension::lower_extension has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (23 pts), match/switch 3 (7 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • burn_backend_extension::extension::extract_future_output_type (cognitive 23) crates/burn-backend-extension/src/extension.rs:121 — burn_backend_extension::extension::extract_future_output_type has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 2 (7 pts), boolean chains 2 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • burn_backend_extension::fusion::derive_adapter (cognitive 23) crates/burn-backend-extension/src/fusion.rs:290 — burn_backend_extension::fusion::derive_adapter has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 4 (6 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.
  • burn_backend_extension::routing::extract_selected_input (cognitive 18) crates/burn-backend-extension/src/routing.rs:555 — burn_backend_extension::routing::extract_selected_input has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (15 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.
D2 · Cognitive Complexity · OutputPlanner · ×5
  • OutputPlanner::inplace_output (cognitive 30) crates/burn-cubecl-fusion/src/engine/launch/output.rs:575 — OutputPlanner::inplace_output has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 3 (9 pts), match/switch 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • OutputPlanner::run (cognitive 23) crates/burn-cubecl-fusion/src/engine/launch/output.rs:99 — OutputPlanner::run has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 5 (9 pts), match/switch 2 (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.
  • OutputPlanner::normal_output (cognitive 19) crates/burn-cubecl-fusion/src/engine/launch/output.rs:669 — OutputPlanner::normal_output has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (5 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.
  • OutputPlanner::preferred_dim_order (cognitive 18) crates/burn-cubecl-fusion/src/engine/launch/output.rs:421 — OutputPlanner::preferred_dim_order has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 4 (8 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.
  • OutputPlanner::select_reference_from_inputs (cognitive 17) crates/burn-cubecl-fusion/src/engine/launch/output.rs:242 — OutputPlanner::select_reference_from_inputs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 2 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D35 · Change Coupling · Change-coupling hub · ×5
  • Change-coupling hub: backend.rs → backend.rs, backend.rs, runner.rs, task.rs crates/burn-router/src/backend.rs — `crates/burn-router/src/backend.rs` changes together with 4 other files — `crates/burn-cubecl/src/backend.rs`, `crates/burn-dispatch/src/backend.rs`, `crates/burn-remote/src/client/runner.rs`, `crates/burn-remote/src/shared/task.rs` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 4.
  • Change-coupling hub: module.rs → module.rs, module.rs, module.rs, context.rs, builder.rs, operation.rs, module.rs crates/burn-dispatch/src/ops/module.rs — `crates/burn-dispatch/src/ops/module.rs` changes together with 7 other files — `crates/burn-autodiff/src/ops/module.rs`, `crates/burn-cubecl/src/ops/module.rs`, `crates/burn-fusion/src/ops/module.rs`, `crates/burn-fusion/src/stream/context.rs`, `crates/burn-ir/src/builder.rs`, `crates/burn-ir/src/operation.rs`, `crates/burn-router/src/ops/module.rs` — none of which declares a dependency on it: one file is the hub of 7 separate couplings, not 7 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 7.
  • Change-coupling hub: interpreter.rs → module.rs, tensor.rs, module.rs, context.rs, runner.rs, service.rs, task.rs, backend.rs, module.rs, int.rs crates/burn-router/src/interpreter.rs — `crates/burn-router/src/interpreter.rs` changes together with 10 other files — `crates/burn-dispatch/src/ops/module.rs`, `crates/burn-dispatch/src/ops/tensor.rs`, `crates/burn-fusion/src/ops/module.rs`, `crates/burn-fusion/src/stream/context.rs`, `crates/burn-remote/src/client/runner.rs`, `crates/burn-remote/src/client/service.rs`, `crates/burn-remote/src/shared/task.rs`, `crates/burn-router/src/backend.rs`, `crates/burn-router/src/ops/module.rs`, `crates/burn-tensor/src/bridge/ops/int.rs` — none of which declares a dependency on it: one file is the hub of 10 separate couplings, not 10 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 10.
  • Change-coupling hub: worker.rs → backend.rs, backend.rs, backend.rs, backend.rs, runner.rs, service.rs, backend.rs, base.rs crates/burn-remote/src/server/worker.rs — `crates/burn-remote/src/server/worker.rs` changes together with 8 other files — `crates/burn-autodiff/src/backend.rs`, `crates/burn-cubecl/src/backend.rs`, `crates/burn-dispatch/src/backend.rs`, `crates/burn-fusion/src/backend.rs`, `crates/burn-remote/src/client/runner.rs`, `crates/burn-remote/src/client/service.rs`, `crates/burn-router/src/backend.rs`, `crates/burn-router/src/client/base.rs` — none of which declares a dependency on it: one file is the hub of 8 separate couplings, not 8 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 8.
  • Change-coupling hub: int.rs → tensor.rs, tensor.rs, operation.rs, tensor.rs crates/burn-tensor/src/bridge/ops/int.rs — `crates/burn-tensor/src/bridge/ops/int.rs` changes together with 4 other files — `crates/burn-backend/src/backend/ops/tensor.rs`, `crates/burn-fusion/src/ops/tensor.rs`, `crates/burn-ir/src/operation.rs`, `crates/burn-router/src/ops/tensor.rs` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 4.
D4 · Code Duplication · Edited copy of a member (25 corresponding lines) · ×5
  • Edited copy of a member (25 corresponding lines) crates/burn-nn/src/modules/transformer/decoder.rs:262 — crates/burn-nn/src/modules/transformer/decoder.rs:262-300 | crates/burn-nn/src/modules/transformer/encoder.rs:274-301 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) crates/burn-flex/src/ops/comparison.rs:518 — crates/burn-flex/src/ops/comparison.rs:518-544 | crates/burn-flex/src/ops/comparison.rs:557-581 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) crates/burn-autodiff/src/ops/tensor.rs:823 — crates/burn-autodiff/src/ops/tensor.rs:823-847 | crates/burn-autodiff/src/ops/tensor.rs:4545-4572 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) crates/burn-derive/src/config/analyzer_struct.rs:96 — crates/burn-derive/src/config/analyzer_struct.rs:96-121 | crates/burn-derive/src/config/analyzer_struct.rs:128-152 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) crates/burn-tensor/src/tensor/api/check.rs:519 — crates/burn-tensor/src/tensor/api/check.rs:519-543 | crates/burn-tensor/src/tensor/api/check.rs:545-571 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×5
  • Edited copy of a member (22 corresponding lines) crates/burn-store/src/adapter.rs:615 — crates/burn-store/src/adapter.rs:615-648 | crates/pytorch-reader/src/pickle_reader.rs:950-978 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) crates/burn-flex/src/simd/portable.rs:1618 — crates/burn-flex/src/simd/portable.rs:1618-1704 | crates/burn-flex/src/simd/portable.rs:1667-1704 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) crates/burn-router/src/interpreter.rs:131 — crates/burn-router/src/interpreter.rs:131-152 | crates/burn-router/src/interpreter.rs:220-243 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) crates/burn-derive/src/module/codegen_struct.rs:32 — crates/burn-derive/src/module/codegen_struct.rs:32-53 | crates/burn-derive/src/module/codegen_struct.rs:115-137 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) crates/burn-cubecl/src/kernel/contiguous.rs:47 — crates/burn-cubecl/src/kernel/contiguous.rs:47-68 | crates/burn-cubecl/src/kernel/contiguous.rs:76-104 — 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 (27 corresponding lines) · ×5
  • Edited copy of a member (27 corresponding lines) crates/burn-flex/src/ops/sort.rs:170 — crates/burn-flex/src/ops/sort.rs:170-196 | crates/burn-flex/src/ops/sort.rs:513-546 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) crates/burn-backend/src/backend/ops/cat.rs:17 — crates/burn-backend/src/backend/ops/cat.rs:17-45 | crates/burn-backend/src/backend/ops/repeat_dim.rs:18-44 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) crates/burn-train/src/metric/processor/metrics.rs:284 — crates/burn-train/src/metric/processor/metrics.rs:284-310 | crates/burn-train/src/metric/processor/metrics.rs:316-344 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) crates/burn-cubecl/src/kernel/conv/conv_transpose2d/tune.rs:70 — crates/burn-cubecl/src/kernel/conv/conv_transpose2d/tune.rs:70-96 | crates/burn-cubecl/src/kernel/conv/conv_transpose3d/tune.rs:60-87 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) crates/burn-backend/src/backend/ops/modules/conv.rs:257 — crates/burn-backend/src/backend/ops/modules/conv.rs:257-283 | crates/burn-flex/src/ops/pool.rs:155-181 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (33 corresponding lines) · ×5
  • Edited copy of a member (33 corresponding lines) crates/burn-flex/src/zip.rs:476 — crates/burn-flex/src/zip.rs:476-510 | crates/burn-flex/src/zip.rs:525-557 — 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) crates/burn-flex/src/ops/reduce.rs:428 — crates/burn-flex/src/ops/reduce.rs:428-462 | crates/burn-flex/src/ops/reduce.rs:465-497 — 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) crates/burn-tensor/src/tensor/module.rs:574 — crates/burn-tensor/src/tensor/module.rs:574-606 | crates/burn-tensor/src/tensor/module.rs:615-650 — 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) crates/burn-autodiff/src/ops/tensor.rs:2515 — crates/burn-autodiff/src/ops/tensor.rs:2515-2547 | crates/burn-autodiff/src/ops/tensor.rs:4772-4804 — 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) crates/burn-backend/src/backend/ops/modules/conv.rs:86 — crates/burn-backend/src/backend/ops/modules/conv.rs:86-118 | crates/burn-backend/src/backend/ops/modules/conv.rs:129-162 — 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 (14 corresponding lines) · ×5
  • Edited copy of a member (14 corresponding lines) crates/burn-flex/src/ops/comparison.rs:767 — crates/burn-flex/src/ops/comparison.rs:767-780 | crates/burn-flex/src/ops/comparison.rs:788-801 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/burn-flex/src/ops/activation.rs:907 — crates/burn-flex/src/ops/activation.rs:907-921 | crates/burn-flex/src/ops/activation.rs:931-944 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/burn-train/src/metric/vision/fid/inception.rs:130 — crates/burn-train/src/metric/vision/fid/inception.rs:130-143 | crates/burn-train/src/metric/vision/fid/inception.rs:263-278 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/burn-cubecl/src/ops/numeric.rs:305 — crates/burn-cubecl/src/ops/numeric.rs:305-318 | crates/burn-cubecl/src/ops/numeric.rs:321-334 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) crates/burn-cubecl-fusion/src/optim/matmul/optimization.rs:111 — crates/burn-cubecl-fusion/src/optim/matmul/optimization.rs:111-124 | crates/burn-cubecl-fusion/src/optim/reduce/optimization.rs:247-263 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 10+ corresponding lines) · ×5
  • Edited copies of one member (3 members, 10+ corresponding lines) crates/burn-flex/src/ops/module.rs:52 — crates/burn-flex/src/ops/module.rs:52-61 | crates/burn-flex/src/ops/module.rs:68-77 | crates/burn-flex/src/ops/module.rs:254-263 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) crates/burn-flex/src/simd/portable.rs:1133 — crates/burn-flex/src/simd/portable.rs:1133-1143 | crates/burn-flex/src/simd/portable.rs:1153-1163 | crates/burn-flex/src/simd/portable.rs:1174-1183 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) crates/burn-std/src/config/logger.rs:143 — crates/burn-std/src/config/logger.rs:143-152 | crates/burn-std/src/config/logger.rs:160-169 | crates/burn-std/src/config/logger.rs:177-186 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) crates/burn-tensor/src/tensor/api/base.rs:1788 — crates/burn-tensor/src/tensor/api/base.rs:1788-1803 | crates/burn-tensor/src/tensor/api/base.rs:1931-1940 | crates/burn-tensor/src/tensor/api/base.rs:2009-2025 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) crates/burn-train/src/checkpoint/async_checkpoint.rs:148 — crates/burn-train/src/checkpoint/async_checkpoint.rs:148-159 | crates/burn-train/src/logger/async_logger.rs:81-90 | crates/burn-train/src/metric/store/client.rs:161-170 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×5
  • Duplicated block (17 lines × 2) crates/burn-cubecl/src/kernel/index/slice.rs:206 — crates/burn-cubecl/src/kernel/index/slice.rs:206-222 | crates/burn-cubecl/src/kernel/index/slice_assign.rs:204-220 — before extracting anything, compare `crates/burn-cubecl/src/kernel/index/slice.rs` and `crates/burn-cubecl/src/kernel/index/slice_assign.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `slices` to `&[Slice]` in one and `&[burn_backend::Slice]` 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) crates/burn-flex/src/ops/interpolate.rs:637 — crates/burn-flex/src/ops/interpolate.rs:637-653 | crates/burn-flex/src/ops/interpolate.rs:853-869 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/interpolate.rs:637` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) crates/burn-flex/src/ops/pool.rs:267 — crates/burn-flex/src/ops/pool.rs:267-283 | crates/burn-flex/src/ops/pool.rs:699-715 — both copies are in the same file, so extract the block into 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) crates/burn-flex/src/ops/reduce.rs:1300 — crates/burn-flex/src/ops/reduce.rs:1300-1316 | crates/burn-flex/src/ops/reduce.rs:1369-1385 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/reduce.rs:1300` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 2) crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs:69 — crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs:69-85 | crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs:174-190 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×5
  • Duplicated block (10–11 lines × 2) crates/burn-backend/src/backend/ops/modules/ctc.rs:380 — crates/burn-backend/src/backend/ops/modules/ctc.rs:380-389 | crates/burn-backend/src/backend/ops/modules/ctc.rs:397-407 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10–11 lines × 2) crates/burn-cubecl-fusion/src/optim/reduce/optimization.rs:475 — crates/burn-cubecl-fusion/src/optim/reduce/optimization.rs:475-485 | crates/burn-cubecl-fusion/src/optim/reduce_broadcasted/fuser/full.rs:86-95 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl-fusion/src/optim/reduce/optimization.rs:475` it begins part-way through the construct above it, so those 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) crates/burn-flex/src/ops/conv.rs:258 — crates/burn-flex/src/ops/conv.rs:258-267 | crates/burn-flex/src/ops/conv_transpose.rs:267-277 — before extracting anything, compare `crates/burn-flex/src/ops/conv.rs` and `crates/burn-flex/src/ops/conv_transpose.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `options` to `&ConvOptions<2>` in one and `&ConvTransposeOptions<2>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (10–11 lines × 2) crates/burn-flex/src/ops/gather_scatter.rs:572 — crates/burn-flex/src/ops/gather_scatter.rs:572-581 | crates/burn-flex/src/ops/gather_scatter.rs:1125-1135 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/gather_scatter.rs:572` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10–11 lines × 2) crates/burn-linalg/src/check.rs:54 — crates/burn-linalg/src/check.rs:54-63 | crates/burn-linalg/src/check.rs:79-89 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-linalg/src/check.rs:54` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×5
  • Duplicated block (5 lines × 4) crates/burn-autodiff/src/ops/tensor.rs:377 — crates/burn-autodiff/src/ops/tensor.rs:377-381 | crates/burn-autodiff/src/ops/tensor.rs:478-482 | crates/burn-autodiff/src/ops/tensor.rs:576-580 | crates/burn-autodiff/src/ops/tensor.rs:668-673 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/tensor.rs:377` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 4) crates/burn-backend/src/backend/ops/modules/grid_sample.rs:148 — crates/burn-backend/src/backend/ops/modules/grid_sample.rs:148-152 | crates/burn-backend/src/backend/ops/modules/grid_sample.rs:153-157 | crates/burn-backend/src/backend/ops/modules/grid_sample.rs:158-162 | crates/burn-backend/src/backend/ops/modules/grid_sample.rs:163-167 — 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) crates/burn-cubecl/src/kernel/binary.rs:303 — crates/burn-cubecl/src/kernel/binary.rs:303-308 | crates/burn-cubecl/src/kernel/comparison.rs:249-253 | crates/burn-cubecl/src/kernel/unary_float.rs:51-56 | crates/burn-cubecl/src/kernel/unary_numeric.rs:51-55 — before extracting anything, compare `crates/burn-cubecl/src/kernel/unary_float.rs` and `crates/burn-cubecl/src/kernel/unary_numeric.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 73 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/binary.rs:303` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 4) crates/burn-flex/src/ops/int.rs:1105 — crates/burn-flex/src/ops/int.rs:1105-1109 | crates/burn-flex/src/ops/int.rs:1120-1124 | crates/burn-flex/src/ops/int.rs:1135-1139 | crates/burn-flex/src/ops/int.rs:1150-1154 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/int.rs:1105` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 4) crates/burn-train/src/metric/processor/minimal.rs:65 — crates/burn-train/src/metric/processor/minimal.rs:65-69 | crates/burn-train/src/metric/processor/rl_processor.rs:131-135 | crates/burn-train/src/metric/processor/rl_processor.rs:147-151 | crates/burn-train/src/metric/processor/rl_processor.rs:165-169 — 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.
D5 · Coupling · Off the main sequence · ×5
  • Off the main sequence: burn-einsum — burn-einsum: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
  • Off the main sequence: pytorch-reader — pytorch-reader: abstractness 0.09, instability 0.00, distance 0.91 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: burn-ir — burn-ir: abstractness 0.02, instability 0.15, distance 0.82 — zone of pain — concrete and depended on by 11 project(s), so it's rigid to change.
  • Off the main sequence: burn-std — burn-std: abstractness 0.21, instability 0.00, distance 0.79 — zone of pain — concrete and depended on by 21 project(s), so it's rigid to change.
  • Off the main sequence: burn-backend — burn-backend: abstractness 0.23, instability 0.05, distance 0.71 — zone of pain — concrete and depended on by 18 project(s), so it's rigid to change.
D36 · Supply-chain Provenance & Signing · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (41 corresponding lines) · ×4
  • Edited copy of a member (41 corresponding lines) crates/burn-ir/src/operation.rs:3408 — crates/burn-ir/src/operation.rs:3408-3454 | crates/burn-ir/src/operation.rs:3455-3495 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (41 corresponding lines) crates/burn-autodiff/src/ops/tensor.rs:196 — crates/burn-autodiff/src/ops/tensor.rs:196-236 | crates/burn-autodiff/src/ops/tensor.rs:265-305 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (41 corresponding lines) crates/burn-autodiff/src/ops/tensor.rs:1113 — crates/burn-autodiff/src/ops/tensor.rs:1113-1153 | crates/burn-autodiff/src/ops/tensor.rs:1768-1810 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (41 corresponding lines) crates/burn-flex/src/ops/module.rs:597 — crates/burn-flex/src/ops/module.rs:597-637 | crates/burn-flex/src/ops/module.rs:695-735 — 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 copies of one member (3 members, 13+ corresponding lines) · ×4
  • Edited copies of one member (3 members, 13+ corresponding lines) crates/burn-flex/src/ops/int.rs:143 — crates/burn-flex/src/ops/int.rs:143-160 | crates/burn-flex/src/ops/int.rs:199-211 | crates/burn-flex/src/ops/int.rs:431-443 — 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) crates/burn-flex/src/tensor.rs:166 — crates/burn-flex/src/tensor.rs:166-178 | crates/burn-flex/src/tensor.rs:190-204 | crates/burn-flex/src/tensor.rs:212-230 — 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) crates/burn-ir/src/builder.rs:559 — crates/burn-ir/src/builder.rs:559-571 | crates/burn-ir/src/builder.rs:1523-1535 | crates/burn-ir/src/builder.rs:1545-1560 — 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) crates/burn-core/src/module/param/base.rs:529 — crates/burn-core/src/module/param/base.rs:529-541 | crates/burn-core/src/module/param/base.rs:581-593 | crates/burn-core/src/module/param/base.rs:637-649 — 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 copy of a member (23 corresponding lines) · ×4
  • Edited copy of a member (23 corresponding lines) crates/burn-cubecl/src/kernel/conv/unit.rs:102 — crates/burn-cubecl/src/kernel/conv/unit.rs:102-124 | crates/burn-cubecl/src/kernel/conv/unit.rs:132-154 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) crates/burn-tensor/src/tensor/api/check.rs:142 — crates/burn-tensor/src/tensor/api/check.rs:142-172 | crates/burn-tensor/src/tensor/api/check.rs:256-278 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) crates/burn-dataset/src/transform/partial.rs:19 — crates/burn-dataset/src/transform/partial.rs:19-42 | crates/burn-dataset/src/transform/selection.rs:199-221 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) crates/burn-ir/src/operation.rs:2205 — crates/burn-ir/src/operation.rs:2205-2227 | crates/burn-ir/src/operation.rs:2259-2281 — 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) · ×4
  • Edited copies of one member (3 members, 8+ corresponding lines) crates/burn-flex/src/ops/int.rs:1187 — crates/burn-flex/src/ops/int.rs:1187-1196 | crates/burn-flex/src/ops/int.rs:1198-1205 | crates/burn-flex/src/ops/int.rs:1207-1214 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 8+ corresponding lines) crates/burn-flex/src/ops/unary.rs:405 — crates/burn-flex/src/ops/unary.rs:405-412 | crates/burn-flex/src/ops/unary.rs:415-422 | crates/burn-flex/src/ops/unary.rs:425-432 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 8+ corresponding lines) crates/burn-flex/src/ops/int.rs:750 — crates/burn-flex/src/ops/int.rs:750-757 | crates/burn-flex/src/ops/int.rs:766-774 | crates/burn-flex/src/ops/int.rs:1311-1318 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 8+ corresponding lines) crates/burn-nn/src/modules/pool/avg_pool1d.rs:71 — crates/burn-nn/src/modules/pool/avg_pool1d.rs:71-79 | crates/burn-nn/src/modules/pool/lp_pool1d.rs:49-56 | crates/burn-nn/src/modules/pool/max_pool1d.rs:63-71 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×4
  • Edited copy of a member (4 corresponding lines) crates/burn-flex/src/ops/conv_common.rs:55 — crates/burn-flex/src/ops/conv_common.rs:55-60 | crates/burn-flex/src/ops/pool.rs:1749-1752 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) crates/burn-flex/src/ops/conv_common.rs:50 — crates/burn-flex/src/ops/conv_common.rs:50-53 | crates/burn-flex/src/ops/pool.rs:1755-1758 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) crates/burn-tensor/src/tensor/api/base.rs:1848 — crates/burn-tensor/src/tensor/api/base.rs:1848-1851 | crates/burn-tensor/src/tensor/api/orderable.rs:1066-1069 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) crates/burn-tensor/src/tensor/api/base.rs:2591 — crates/burn-tensor/src/tensor/api/base.rs:2591-2594 | crates/burn-tensor/src/tensor/api/orderable.rs:536-539 — 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 (14–15 lines × 2) · ×4
  • Duplicated block (14–15 lines × 2) crates/burn-autodiff/src/ops/module.rs:578 — crates/burn-autodiff/src/ops/module.rs:578-592 | crates/burn-autodiff/src/ops/module.rs:616-629 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/module.rs:578` it does not close everything it opens, so those 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) crates/burn-autodiff/src/ops/module.rs:1168 — crates/burn-autodiff/src/ops/module.rs:1168-1182 | crates/burn-autodiff/src/ops/module.rs:1206-1219 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/module.rs:1168` it does not close everything it opens, so those 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) crates/burn-backend/src/backend/ops/modules/conv.rs:258 — crates/burn-backend/src/backend/ops/modules/conv.rs:258-272 | crates/burn-flex/src/ops/pool.rs:158-171 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-backend/src/backend/ops/modules/conv.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.
  • Duplicated block (14–15 lines × 2) crates/burn-flex/src/ops/gather_scatter.rs:321 — crates/burn-flex/src/ops/gather_scatter.rs:321-334 | crates/burn-flex/src/ops/gather_scatter.rs:338-352 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/gather_scatter.rs:321` it begins part-way through the construct above it, so those exact lines cannot be lifted 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) · ×4
  • Duplicated block (14 lines × 3) crates/burn-cubecl/src/kernel/binary.rs:265 — crates/burn-cubecl/src/kernel/binary.rs:265-278 | crates/burn-cubecl/src/kernel/binary_float.rs:185-198 | crates/burn-cubecl/src/kernel/binary_int.rs:214-227 — before extracting anything, compare `crates/burn-cubecl/src/kernel/binary.rs` and `crates/burn-cubecl/src/kernel/binary_float.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 105 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/binary.rs:265` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 3) crates/burn-cubecl/src/kernel/index/slice.rs:72 — crates/burn-cubecl/src/kernel/index/slice.rs:72-85 | crates/burn-cubecl/src/kernel/index/slice.rs:143-156 | crates/burn-cubecl/src/kernel/index/slice_assign.rs:58-71 — before extracting anything, compare `crates/burn-cubecl/src/kernel/index/slice.rs` and `crates/burn-cubecl/src/kernel/index/slice_assign.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/index/slice.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.
  • Duplicated block (14 lines × 3) crates/burn-flex/src/ops/pool.rs:1287 — crates/burn-flex/src/ops/pool.rs:1287-1300 | crates/burn-flex/src/ops/pool.rs:1579-1592 | crates/burn-flex/src/ops/pool.rs:1729-1742 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/pool.rs:1287` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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) crates/burn-flex/src/ops/reduce.rs:1298 — crates/burn-flex/src/ops/reduce.rs:1298-1311 | crates/burn-flex/src/ops/reduce.rs:1367-1380 | crates/burn-flex/src/ops/reduce.rs:1521-1534 — all 3 copies are in the same file, so extract the block into one function there and call 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, `crates/burn-flex/src/ops/reduce.rs:1296` calls `Fn` and `crates/burn-flex/src/ops/reduce.rs:1519` 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) · ×4
  • Duplicated block (9–10 lines × 2) crates/burn-flex/src/ops/conv.rs:374 — crates/burn-flex/src/ops/conv.rs:374-383 | crates/burn-flex/src/ops/pool.rs:1019-1027 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/conv.rs:374` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9–10 lines × 2) crates/burn-flex/src/ops/gather_scatter.rs:300 — crates/burn-flex/src/ops/gather_scatter.rs:300-308 | crates/burn-flex/src/ops/gather_scatter.rs:310-319 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/gather_scatter.rs:310` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9–10 lines × 2) crates/burn-nn/src/modules/conv/conv3d.rs:155 — crates/burn-nn/src/modules/conv/conv3d.rs:155-163 | crates/burn-nn/src/modules/pool/max_pool3d.rs:93-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.
  • Duplicated block (9–10 lines × 2) crates/burn-train/src/renderer/tui/metric_numeric.rs:114 — crates/burn-train/src/renderer/tui/metric_numeric.rs:114-123 | crates/burn-train/src/renderer/tui/metric_numeric.rs:135-143 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-train/src/renderer/tui/metric_numeric.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. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `crate) fn update_progress_valid(&mut` in one and `crate) fn update_progress_test(&mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×4
  • Duplicated block (9 lines × 4) crates/burn-autodiff/src/ops/tensor.rs:464 — crates/burn-autodiff/src/ops/tensor.rs:464-472 | crates/burn-autodiff/src/ops/tensor.rs:562-570 | crates/burn-autodiff/src/ops/tensor.rs:743-751 | crates/burn-autodiff/src/ops/tensor.rs:4009-4017 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/tensor.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 (9 lines × 4) crates/burn-autodiff/src/ops/tensor.rs:1118 — crates/burn-autodiff/src/ops/tensor.rs:1118-1126 | crates/burn-autodiff/src/ops/tensor.rs:1218-1226 | crates/burn-autodiff/src/ops/tensor.rs:1836-1844 | crates/burn-autodiff/src/ops/tensor.rs:1990-1998 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/tensor.rs:1118` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 4) crates/burn-backend/src/backend/ops/modules/conv.rs:1026 — crates/burn-backend/src/backend/ops/modules/conv.rs:1026-1034 | crates/burn-backend/src/backend/ops/modules/conv.rs:1055-1063 | crates/burn-backend/src/backend/ops/modules/conv.rs:1308-1316 | crates/burn-backend/src/backend/ops/modules/conv.rs:1338-1346 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-backend/src/backend/ops/modules/conv.rs:1026` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/burn-backend/src/backend/ops/modules/conv.rs:1054` calls `from` and `crates/burn-backend/src/backend/ops/modules/conv.rs:1025` 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) crates/burn-flex/src/ops/mask.rs:432 — crates/burn-flex/src/ops/mask.rs:432-440 | crates/burn-flex/src/ops/mask.rs:472-480 | crates/burn-flex/src/ops/mask.rs:522-530 | crates/burn-flex/src/ops/mask.rs:564-572 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/mask.rs:432` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D6 · Cohesion (LCOM4) · Low cohesion · ×4
  • Low cohesion: Tensor (LCOM4 10) crates/burn-pack/src/tensor.rs:119 — Tensor'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: Tensor (LCOM4 8) crates/burn-tensor/src/tensor/api/base.rs:76 — Tensor'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: DisplaySettings (LCOM4 7) crates/burn-core/src/module/display.rs:153 — DisplaySettings'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: HostSpec (LCOM4 7) crates/burn-remote/src/client/host.rs:20 — HostSpec'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.
D1 · Cyclomatic Complexity · ModuleOperationIr · ×3
  • ModuleOperationIr::visit_mut (cyclomatic 84) crates/burn-ir/src/operation.rs:4717 — ModuleOperationIr::visit_mut has cyclomatic complexity 84 (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.
  • ModuleOperationIr::mark_read_only (cyclomatic 77) crates/burn-ir/src/operation.rs:4386 — ModuleOperationIr::mark_read_only has cyclomatic complexity 77 (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.
  • ModuleOperationIr::inputs (cyclomatic 74) crates/burn-ir/src/operation.rs:4020 — ModuleOperationIr::inputs has cyclomatic complexity 74 (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 · burn_cubecl_fusion · ×3
  • burn_cubecl_fusion::engine::codegen::io::read (cyclomatic 25) crates/burn-cubecl-fusion/src/engine/codegen/io.rs:40 — burn_cubecl_fusion::engine::codegen::io::read 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.
  • burn_cubecl_fusion::engine::launch::vectorization::base::vectorization_swapped (cyclomatic 21) crates/burn-cubecl-fusion/src/engine/launch/vectorization/base.rs:384 — burn_cubecl_fusion::engine::launch::vectorization::base::vectorization_swapped 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.
  • burn_cubecl_fusion::engine::codegen::kernel::init_locals (cyclomatic 17) crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:109 — burn_cubecl_fusion::engine::codegen::kernel::init_locals has cyclomatic complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This is NOT this file's highest cyclomatic complexity: burn_cubecl_fusion::engine::codegen::kernel::fuse (cyclomatic 37) 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 · ModuleOperationIr · ×3
  • ModuleOperationIr::visit_mut (cognitive 46) crates/burn-ir/src/operation.rs:4717 — ModuleOperationIr::visit_mut has cognitive complexity 46 (threshold 15). Drivers by points: if/else 24 (45 pts), match/switch 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ModuleOperationIr::mark_read_only (cognitive 28) crates/burn-ir/src/operation.rs:4386 — ModuleOperationIr::mark_read_only has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (25 pts), match/switch 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • ModuleOperationIr::inputs (cognitive 27) crates/burn-ir/src/operation.rs:4020 — ModuleOperationIr::inputs has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (21 pts), match/switch 4 (6 pts) (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · burn_backend · ×3
  • burn_backend::backend::ops::pad::pad (cognitive 35) crates/burn-backend/src/backend/ops/pad.rs:57 — burn_backend::backend::ops::pad::pad has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (29 pts), loops 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 20). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • burn_backend::backend::ops::sort::sort_slice (cognitive 24) crates/burn-backend/src/backend/ops/sort.rs:309 — burn_backend::backend::ops::sort::sort_slice has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 4 (9 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.
  • burn_backend::backend::ops::sort::sort_data_with_indices (cognitive 16) crates/burn-backend/src/backend/ops/sort.rs:177 — burn_backend::backend::ops::sort::sort_data_with_indices has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (6 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.
D3 · God Classes · TooManyFunctions · ×3
  • TooManyFunctions: burn_tensor::tensor::activation::base crates/burn-tensor/src/tensor/activation/base.rs:14 — TooManyFunctions — 41 free functions. The bar is 30 free functions; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyFunctions: burn_cubecl::ops::numeric crates/burn-cubecl/src/ops/numeric.rs:26 — TooManyFunctions — 37 free functions. The bar is 30 free functions; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyFunctions: burn_flex::ops::unary crates/burn-flex/src/ops/unary.rs:18 — TooManyFunctions — 31 free functions. The bar is 30 free functions; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×3
  • Members sharing a duplicated core (6 members, 50+ identical tokens) crates/burn-backend/src/backend/ops/modules/conv.rs:986 — crates/burn-backend/src/backend/ops/modules/conv.rs:986-1006 | crates/burn-backend/src/backend/ops/modules/conv.rs:1013-1034 | crates/burn-backend/src/backend/ops/modules/conv.rs:1041-1063 | crates/burn-backend/src/backend/ops/modules/conv.rs:1266-1287 | crates/burn-backend/src/backend/ops/modules/conv.rs:1294-1316 | crates/burn-backend/src/backend/ops/modules/conv.rs:1323-1346 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) crates/burn-backend/src/backend/ops/modules/conv.rs:1070 — crates/burn-backend/src/backend/ops/modules/conv.rs:1070-1114 | crates/burn-backend/src/backend/ops/modules/conv.rs:1121-1178 | crates/burn-backend/src/backend/ops/modules/conv.rs:1185-1259 | crates/burn-backend/src/backend/ops/modules/conv.rs:1353-1408 | crates/burn-backend/src/backend/ops/modules/conv.rs:1415-1472 | crates/burn-backend/src/backend/ops/modules/conv.rs:1479-1552 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) crates/burn-flex/src/ops/reduce.rs:1819 — crates/burn-flex/src/ops/reduce.rs:1819-1863 | crates/burn-flex/src/ops/reduce.rs:1870-1917 | crates/burn-flex/src/ops/reduce.rs:1927-1977 | crates/burn-flex/src/ops/reduce.rs:1985-2017 | crates/burn-flex/src/ops/reduce.rs:2027-2076 | crates/burn-flex/src/ops/reduce.rs:2084-2122 — 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 · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×3
  • Members sharing a duplicated core (5 members, 50+ identical tokens) crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs:30 — crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs:30-203 | crates/burn-cubecl/src/kernel/conv/backward_weight/tune.rs:33-206 | crates/burn-cubecl/src/kernel/conv/conv_transpose2d/tune.rs:16-39 | crates/burn-cubecl/src/kernel/conv/conv_transpose3d/tune.rs:23-46 | crates/burn-cubecl/src/kernel/conv/forward/tune.rs:57-221 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:295 — crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:295-360 | crates/burn-cubecl/src/kernel/pool/base.rs:25-68 | crates/burn-cubecl/src/kernel/pool/base.rs:78-130 | crates/burn-cubecl/src/kernel/pool/base.rs:187-226 | crates/burn-cubecl/src/kernel/pool/max_pool3d.rs:252-327 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) crates/burn-flex/src/ops/comparison.rs:862 — crates/burn-flex/src/ops/comparison.rs:862-889 | crates/burn-flex/src/ops/reduce.rs:2129-2173 | crates/burn-flex/src/ops/reduce.rs:2184-2237 | crates/burn-flex/src/ops/reduce.rs:2250-2294 | crates/burn-flex/src/ops/reduce.rs:2307-2360 — 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 (66 corresponding lines) · ×3
  • Edited copy of a member (66 corresponding lines) crates/burn-autodiff/src/ops/tensor.rs:3020 — crates/burn-autodiff/src/ops/tensor.rs:3020-3085 | crates/burn-autodiff/src/ops/tensor.rs:3087-3152 — These two members are one piece of code written twice and then edited apart: 66 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (66 corresponding lines) crates/burn-flex/src/ops/sort.rs:288 — crates/burn-flex/src/ops/sort.rs:288-355 | crates/burn-flex/src/ops/sort.rs:365-430 — These two members are one piece of code written twice and then edited apart: 66 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (66 corresponding lines) crates/burn-train/src/learner/supervised/strategies/multi/strategy.rs:28 — crates/burn-train/src/learner/supervised/strategies/multi/strategy.rs:28-106 | crates/burn-train/src/learner/supervised/strategies/single/strategy.rs:53-118 — These two members are one piece of code written twice and then edited apart: 66 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 17+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 17+ corresponding lines) crates/burn-flex/src/ops/sort.rs:40 — crates/burn-flex/src/ops/sort.rs:40-56 | crates/burn-flex/src/ops/sort.rs:63-81 | crates/burn-flex/src/ops/sort.rs:84-100 — 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) crates/burn-backend/src/backend/ops/modules/pool.rs:15 — crates/burn-backend/src/backend/ops/modules/pool.rs:15-32 | crates/burn-backend/src/backend/ops/modules/pool.rs:44-63 | crates/burn-backend/src/backend/ops/modules/pool.rs:101-117 — 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) crates/burn-optim/src/optim/adagrad.rs:51 — crates/burn-optim/src/optim/adagrad.rs:51-67 | crates/burn-optim/src/optim/adam.rs:68-85 | crates/burn-optim/src/optim/sgd.rs:74-95 — 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 copy of a member (45 corresponding lines) · ×3
  • Edited copy of a member (45 corresponding lines) crates/burn-nn/src/modules/transformer/encoder.rs:315 — crates/burn-nn/src/modules/transformer/encoder.rs:315-359 | crates/burn-nn/src/modules/transformer/encoder.rs:369-423 — 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) crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:372 — crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:372-416 | crates/burn-cubecl/src/kernel/pool/max_pool3d.rs:339-388 — 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) crates/burn-cubecl/src/kernel/conv/conv_transpose2d/col2im.rs:186 — crates/burn-cubecl/src/kernel/conv/conv_transpose2d/col2im.rs:186-232 | crates/burn-cubecl/src/kernel/conv/conv_transpose3d/col2im.rs:192-236 — 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 (38 corresponding lines) · ×3
  • Edited copy of a member (38 corresponding lines) crates/burn-flex/src/ops/conv.rs:1237 — crates/burn-flex/src/ops/conv.rs:1237-1301 | crates/burn-flex/src/ops/conv.rs:1326-1363 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (38 corresponding lines) crates/burn-tensor/src/tensor/module.rs:444 — crates/burn-tensor/src/tensor/module.rs:444-482 | crates/burn-tensor/src/tensor/module.rs:511-548 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (38 corresponding lines) crates/burn-train/src/learner/rl/env_runner/async_runner.rs:177 — crates/burn-train/src/learner/rl/env_runner/async_runner.rs:177-214 | crates/burn-train/src/learner/rl/env_runner/async_runner.rs:385-423 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×3
  • Edited copy of a member (26 corresponding lines) crates/burn-flex/src/ops/bool.rs:153 — crates/burn-flex/src/ops/bool.rs:153-192 | crates/burn-flex/src/ops/comparison.rs:689-714 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) crates/burn-dispatch/src/backend.rs:743 — crates/burn-dispatch/src/backend.rs:743-768 | crates/burn-dispatch/src/backend.rs:771-796 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) crates/burn-train/src/metric/vision/dists/weights.rs:86 — crates/burn-train/src/metric/vision/dists/weights.rs:86-111 | crates/burn-vision/src/loss/gram_matrix/weights.rs:66-99 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 25+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 25+ corresponding lines) crates/burn-signal/src/functions/blackman_window.rs:58 — crates/burn-signal/src/functions/blackman_window.rs:58-90 | crates/burn-signal/src/functions/hamming_window.rs:37-64 | crates/burn-signal/src/functions/hann_window.rs:37-61 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 25+ corresponding lines) crates/burn-backend/src/backend/ops/modules/conv.rs:922 — crates/burn-backend/src/backend/ops/modules/conv.rs:922-947 | crates/burn-backend/src/backend/ops/modules/conv.rs:955-979 | crates/burn-cubecl/src/kernel/conv/backward_data/fallback.rs:142-170 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 25+ corresponding lines) crates/burn-cubecl/src/kernel/index/flip.rs:21 — crates/burn-cubecl/src/kernel/index/flip.rs:21-46 | crates/burn-cubecl/src/kernel/index/repeat_dim.rs:17-45 | crates/burn-cubecl/src/kernel/index/select.rs:19-43 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 13+ corresponding lines) · ×3
  • Edited copies of one member (4 members, 13+ corresponding lines) crates/burn-flex/src/ops/int.rs:894 — crates/burn-flex/src/ops/int.rs:894-906 | crates/burn-flex/src/ops/int.rs:908-920 | crates/burn-flex/src/ops/int.rs:922-934 | crates/burn-flex/src/ops/int.rs:936-948 — 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) crates/burn-communication/src/websocket/client.rs:64 — crates/burn-communication/src/websocket/client.rs:64-90 | crates/burn-communication/src/websocket/client.rs:154-169 | crates/burn-communication/src/websocket/server.rs:155-177 | crates/burn-communication/src/websocket/server.rs:240-252 — 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) crates/burn-flex/src/ops/float.rs:879 — crates/burn-flex/src/ops/float.rs:879-891 | crates/burn-flex/src/ops/float.rs:893-905 | crates/burn-flex/src/ops/float.rs:907-919 | crates/burn-flex/src/ops/float.rs:921-933 — 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 (4 members, 16+ corresponding lines) · ×3
  • Edited copies of one member (4 members, 16+ corresponding lines) crates/burn-flex/src/ops/conv.rs:121 — crates/burn-flex/src/ops/conv.rs:121-136 | crates/burn-flex/src/ops/conv.rs:172-191 | crates/burn-flex/src/ops/conv_transpose.rs:93-111 | crates/burn-flex/src/ops/conv_transpose.rs:152-174 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 16+ corresponding lines) crates/burn-dataset/src/nlp/text_folder.rs:261 — crates/burn-dataset/src/nlp/text_folder.rs:261-276 | crates/burn-dataset/src/vision/image_folder.rs:626-642 | crates/burn-dataset/src/vision/image_folder.rs:656-672 | crates/burn-dataset/src/vision/image_folder.rs:686-702 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 16+ corresponding lines) crates/burn-backend/src/backend/ops/int_tensor.rs:1406 — crates/burn-backend/src/backend/ops/int_tensor.rs:1406-1421 | crates/burn-backend/src/backend/ops/int_tensor.rs:1440-1457 | crates/burn-backend/src/backend/ops/tensor.rs:1845-1860 | crates/burn-backend/src/backend/ops/tensor.rs:1882-1898 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×3
  • Edited copy of a member (19 corresponding lines) crates/burn-backend-extension/src/ir.rs:110 — crates/burn-backend-extension/src/ir.rs:110-136 | crates/burn-backend-extension/src/ir.rs:138-156 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) crates/burn-flex/src/simd/portable.rs:239 — crates/burn-flex/src/simd/portable.rs:239-257 | crates/burn-flex/src/simd/portable.rs:369-388 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) crates/burn-derive/src/module/codegen_struct.rs:12 — crates/burn-derive/src/module/codegen_struct.rs:12-30 | crates/burn-derive/src/module/codegen_struct.rs:55-75 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 11+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 11+ corresponding lines) crates/burn-backend/src/backend/ops/int_tensor.rs:1014 — crates/burn-backend/src/backend/ops/int_tensor.rs:1014-1024 | crates/burn-backend/src/backend/ops/qtensor.rs:1015-1025 | crates/burn-backend/src/backend/ops/tensor.rs:1559-1569 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 11+ corresponding lines) crates/burn-nn/src/modules/conv/conv_transpose1d.rs:85 — crates/burn-nn/src/modules/conv/conv_transpose1d.rs:85-95 | crates/burn-nn/src/modules/conv/conv_transpose2d.rs:85-95 | crates/burn-nn/src/modules/conv/conv_transpose3d.rs:85-95 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 11+ corresponding lines) crates/burn-backend/src/backend/ops/bool_tensor.rs:353 — crates/burn-backend/src/backend/ops/bool_tensor.rs:353-363 | crates/burn-backend/src/backend/ops/int_tensor.rs:279-289 | crates/burn-backend/src/backend/ops/tensor.rs:1461-1472 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 7+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 7+ corresponding lines) crates/burn-nn/src/modules/conv/conv1d.rs:156 — crates/burn-nn/src/modules/conv/conv1d.rs:156-162 | crates/burn-nn/src/modules/conv/conv2d.rs:168-174 | crates/burn-nn/src/modules/conv/conv3d.rs:173-179 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 7+ corresponding lines) crates/burn-nn/src/activation/rrelu.rs:67 — crates/burn-nn/src/activation/rrelu.rs:67-73 | crates/burn-nn/src/modules/dropout.rs:81-89 | crates/burn-nn/src/modules/noise.rs:78-84 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 7+ corresponding lines) crates/burn-train/src/metric/cer.rs:61 — crates/burn-train/src/metric/cer.rs:61-67 | crates/burn-train/src/metric/rouge.rs:55-61 | crates/burn-train/src/metric/wer.rs:39-45 — 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, 10+ corresponding lines) · ×3
  • Edited copies of one member (4 members, 10+ corresponding lines) crates/burn-dispatch/src/tensor.rs:154 — crates/burn-dispatch/src/tensor.rs:154-163 | crates/burn-dispatch/src/tensor.rs:164-173 | crates/burn-dispatch/src/tensor.rs:175-184 | crates/burn-dispatch/src/tensor.rs:186-195 — 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.
  • Edited copies of one member (4 members, 10+ corresponding lines) crates/burn-train/src/metric/vision/afine/weights.rs:48 — crates/burn-train/src/metric/vision/afine/weights.rs:48-57 | crates/burn-train/src/metric/vision/dists/weights.rs:20-31 | crates/burn-train/src/metric/vision/fid/weights.rs:11-22 | crates/burn-train/src/metric/vision/lpips/weights.rs:45-56 — 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.
  • Edited copies of one member (4 members, 10+ corresponding lines) crates/burn-train/src/metric/auc_pr.rs:34 — crates/burn-train/src/metric/auc_pr.rs:34-43 | crates/burn-train/src/metric/auroc.rs:29-38 | crates/burn-train/src/metric/precision.rs:27-39 | crates/burn-train/src/metric/recall.rs:27-39 — 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 · Duplicated block (21 lines × 2) · ×3
  • Duplicated block (21 lines × 2) crates/burn-autodiff/src/ops/module.rs:738 — crates/burn-autodiff/src/ops/module.rs:738-758 | crates/burn-autodiff/src/ops/module.rs:774-794 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/module.rs:738` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 2) crates/burn-autodiff/src/ops/module.rs:888 — crates/burn-autodiff/src/ops/module.rs:888-908 | crates/burn-autodiff/src/ops/module.rs:925-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 `crates/burn-autodiff/src/ops/module.rs:888` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 2) crates/burn-cubecl/src/kernel/conv/backward_data/implicit_gemm/launch.rs:95 — crates/burn-cubecl/src/kernel/conv/backward_data/implicit_gemm/launch.rs:95-115 | crates/burn-cubecl/src/kernel/conv/backward_weight/implicit_gemm/launch.rs:95-115 — before extracting anything, compare `crates/burn-cubecl/src/kernel/conv/backward_data/implicit_gemm/launch.rs` and `crates/burn-cubecl/src/kernel/conv/backward_weight/implicit_gemm/launch.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/conv/backward_data/implicit_gemm/launch.rs:95` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16–18 lines × 2) · ×3
  • Duplicated block (16–18 lines × 2) crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:532 — crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:532-547 | crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:722-739 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:532` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16–18 lines × 2) crates/burn-train/src/learner/supervised/strategies/ddp/epoch.rs:48 — crates/burn-train/src/learner/supervised/strategies/ddp/epoch.rs:48-65 | crates/burn-train/src/learner/supervised/strategies/single/epoch.rs:46-61 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-train/src/learner/supervised/strategies/ddp/epoch.rs:48` it does not close everything it opens, so those 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) crates/burn-train/src/learner/supervised/strategies/ddp/epoch.rs:122 — crates/burn-train/src/learner/supervised/strategies/ddp/epoch.rs:122-139 | crates/burn-train/src/learner/supervised/strategies/single/epoch.rs:123-138 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-train/src/learner/supervised/strategies/ddp/epoch.rs:122` it does not close everything it opens, so those 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–18 lines × 2) · ×3
  • Duplicated block (17–18 lines × 2) crates/burn-flex/src/ops/cumulative.rs:44 — crates/burn-flex/src/ops/cumulative.rs:44-61 | crates/burn-flex/src/ops/cumulative.rs:109-125 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17–18 lines × 2) crates/burn-flex/src/ops/fft.rs:854 — crates/burn-flex/src/ops/fft.rs:854-871 | crates/burn-flex/src/ops/fft.rs:1050-1066 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/burn-flex/src/ops/fft.rs:1068` calls `re`, `im`, `offsets` and `crates/burn-flex/src/ops/fft.rs:874` 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 (17–18 lines × 2) crates/burn-flex/src/ops/fft.rs:287 — crates/burn-flex/src/ops/fft.rs:287-303 | crates/burn-flex/src/ops/fft.rs:304-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 `crates/burn-flex/src/ops/fft.rs:287` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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 lines × 3) · ×3
  • Duplicated block (13 lines × 3) crates/burn-autodiff/src/ops/module.rs:2088 — crates/burn-autodiff/src/ops/module.rs:2088-2100 | crates/burn-autodiff/src/ops/module.rs:2127-2139 | crates/burn-autodiff/src/ops/module.rs:2173-2185 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/module.rs:2088` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 3) crates/burn-backend/src/backend/ops/modules/conv.rs:1270 — crates/burn-backend/src/backend/ops/modules/conv.rs:1270-1282 | crates/burn-backend/src/backend/ops/modules/conv.rs:1298-1310 | crates/burn-backend/src/backend/ops/modules/conv.rs:1327-1339 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-backend/src/backend/ops/modules/conv.rs:1270` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/burn-backend/src/backend/ops/modules/conv.rs:1311` calls `from` and `crates/burn-backend/src/backend/ops/modules/conv.rs:1283` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 3) crates/burn-nn/src/modules/conv/conv2d.rs:90 — crates/burn-nn/src/modules/conv/conv2d.rs:90-102 | crates/burn-nn/src/modules/conv/conv3d.rs:94-106 | crates/burn-nn/src/modules/conv/deform_conv2d.rs:113-125 — before extracting anything, compare `crates/burn-nn/src/modules/conv/conv2d.rs` and `crates/burn-nn/src/modules/conv/conv3d.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×3
  • Duplicated block (12–13 lines × 2) crates/burn-flex/src/ops/sort.rs:289 — crates/burn-flex/src/ops/sort.rs:289-301 | crates/burn-flex/src/ops/sort.rs:366-377 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/sort.rs:289` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–13 lines × 2) crates/burn-nn/src/modules/transformer/decoder.rs:353 — crates/burn-nn/src/modules/transformer/decoder.rs:353-365 | crates/burn-nn/src/modules/transformer/decoder.rs:438-449 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-nn/src/modules/transformer/decoder.rs:353` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12–13 lines × 2) crates/burn-no-std-tests/src/burnpack.rs:45 — crates/burn-no-std-tests/src/burnpack.rs:45-57 | crates/burn-no-std-tests/src/burnpack.rs:130-141 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×3
  • Duplicated block (8–9 lines × 2) crates/burn-flex/src/ops/conv.rs:174 — crates/burn-flex/src/ops/conv.rs:174-181 | crates/burn-flex/src/ops/conv_transpose.rs:155-163 — before extracting anything, compare `crates/burn-flex/src/ops/conv.rs` and `crates/burn-flex/src/ops/conv_transpose.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–9 lines × 2) crates/burn-flex/src/tensor.rs:621 — crates/burn-flex/src/tensor.rs:621-628 | crates/burn-flex/src/tensor.rs:635-643 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/tensor.rs:635` it begins part-way through the construct above it, so those 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, `crates/burn-flex/src/tensor.rs:628` calls `copy_2d_tiled` and `crates/burn-flex/src/tensor.rs:643` 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) crates/burn-nn/src/modules/rnn/basic.rs:214 — crates/burn-nn/src/modules/rnn/basic.rs:214-222 | crates/burn-nn/src/modules/rnn/gru.rs:227-234 — before extracting anything, compare `crates/burn-nn/src/modules/rnn/basic.rs` and `crates/burn-nn/src/modules/rnn/gru.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-nn/src/modules/rnn/basic.rs:214` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×3
  • Duplicated block (7 lines × 4) crates/burn-autodiff/src/ops/module.rs:239 — crates/burn-autodiff/src/ops/module.rs:239-246 | crates/burn-autodiff/src/ops/module.rs:259-265 | crates/burn-autodiff/src/ops/tensor.rs:755-761 | crates/burn-autodiff/src/ops/tensor.rs:806-812 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/module.rs:239` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 4) crates/burn-flex/src/ops/pool.rs:465 — crates/burn-flex/src/ops/pool.rs:465-471 | crates/burn-flex/src/ops/pool.rs:486-492 | crates/burn-flex/src/ops/pool.rs:507-513 | crates/burn-flex/src/ops/pool.rs:528-534 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/pool.rs:465` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 4) crates/burn-train/src/metric/vision/afine/weights.rs:59 — crates/burn-train/src/metric/vision/afine/weights.rs:59-65 | crates/burn-train/src/metric/vision/dists/weights.rs:34-40 | crates/burn-train/src/metric/vision/fid/weights.rs:24-30 | crates/burn-train/src/metric/vision/lpips/weights.rs:59-65 — 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.
D4 · Code Duplication · Duplicated block (6 lines × 7) · ×3
  • Duplicated block (6 lines × 7) crates/burn-flex/src/ops/pool.rs:464 — crates/burn-flex/src/ops/pool.rs:464-469 | crates/burn-flex/src/ops/pool.rs:485-490 | crates/burn-flex/src/ops/pool.rs:506-511 | crates/burn-flex/src/ops/pool.rs:527-532 | crates/burn-flex/src/ops/pool.rs:1317-1322 | crates/burn-flex/src/ops/pool.rs:1341-1346 | crates/burn-flex/src/ops/pool.rs:1365-1370 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/pool.rs:464` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines 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 × 7) crates/burn-ir/src/operation.rs:4032 — crates/burn-ir/src/operation.rs:4032-4037 | crates/burn-ir/src/operation.rs:4048-4053 | crates/burn-ir/src/operation.rs:4064-4069 | crates/burn-ir/src/operation.rs:4080-4085 | crates/burn-ir/src/operation.rs:4130-4135 | crates/burn-ir/src/operation.rs:4137-4142 | crates/burn-ir/src/operation.rs:4144-4149 — 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. 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 × 7) crates/burn-router/src/interpreter.rs:1594 — crates/burn-router/src/interpreter.rs:1594-1599 | crates/burn-router/src/interpreter.rs:1625-1630 | crates/burn-router/src/interpreter.rs:1666-1671 | crates/burn-router/src/interpreter.rs:1707-1712 | crates/burn-router/src/interpreter.rs:1807-1812 | crates/burn-router/src/interpreter.rs:1818-1823 | crates/burn-router/src/interpreter.rs:1829-1834 — 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.
D1 · Cyclomatic Complexity · Flex · ×2
  • Flex::int_cast (cyclomatic 67) crates/burn-flex/src/ops/int.rs:1016 — Flex::int_cast 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.
  • Flex::float_cast (cyclomatic 16) crates/burn-flex/src/ops/float.rs:935 — Flex::float_cast has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 belong 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. This is NOT this file's highest cyclomatic complexity: Flex::float_scatter (cyclomatic 25) 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 · TraceOperationFuser · ×2
  • TraceOperationFuser::fuse_base (cyclomatic 27) crates/burn-cubecl-fusion/src/engine/fuser.rs:298 — TraceOperationFuser::fuse_base 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.
  • TraceOperationFuser::fuse (cyclomatic 18) crates/burn-cubecl-fusion/src/engine/fuser.rs:80 — TraceOperationFuser::fuse 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: TraceOperationFuser::fuse_numeric (cyclomatic 26) 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 · burn_cubecl · ×2
  • burn_cubecl::kernel::ctc::ctc_alpha_beta_kernel (cyclomatic 26) crates/burn-cubecl/src/kernel/ctc.rs:394 — burn_cubecl::kernel::ctc::ctc_alpha_beta_kernel 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.
  • burn_cubecl::ops::base::q_reshape (cyclomatic 25) crates/burn-cubecl/src/ops/base.rs:346 — burn_cubecl::ops::base::q_reshape 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 · burn_backend_extension · ×2
  • burn_backend_extension::dispatch::expand (cyclomatic 19) crates/burn-backend-extension/src/dispatch.rs:17 — burn_backend_extension::dispatch::expand 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.
  • burn_backend_extension::extension::lower_extension (cyclomatic 19) crates/burn-backend-extension/src/extension.rs:143 — burn_backend_extension::extension::lower_extension 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 · FilterEngine · ×2
  • FilterEngine::start (cyclomatic 18) crates/burn-vision/src/backends/cpu/morphology/filter_engine.rs:139 — FilterEngine::start 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.
  • FilterEngine::proceed (cyclomatic 17) crates/burn-vision/src/backends/cpu/morphology/filter_engine.rs:243 — FilterEngine::proceed 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.
D17 · Explicit Debt · FixmeComment · ×2
  • FixmeComment crates/burn-backend-tests/tests/cubecl/quantization/reshape.rs:61 — // FIXME: should work like tensor-level — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment crates/burn-backend-tests/tests/cubecl/quantization/reshape.rs:74 — // FIXME: should work — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D2 · Cognitive Complexity · FilterEngine · ×2
  • FilterEngine::start (cognitive 47) crates/burn-vision/src/backends/cpu/morphology/filter_engine.rs:139 — FilterEngine::start has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 6 (20 pts), 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.
  • FilterEngine::proceed (cognitive 43) crates/burn-vision/src/backends/cpu/morphology/filter_engine.rs:243 — FilterEngine::proceed has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 5 (13 pts), boolean chains 2, 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 · TraceOperationFuser · ×2
  • TraceOperationFuser::fuse_base (cognitive 29) crates/burn-cubecl-fusion/src/engine/fuser.rs:298 — TraceOperationFuser::fuse_base has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (26 pts), loops 1 (2 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.
  • TraceOperationFuser::fuse (cognitive 18) crates/burn-cubecl-fusion/src/engine/fuser.rs:80 — TraceOperationFuser::fuse has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (17 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 · burn_fusion · ×2
  • burn_fusion::search::merging::merge_blocks_step2 (cognitive 19) crates/burn-fusion/src/search/merging.rs:140 — burn_fusion::search::merging::merge_blocks_step2 has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (11 pts), match/switch 5 (7 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • burn_fusion::search::graph::lifetime::is_valid_execution_order (cognitive 18) crates/burn-fusion/src/search/graph/lifetime.rs:14 — burn_fusion::search::graph::lifetime::is_valid_execution_order has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 5 (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.
D2 · Cognitive Complexity · AgentEnvAsyncLoop · ×2
  • AgentEnvAsyncLoop::new (cognitive 19) crates/burn-train/src/learner/rl/env_runner/async_runner.rs:58 — AgentEnvAsyncLoop::new has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 2 (6 pts), boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • AgentEnvAsyncLoop::run_episodes (cognitive 17) crates/burn-train/src/learner/rl/env_runner/async_runner.rs:216 — AgentEnvAsyncLoop::run_episodes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InputPlanner · ×2
  • InputPlanner::analyze_normal (cognitive 16) crates/burn-cubecl-fusion/src/engine/launch/input.rs:132 — InputPlanner::analyze_normal has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 1 (3 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.
  • InputPlanner::analyze_view (cognitive 16) crates/burn-cubecl-fusion/src/engine/launch/input.rs:193 — InputPlanner::analyze_view has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 3, match/switch 1 (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 · MultiDeviceTrainEpoch · ×2
  • MultiDeviceTrainEpoch::run_optim_main (cognitive 16) crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs:61 — MultiDeviceTrainEpoch::run_optim_main has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 3 (5 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (MultiDeviceTrainEpoch::run_optim_distr) 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.
  • MultiDeviceTrainEpoch::run_optim_distr (cognitive 16) crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs:166 — MultiDeviceTrainEpoch::run_optim_distr has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 3 (5 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (MultiDeviceTrainEpoch::run_optim_main) 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.
D36 · Supply-chain Provenance & Signing · REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (8 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (8 members, 50+ identical tokens) crates/burn-flex/src/ops/interpolate.rs:1023 — crates/burn-flex/src/ops/interpolate.rs:1023-1116 | crates/burn-flex/src/ops/interpolate.rs:1127-1213 | crates/burn-flex/src/ops/matmul.rs:672-754 | crates/burn-flex/src/ops/matmul.rs:774-823 | crates/burn-flex/src/ops/matmul.rs:826-900 | crates/burn-flex/src/ops/pool.rs:1238-1300 | crates/burn-flex/src/ops/pool.rs:1460-1592 | crates/burn-flex/src/ops/pool.rs:1658-1742 — 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) crates/burn-flex/src/simd/kernels.rs:90 — crates/burn-flex/src/simd/kernels.rs:90-115 | crates/burn-flex/src/simd/kernels.rs:128-157 | crates/burn-flex/src/simd/portable.rs:50-87 | crates/burn-flex/src/simd/portable.rs:50-93 | crates/burn-flex/src/simd/portable.rs:50-99 | crates/burn-flex/src/simd/portable.rs:50-105 | crates/burn-flex/src/simd/portable.rs:50-116 | crates/burn-flex/src/simd/portable.rs:50-122 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (7 members, 50+ identical tokens) crates/burn-autodiff/src/ops/module.rs:300 — crates/burn-autodiff/src/ops/module.rs:300-416 | crates/burn-autodiff/src/ops/module.rs:423-551 | crates/burn-autodiff/src/ops/module.rs:558-677 | crates/burn-autodiff/src/ops/module.rs:1011-1141 | crates/burn-autodiff/src/ops/module.rs:1148-1267 | crates/burn-autodiff/src/ops/module.rs:1274-1404 | crates/burn-autodiff/src/ops/tensor.rs:4488-4543 — 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) crates/burn-flex/src/ops/pool.rs:460 — crates/burn-flex/src/ops/pool.rs:460-471 | crates/burn-flex/src/ops/pool.rs:481-492 | crates/burn-flex/src/ops/pool.rs:502-513 | crates/burn-flex/src/ops/pool.rs:523-534 | crates/burn-flex/src/ops/pool.rs:1311-1324 | crates/burn-flex/src/ops/pool.rs:1335-1348 | crates/burn-flex/src/ops/pool.rs:1359-1372 — 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 (60 corresponding lines) · ×2
  • Edited copy of a member (60 corresponding lines) crates/burn-ir/src/operation.rs:2834 — crates/burn-ir/src/operation.rs:2834-2893 | crates/burn-ir/src/operation.rs:2895-2962 — 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.
  • Edited copy of a member (60 corresponding lines) crates/burn-flex/src/zip.rs:123 — crates/burn-flex/src/zip.rs:123-182 | crates/burn-flex/src/zip.rs:385-459 — 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 copy of a member (79 corresponding lines) · ×2
  • Edited copy of a member (79 corresponding lines) crates/burn-flex/src/ops/float.rs:315 — crates/burn-flex/src/ops/float.rs:315-393 | crates/burn-flex/src/ops/float.rs:448-541 — These two members are one piece of code written twice and then edited apart: 79 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (79 corresponding lines) crates/burn-fusion/src/stream/context.rs:959 — crates/burn-fusion/src/stream/context.rs:959-1043 | crates/burn-fusion/src/stream/context.rs:1081-1159 — These two members are one piece of code written twice and then edited apart: 79 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (34 corresponding lines) · ×2
  • Edited copy of a member (34 corresponding lines) crates/burn-ir/src/operation.rs:2498 — crates/burn-ir/src/operation.rs:2498-2539 | crates/burn-ir/src/operation.rs:2541-2574 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (34 corresponding lines) crates/burn-train/src/metric/vision/fid/inception.rs:161 — crates/burn-train/src/metric/vision/fid/inception.rs:161-199 | crates/burn-train/src/metric/vision/fid/inception.rs:297-330 — 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 (31 corresponding lines) · ×2
  • Edited copy of a member (31 corresponding lines) crates/burn-flex/src/ops/reduce.rs:245 — crates/burn-flex/src/ops/reduce.rs:245-275 | crates/burn-flex/src/ops/reduce.rs:391-421 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) crates/burn-cubecl/src/kernel/index/scatter.rs:93 — crates/burn-cubecl/src/kernel/index/scatter.rs:93-123 | crates/burn-cubecl/src/kernel/index/select_assign.rs:76-108 — 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 (51 corresponding lines) · ×2
  • Edited copy of a member (51 corresponding lines) crates/burn-train/src/metric/processor/minimal.rs:38 — crates/burn-train/src/metric/processor/minimal.rs:38-107 | crates/burn-train/src/metric/processor/minimal.rs:109-159 — 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) crates/burn-dataset/src/nlp/text_folder.rs:197 — crates/burn-dataset/src/nlp/text_folder.rs:197-247 | crates/burn-dataset/src/vision/image_folder.rs:558-612 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (64 corresponding lines) · ×2
  • Edited copy of a member (64 corresponding lines) crates/burn-flex/src/ops/activation.rs:712 — crates/burn-flex/src/ops/activation.rs:712-775 | crates/burn-flex/src/ops/activation.rs:829-895 — These two members are one piece of code written twice and then edited apart: 64 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (64 corresponding lines) crates/burn-nn/src/modules/rnn/basic.rs:331 — crates/burn-nn/src/modules/rnn/basic.rs:331-397 | crates/burn-nn/src/modules/rnn/gru.rs:383-446 — These two members are one piece of code written twice and then edited apart: 64 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (43 corresponding lines) · ×2
  • Edited copy of a member (43 corresponding lines) crates/burn-train/src/learner/supervised/strategies/ddp/epoch.rs:38 — crates/burn-train/src/learner/supervised/strategies/ddp/epoch.rs:38-86 | crates/burn-train/src/learner/supervised/strategies/single/epoch.rs:36-78 — 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) crates/burn-cubecl/src/kernel/conv/backward_data/implicit_gemm/launch.rs:93 — crates/burn-cubecl/src/kernel/conv/backward_data/implicit_gemm/launch.rs:93-135 | crates/burn-cubecl/src/kernel/conv/backward_weight/implicit_gemm/launch.rs:93-135 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (54 corresponding lines) · ×2
  • Edited copy of a member (54 corresponding lines) crates/burn-tensor/src/tensor/api/check.rs:1532 — crates/burn-tensor/src/tensor/api/check.rs:1532-1585 | crates/burn-tensor/src/tensor/api/check.rs:1640-1696 — 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) crates/burn-cubecl/src/kernel/mask/mask_fill.rs:55 — crates/burn-cubecl/src/kernel/mask/mask_fill.rs:55-111 | crates/burn-cubecl/src/kernel/mask/mask_where.rs:60-113 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 41+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 41+ corresponding lines) crates/burn-dispatch/src/backend.rs:441 — crates/burn-dispatch/src/backend.rs:441-481 | crates/burn-dispatch/src/backend.rs:483-523 | crates/burn-dispatch/src/backend.rs:568-609 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 41 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or 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, 41+ corresponding lines) crates/burn-autodiff/src/ops/module.rs:1719 — crates/burn-autodiff/src/ops/module.rs:1719-1759 | crates/burn-autodiff/src/ops/module.rs:1849-1889 | crates/burn-autodiff/src/ops/module.rs:1970-2010 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 41 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or 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 (40 corresponding lines) · ×2
  • Edited copy of a member (40 corresponding lines) crates/burn-cubecl/src/kernel/index/gather_nd.rs:24 — crates/burn-cubecl/src/kernel/index/gather_nd.rs:24-63 | crates/burn-cubecl/src/kernel/index/scatter_nd.rs:29-77 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (40 corresponding lines) crates/burn-train/src/learner/rl/strategy.rs:55 — crates/burn-train/src/learner/rl/strategy.rs:55-94 | crates/burn-train/src/learner/supervised/strategies/base.rs:133-176 — 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 copies of one member (3 members, 38+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 38+ corresponding lines) crates/burn-autodiff/src/ops/module.rs:2083 — crates/burn-autodiff/src/ops/module.rs:2083-2120 | crates/burn-autodiff/src/ops/module.rs:2122-2159 | crates/burn-autodiff/src/ops/module.rs:2168-2205 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 38 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or 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, 38+ corresponding lines) crates/burn-backend/src/backend/ops/modules/conv.rs:663 — crates/burn-backend/src/backend/ops/modules/conv.rs:663-700 | crates/burn-backend/src/backend/ops/modules/conv.rs:745-783 | crates/burn-backend/src/backend/ops/modules/conv.rs:831-870 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 38 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or 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 (29 corresponding lines) · ×2
  • Edited copy of a member (29 corresponding lines) crates/burn-autodiff/src/ops/tensor.rs:2667 — crates/burn-autodiff/src/ops/tensor.rs:2667-2702 | crates/burn-autodiff/src/ops/tensor.rs:2704-2732 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) crates/burn-flex/src/zip.rs:86 — crates/burn-flex/src/zip.rs:86-115 | crates/burn-flex/src/zip.rs:352-380 — 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 (32 corresponding lines) · ×2
  • Edited copy of a member (32 corresponding lines) crates/burn-autodiff/src/ops/tensor.rs:393 — crates/burn-autodiff/src/ops/tensor.rs:393-424 | crates/burn-autodiff/src/ops/tensor.rs:494-526 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) crates/burn-store/src/burnpack.rs:432 — crates/burn-store/src/burnpack.rs:432-463 | crates/burn-store/src/pytorch/store.rs:377-417 — 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 copies of one member (3 members, 14+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 14+ corresponding lines) crates/burn-backend/src/backend/ops/bool_tensor.rs:215 — crates/burn-backend/src/backend/ops/bool_tensor.rs:215-228 | crates/burn-backend/src/backend/ops/int_tensor.rs:170-183 | crates/burn-backend/src/backend/ops/tensor.rs:630-643 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) crates/burn-flex/src/simd/portable.rs:2001 — crates/burn-flex/src/simd/portable.rs:2001-2014 | crates/burn-flex/src/simd/portable.rs:2028-2041 | crates/burn-flex/src/simd/portable.rs:2085-2098 — 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 (4 members, 17+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 17+ corresponding lines) crates/burn-tensor/src/bridge/ops/float.rs:743 — crates/burn-tensor/src/bridge/ops/float.rs:743-759 | crates/burn-tensor/src/bridge/ops/float.rs:934-950 | crates/burn-tensor/src/bridge/ops/float.rs:952-968 | crates/burn-tensor/src/bridge/ops/float.rs:988-1004 — 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) crates/burn-nn/src/modules/conv/conv2d.rs:146 — crates/burn-nn/src/modules/conv/conv2d.rs:146-165 | crates/burn-nn/src/modules/conv/conv3d.rs:153-170 | crates/burn-nn/src/modules/pool/max_pool2d.rs:89-105 | crates/burn-nn/src/modules/pool/max_pool3d.rs:91-109 — 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 (6 members, 10+ corresponding lines) · ×2
  • Edited copies of one member (6 members, 10+ corresponding lines) crates/burn-backend/src/backend/ops/modules/conv.rs:429 — crates/burn-backend/src/backend/ops/modules/conv.rs:429-438 | crates/burn-backend/src/backend/ops/modules/conv.rs:542-554 | crates/burn-backend/src/backend/ops/modules/conv.rs:641-656 | crates/burn-backend/src/backend/ops/modules/conv.rs:729-738 | crates/burn-backend/src/backend/ops/modules/conv.rs:812-824 | crates/burn-backend/src/backend/ops/modules/conv.rs:899-914 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
  • Edited copies of one member (6 members, 10+ corresponding lines) crates/burn-nn/src/modules/rnn/basic.rs:83 — crates/burn-nn/src/modules/rnn/basic.rs:83-92 | crates/burn-nn/src/modules/rnn/basic.rs:277-286 | crates/burn-nn/src/modules/rnn/gru.rs:88-98 | crates/burn-nn/src/modules/rnn/gru.rs:323-338 | crates/burn-nn/src/modules/rnn/lstm/bilstm_module.rs:73-88 | crates/burn-nn/src/modules/rnn/lstm/lstm_module.rs:109-118 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 15+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 15+ corresponding lines) crates/burn-nn/src/modules/rnn/basic.rs:291 — crates/burn-nn/src/modules/rnn/basic.rs:291-305 | crates/burn-nn/src/modules/rnn/gru.rs:343-358 | crates/burn-nn/src/modules/rnn/lstm/bilstm_module.rs:93-110 — 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) crates/burn-cubecl/src/kernel/prng/bernoulli.rs:13 — crates/burn-cubecl/src/kernel/prng/bernoulli.rs:13-27 | crates/burn-cubecl/src/kernel/prng/normal.rs:14-29 | crates/burn-cubecl/src/kernel/prng/uniform.rs:14-29 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 11+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 11+ corresponding lines) crates/burn-tensor/src/bridge/ops/float.rs:508 — crates/burn-tensor/src/bridge/ops/float.rs:508-518 | crates/burn-tensor/src/bridge/ops/float.rs:520-530 | crates/burn-tensor/src/bridge/ops/float.rs:558-568 | crates/burn-tensor/src/bridge/ops/float.rs:582-592 — 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.
  • Edited copies of one member (4 members, 11+ corresponding lines) crates/pytorch-reader/src/nested/de.rs:605 — crates/pytorch-reader/src/nested/de.rs:605-615 | crates/pytorch-reader/src/nested/de.rs:628-639 | crates/pytorch-reader/src/nested/de.rs:652-663 | crates/pytorch-reader/src/nested/de.rs:676-687 — 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 (4 members, 9+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 9+ corresponding lines) crates/burn-flex/src/simd/portable.rs:1523 — crates/burn-flex/src/simd/portable.rs:1523-1531 | crates/burn-flex/src/simd/portable.rs:2017-2025 | crates/burn-flex/src/simd/portable.rs:2044-2052 | crates/burn-flex/src/simd/portable.rs:2127-2140 — 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) crates/burn-nn/src/modules/pool/avg_pool2d.rs:84 — crates/burn-nn/src/modules/pool/avg_pool2d.rs:84-92 | crates/burn-nn/src/modules/pool/avg_pool3d.rs:80-88 | crates/burn-nn/src/modules/pool/max_pool2d.rs:76-84 | crates/burn-nn/src/modules/pool/max_pool3d.rs:78-86 — 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 (4 members, 12+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 12+ corresponding lines) crates/burn-flex/src/simd/portable.rs:1467 — crates/burn-flex/src/simd/portable.rs:1467-1478 | crates/burn-flex/src/simd/portable.rs:1604-1702 | crates/burn-flex/src/simd/portable.rs:1873-1885 | crates/burn-flex/src/simd/portable.rs:1946-1957 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 12+ corresponding lines) crates/burn-fusion/src/client.rs:248 — crates/burn-fusion/src/client.rs:248-259 | crates/burn-fusion/src/client.rs:269-280 | crates/burn-fusion/src/client.rs:290-301 | crates/burn-fusion/src/client.rs:311-322 — 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 (3 members, 12+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 12+ corresponding lines) crates/burn-fusion/src/client.rs:512 — crates/burn-fusion/src/client.rs:512-523 | crates/burn-fusion/src/client.rs:532-543 | crates/burn-fusion/src/client.rs:552-563 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) crates/burn-vision/src/tensor.rs:94 — crates/burn-vision/src/tensor.rs:94-105 | crates/burn-vision/src/tensor.rs:107-118 | crates/burn-vision/src/tensor.rs:158-171 — 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, 9+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 9+ corresponding lines) crates/burn-cubecl/src/ops/collective.rs:74 — crates/burn-cubecl/src/ops/collective.rs:74-82 | crates/burn-cubecl/src/ops/collective.rs:127-135 | crates/burn-cubecl/src/ops/collective.rs:151-159 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) crates/burn-flex/src/ops/activation.rs:48 — crates/burn-flex/src/ops/activation.rs:48-56 | crates/burn-flex/src/ops/float.rs:736-746 | crates/burn-flex/src/ops/float.rs:748-758 — 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 · Duplicated block (38 lines × 2) · ×2
  • Duplicated block (38 lines × 2) crates/burn-flex/src/ops/attention.rs:612 — crates/burn-flex/src/ops/attention.rs:612-649 | crates/burn-flex/src/ops/attention.rs:980-1017 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/attention.rs:612` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (38 lines × 2) crates/burn-flex/src/ops/deform_conv.rs:406 — crates/burn-flex/src/ops/deform_conv.rs:406-443 | crates/burn-flex/src/ops/deform_conv.rs:984-1021 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/deform_conv.rs:406` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (29–30 lines × 2) · ×2
  • Duplicated block (29–30 lines × 2) crates/burn-flex/src/ops/fft.rs:894 — crates/burn-flex/src/ops/fft.rs:894-922 | crates/burn-flex/src/ops/fft.rs:1095-1124 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/fft.rs:894` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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 (29–30 lines × 2) crates/burn-train/src/metric/bleu.rs:350 — crates/burn-train/src/metric/bleu.rs:350-379 | crates/burn-train/src/metric/rouge.rs:93-121 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-train/src/metric/bleu.rs:350` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×2
  • Duplicated block (27 lines × 2) crates/burn-flex/src/ops/fft.rs:808 — crates/burn-flex/src/ops/fft.rs:808-834 | crates/burn-flex/src/ops/fft.rs:1019-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.
  • Duplicated block (27 lines × 2) crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs:120 — crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs:120-146 | crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs:222-248 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs:120` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×2
  • Duplicated block (26 lines × 2) crates/burn-flex/src/ops/deform_conv.rs:364 — crates/burn-flex/src/ops/deform_conv.rs:364-389 | crates/burn-flex/src/ops/deform_conv.rs:944-969 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `a` to `&[f32]` in one and `&[f64]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (26 lines × 2) crates/burn-train/src/learner/rl/env_runner/async_runner.rs:189 — crates/burn-train/src/learner/rl/env_runner/async_runner.rs:189-214 | crates/burn-train/src/learner/rl/env_runner/async_runner.rs:398-423 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-train/src/learner/rl/env_runner/async_runner.rs:189` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/burn-train/src/learner/rl/env_runner/async_runner.rs:395` calls `send`, `Step`, `expect` and `crates/burn-train/src/learner/rl/env_runner/async_runner.rs:187` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×2
  • Duplicated block (25 lines × 2) crates/burn-flex/src/ops/reduce.rs:1953 — crates/burn-flex/src/ops/reduce.rs:1953-1977 | crates/burn-flex/src/ops/reduce.rs:2052-2076 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/reduce.rs:1953` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (25 lines × 2) crates/burn-flex/src/ops/reduce.rs:2213 — crates/burn-flex/src/ops/reduce.rs:2213-2237 | crates/burn-flex/src/ops/reduce.rs:2336-2360 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/reduce.rs:2213` it begins part-way through the construct above it, so those exact lines cannot be lifted 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–23 lines × 2) · ×2
  • Duplicated block (17–23 lines × 2) crates/burn-flex/src/ops/activation.rs:291 — crates/burn-flex/src/ops/activation.rs:291-313 | crates/burn-flex/src/ops/activation.rs:840-856 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/activation.rs:291` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17–23 lines × 2) crates/burn-flex/src/ops/conv.rs:1074 — crates/burn-flex/src/ops/conv.rs:1074-1096 | crates/burn-flex/src/ops/conv_transpose.rs:226-242 — before extracting anything, compare `crates/burn-flex/src/ops/conv.rs` and `crates/burn-flex/src/ops/conv_transpose.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (21–22 lines × 2) · ×2
  • Duplicated block (21–22 lines × 2) crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs:245 — crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs:245-266 | crates/burn-cubecl/src/kernel/conv/forward/tune.rs:261-281 — `crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs` and `crates/burn-cubecl/src/kernel/conv/forward/tune.rs` are one unit implemented 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 41 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs:245` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21–22 lines × 2) crates/burn-store/src/adapter.rs:626 — crates/burn-store/src/adapter.rs:626-646 | crates/pytorch-reader/src/pickle_reader.rs:956-977 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-store/src/adapter.rs:626` it begins part-way through the construct above it, so those 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 lines × 2) · ×2
  • Duplicated block (20 lines × 2) crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs:230 — crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs:230-249 | crates/burn-cubecl/src/kernel/conv/backward_weight/tune.rs:233-252 — `crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs` and `crates/burn-cubecl/src/kernel/conv/backward_weight/tune.rs` are one unit implemented 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 39 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs:230` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) crates/burn-cubecl/src/kernel/ctc.rs:494 — crates/burn-cubecl/src/kernel/ctc.rs:494-513 | crates/burn-cubecl/src/kernel/ctc.rs:583-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/ctc.rs:494` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×2
  • Duplicated block (16–17 lines × 2) crates/burn-cubecl/src/kernel/conv/forward/depthwise.rs:63 — crates/burn-cubecl/src/kernel/conv/forward/depthwise.rs:63-78 | crates/burn-cubecl/src/kernel/conv/forward/implicit_gemm/launch.rs:119-135 — 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 before the matched lines, `crates/burn-cubecl/src/kernel/conv/forward/depthwise.rs:59` calls `skip_large_filter`, `Err` and `crates/burn-cubecl/src/kernel/conv/forward/implicit_gemm/launch.rs:117` 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–17 lines × 2) crates/burn-flex/src/simd/portable.rs:2063 — crates/burn-flex/src/simd/portable.rs:2063-2079 | crates/burn-flex/src/simd/portable.rs:2106-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/simd/portable.rs:2063` it does not close everything it opens, so those 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 `out` to `&mut [u64]` in one and `&mut [u8]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (16 lines × 6) · ×2
  • Duplicated block (16 lines × 6) crates/burn-autodiff/src/ops/module.rs:309 — crates/burn-autodiff/src/ops/module.rs:309-324 | crates/burn-autodiff/src/ops/module.rs:432-447 | crates/burn-autodiff/src/ops/module.rs:567-582 | crates/burn-autodiff/src/ops/module.rs:1020-1035 | crates/burn-autodiff/src/ops/module.rs:1157-1172 | crates/burn-autodiff/src/ops/module.rs:1283-1298 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/module.rs:309` it does not close everything it opens, so those exact lines 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 × 6) crates/burn-cubecl/src/kernel/conv/backward_data/implicit_gemm/launch.rs:21 — crates/burn-cubecl/src/kernel/conv/backward_data/implicit_gemm/launch.rs:21-36 | crates/burn-cubecl/src/kernel/conv/backward_data/implicit_gemm/launch.rs:44-59 | crates/burn-cubecl/src/kernel/conv/backward_weight/implicit_gemm/launch.rs:21-36 | crates/burn-cubecl/src/kernel/conv/backward_weight/implicit_gemm/launch.rs:44-59 | crates/burn-cubecl/src/kernel/conv/forward/implicit_gemm/launch.rs:26-41 | crates/burn-cubecl/src/kernel/conv/forward/implicit_gemm/launch.rs:49-64 — before extracting anything, compare `crates/burn-cubecl/src/kernel/conv/backward_data/implicit_gemm/launch.rs` and `crates/burn-cubecl/src/kernel/conv/backward_weight/implicit_gemm/launch.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/conv/backward_data/implicit_gemm/launch.rs:21` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16 lines × 3) · ×2
  • Duplicated block (16 lines × 3) crates/burn-autodiff/src/ops/module.rs:1465 — crates/burn-autodiff/src/ops/module.rs:1465-1480 | crates/burn-autodiff/src/ops/module.rs:1556-1571 | crates/burn-autodiff/src/ops/module.rs:1660-1675 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/module.rs:1465` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 3) crates/burn-cubecl/src/kernel/unary_float.rs:66 — crates/burn-cubecl/src/kernel/unary_float.rs:66-81 | crates/burn-cubecl/src/kernel/unary_int.rs:60-75 | crates/burn-cubecl/src/kernel/unary_numeric.rs:65-80 — before extracting anything, compare `crates/burn-cubecl/src/kernel/unary_float.rs` and `crates/burn-cubecl/src/kernel/unary_int.rs` as WHOLE FILES: this scan already matched 5 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 `crates/burn-cubecl/src/kernel/unary_float.rs:66` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×2
  • Duplicated block (15–16 lines × 2) crates/burn-flex/src/ops/fft.rs:932 — crates/burn-flex/src/ops/fft.rs:932-946 | crates/burn-flex/src/ops/fft.rs:1136-1151 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/fft.rs:932` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15–16 lines × 2) crates/burn-train/src/learner/rl/paradigm.rs:333 — crates/burn-train/src/learner/rl/paradigm.rs:333-347 | crates/burn-train/src/learner/supervised/paradigm.rs:383-398 — 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 (13–15 lines × 2) · ×2
  • Duplicated block (13–15 lines × 2) crates/burn-flex/src/ops/conv.rs:660 — crates/burn-flex/src/ops/conv.rs:660-674 | crates/burn-flex/src/ops/conv.rs:1991-2003 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/conv.rs:660` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13–15 lines × 2) crates/burn-flex/src/ops/pool.rs:331 — crates/burn-flex/src/ops/pool.rs:331-345 | crates/burn-flex/src/ops/pool.rs:761-773 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/pool.rs:331` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/burn-flex/src/ops/pool.rs:330` calls `as_mut_ptr` and `crates/burn-flex/src/ops/pool.rs:760` 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 (11–12 lines × 2) · ×2
  • Duplicated block (11–12 lines × 2) crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:148 — crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:148-159 | crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:202-212 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:148` it does not close everything it opens, so those exact lines 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) crates/burn-flex/src/ops/deform_conv.rs:151 — crates/burn-flex/src/ops/deform_conv.rs:151-161 | crates/burn-flex/src/ops/deform_conv.rs:482-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.
D4 · Code Duplication · Duplicated block (9–10 lines × 7) · ×2
  • Duplicated block (9–10 lines × 7) crates/burn-autodiff/src/ops/module.rs:379 — crates/burn-autodiff/src/ops/module.rs:379-387 | crates/burn-autodiff/src/ops/module.rs:506-514 | crates/burn-autodiff/src/ops/module.rs:639-647 | crates/burn-autodiff/src/ops/module.rs:963-971 | crates/burn-autodiff/src/ops/module.rs:1094-1103 | crates/burn-autodiff/src/ops/module.rs:1229-1237 | crates/burn-autodiff/src/ops/module.rs:1357-1366 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/module.rs:379` it begins part-way through the construct above it, so those exact lines 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 × 7) crates/burn-flex/src/ops/conv.rs:253 — crates/burn-flex/src/ops/conv.rs:253-261 | crates/burn-flex/src/ops/conv.rs:1415-1423 | crates/burn-flex/src/ops/conv.rs:1640-1648 | crates/burn-flex/src/ops/conv_transpose.rs:263-272 | crates/burn-flex/src/ops/deform_conv.rs:144-152 | crates/burn-flex/src/ops/deform_conv.rs:477-485 | crates/burn-flex/src/ops/deform_conv.rs:783-791 — before extracting anything, compare `crates/burn-flex/src/ops/conv.rs` and `crates/burn-flex/src/ops/conv_transpose.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×2
  • Duplicated block (10 lines × 4) crates/burn-flex/src/ops/reduce.rs:881 — crates/burn-flex/src/ops/reduce.rs:881-890 | crates/burn-flex/src/ops/reduce.rs:1225-1234 | crates/burn-flex/src/ops/reduce.rs:1307-1316 | crates/burn-flex/src/ops/reduce.rs:1376-1385 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/reduce.rs:881` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 4) crates/burn-vision/src/backends/cpu/connected_components/spaghetti/mod.rs:148 — crates/burn-vision/src/backends/cpu/connected_components/spaghetti/mod.rs:148-157 | crates/burn-vision/src/backends/cpu/connected_components/spaghetti/mod.rs:192-201 | crates/burn-vision/src/backends/cpu/connected_components/spaghetti/mod.rs:228-237 | crates/burn-vision/src/backends/cpu/connected_components/spaghetti/mod.rs:254-263 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-vision/src/backends/cpu/connected_components/spaghetti/mod.rs:148` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/burn-vision/src/backends/cpu/connected_components/spaghetti/mod.rs:222` calls `index_axis`, `Axis`, `slice_mut` and `crates/burn-vision/src/backends/cpu/connected_components/spaghetti/mod.rs:191` 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) · ×2
  • Duplicated block (8–9 lines × 3) crates/burn-autodiff/src/ops/module.rs:849 — crates/burn-autodiff/src/ops/module.rs:849-857 | crates/burn-autodiff/src/ops/module.rs:889-896 | crates/burn-autodiff/src/ops/module.rs:926-933 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/module.rs:849` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/burn-autodiff/src/ops/module.rs:858` calls `checkpoint` and `crates/burn-autodiff/src/ops/module.rs:897` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8–9 lines × 3) crates/burn-autodiff/src/ops/tensor.rs:377 — crates/burn-autodiff/src/ops/tensor.rs:377-384 | crates/burn-autodiff/src/ops/tensor.rs:668-676 | crates/burn-autodiff/src/ops/tensor.rs:2136-2143 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/tensor.rs:377` it begins part-way through the construct above it, so those exact lines cannot be lifted 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 × 4) · ×2
  • Duplicated block (7–8 lines × 4) crates/burn-autodiff/src/ops/tensor.rs:3169 — crates/burn-autodiff/src/ops/tensor.rs:3169-3176 | crates/burn-autodiff/src/ops/tensor.rs:4322-4329 | crates/burn-autodiff/src/ops/tensor.rs:4366-4373 | crates/burn-autodiff/src/ops/tensor.rs:4648-4654 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/tensor.rs:3169` it begins part-way through the construct above it, so those 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 × 4) crates/burn-cubecl/src/kernel/comparison.rs:251 — crates/burn-cubecl/src/kernel/comparison.rs:251-257 | crates/burn-cubecl/src/kernel/unary_float.rs:53-60 | crates/burn-cubecl/src/kernel/unary_int.rs:48-54 | crates/burn-cubecl/src/kernel/unary_numeric.rs:53-59 — before extracting anything, compare `crates/burn-cubecl/src/kernel/unary_float.rs` and `crates/burn-cubecl/src/kernel/unary_int.rs` as WHOLE FILES: this scan already matched 5 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/burn-cubecl/src/kernel/unary_float.rs:51` calls `shape`, `in_memory_order` and `crates/burn-cubecl/src/kernel/unary_int.rs:47` 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 lines × 4) · ×2
  • Duplicated block (8 lines × 4) crates/burn-cubecl/src/kernel/cast/bool_cast.rs:44 — crates/burn-cubecl/src/kernel/cast/bool_cast.rs:44-51 | crates/burn-cubecl/src/kernel/unary_float.rs:56-63 | crates/burn-cubecl/src/kernel/unary_int.rs:50-57 | crates/burn-cubecl/src/kernel/unary_numeric.rs:55-62 — before extracting anything, compare `crates/burn-cubecl/src/kernel/unary_float.rs` and `crates/burn-cubecl/src/kernel/unary_int.rs` as WHOLE FILES: this scan already matched 5 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 `crates/burn-cubecl/src/kernel/cast/bool_cast.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.
  • Duplicated block (8 lines × 4) crates/burn-flex/src/ops/pool.rs:848 — crates/burn-flex/src/ops/pool.rs:848-855 | crates/burn-flex/src/ops/pool.rs:871-878 | crates/burn-flex/src/ops/pool.rs:894-901 | crates/burn-flex/src/ops/pool.rs:917-924 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/pool.rs:848` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 5) · ×2
  • Duplicated block (7 lines × 5) crates/burn-autodiff/src/ops/tensor.rs:1227 — crates/burn-autodiff/src/ops/tensor.rs:1227-1234 | crates/burn-autodiff/src/ops/tensor.rs:1537-1545 | crates/burn-autodiff/src/ops/tensor.rs:1999-2006 | crates/burn-autodiff/src/ops/tensor.rs:2407-2413 | crates/burn-autodiff/src/ops/tensor.rs:2467-2473 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/tensor.rs:1227` it does not close everything it opens, so those 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) crates/burn-flex/src/ops/comparison.rs:864 — crates/burn-flex/src/ops/comparison.rs:864-870 | crates/burn-flex/src/ops/reduce.rs:2131-2137 | crates/burn-flex/src/ops/reduce.rs:2186-2192 | crates/burn-flex/src/ops/reduce.rs:2252-2258 | crates/burn-flex/src/ops/reduce.rs:2309-2315 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (6–7 lines × 2) · ×2
  • Duplicated block (6–7 lines × 2) crates/burn-linalg/src/svd_host.rs:54 — crates/burn-linalg/src/svd_host.rs:54-59 | crates/burn-linalg/src/svd_host.rs:63-69 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-linalg/src/svd_host.rs:54` it begins part-way through the construct above it, so those 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–7 lines × 2) crates/burn-vision/src/backends/cpu/morphology/filter.rs:367 — crates/burn-vision/src/backends/cpu/morphology/filter.rs:367-373 | crates/burn-vision/src/backends/cpu/morphology/filter.rs:576-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 `crates/burn-vision/src/backends/cpu/morphology/filter.rs:367` it begins part-way through the construct above it, so those exact lines cannot be lifted 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 × 5) · ×2
  • Duplicated block (6 lines × 5) crates/burn-autodiff/src/ops/tensor.rs:378 — crates/burn-autodiff/src/ops/tensor.rs:378-384 | crates/burn-autodiff/src/ops/tensor.rs:669-676 | crates/burn-autodiff/src/ops/tensor.rs:756-761 | crates/burn-autodiff/src/ops/tensor.rs:807-812 | crates/burn-autodiff/src/ops/tensor.rs:2138-2143 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/tensor.rs:378` it begins part-way through the construct above it, so those exact lines 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) crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs:31 — crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs:31-39 | crates/burn-cubecl/src/kernel/conv/backward_weight/tune.rs:34-39 | crates/burn-cubecl/src/kernel/conv/conv_transpose2d/tune.rs:17-22 | crates/burn-cubecl/src/kernel/conv/conv_transpose3d/tune.rs:24-29 | crates/burn-cubecl/src/kernel/conv/forward/tune.rs:58-63 — `crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs` and `crates/burn-cubecl/src/kernel/conv/backward_weight/tune.rs` are one unit implemented 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 39 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs:31` it does not close everything it opens, so those 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 · TensorInterpreter · ×1
  • TensorInterpreter::execute_op (cyclomatic 340) crates/burn-router/src/interpreter.rs:287 — TensorInterpreter::execute_op has cyclomatic complexity 340 (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 · Unpickler · ×1
  • Unpickler::run (cyclomatic 68) crates/pytorch-reader/src/pickle_reader.rs:1341 — Unpickler::run has cyclomatic complexity 68 (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 · SessionHandler · ×1
  • SessionHandler::process_task (cyclomatic 45) crates/burn-remote/src/server/worker.rs:272 — SessionHandler::process_task has cyclomatic complexity 45 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · VectorizationPlanner · ×1
  • VectorizationPlanner::run (cyclomatic 42) crates/burn-cubecl-fusion/src/engine/launch/vectorization/planner.rs:40 — VectorizationPlanner::run has cyclomatic complexity 42 (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 · Autodiff · ×1
  • Autodiff::deform_conv2d (cyclomatic 24) crates/burn-autodiff/src/ops/module.rs:679 — Autodiff::deform_conv2d has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ReduceFuser · ×1
  • ReduceFuser::fuse (cyclomatic 24) crates/burn-cubecl-fusion/src/optim/reduce/fuser.rs:218 — ReduceFuser::fuse 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.
D1 · Cyclomatic Complexity · burn_backend · ×1
  • burn_backend::cubecl::dtype_to_elem_type (cyclomatic 23) crates/burn-backend/src/cubecl.rs:90 — burn_backend::cubecl::dtype_to_elem_type 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.
D1 · Cyclomatic Complexity · Plan · ×1
  • Plan::new (cyclomatic 23) crates/burn-einsum/src/plan.rs:125 — Plan::new 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 · DType · ×1
  • DType::size (cyclomatic 22) crates/burn-std/src/tensor/dtype.rs:36 — DType::size has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · LaunchPlanExecutor · ×1
  • LaunchPlanExecutor::execute (cyclomatic 21) crates/burn-cubecl-fusion/src/engine/launch/executor.rs:40 — LaunchPlanExecutor::execute has cyclomatic complexity 21 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · burn_optim · ×1
  • burn_optim::optim::lbfgs::strong_wolfe (cyclomatic 21) crates/burn-optim/src/optim/lbfgs.rs:71 — burn_optim::optim::lbfgs::strong_wolfe 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 · burn_fusion · ×1
  • burn_fusion::search::merging::merge_blocks_step2 (cyclomatic 20) crates/burn-fusion/src/search/merging.rs:140 — burn_fusion::search::merging::merge_blocks_step2 has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · TensorData · ×1
  • TensorData::assert_eq (cyclomatic 20) crates/burn-std/src/data/compare.rs:229 — TensorData::assert_eq has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · MorphColumnVec · ×1
  • MorphColumnVec::apply (cyclomatic 20) crates/burn-vision/src/backends/cpu/morphology/filter.rs:212 — MorphColumnVec::apply has cyclomatic complexity 20 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · FlexTensor · ×1
  • FlexTensor::copy_contiguous (cyclomatic 19) crates/burn-flex/src/tensor.rs:330 — FlexTensor::copy_contiguous 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 · LBFGS · ×1
  • LBFGS::step (cyclomatic 19) crates/burn-optim/src/optim/lbfgs.rs:674 — LBFGS::step 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 · TuiMetricsRenderer · ×1
  • TuiMetricsRenderer::handle_event (cyclomatic 17) crates/burn-train/src/renderer/tui/renderer.rs:419 — TuiMetricsRenderer::handle_event has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · LazyMethod · ×1
  • LazyMethod::new (cyclomatic 16) crates/burn-backend-extension/src/parse.rs:95 — LazyMethod::new has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CaptureScopeGuard · ×1
  • CaptureScopeGuard::complete (cyclomatic 16) crates/burn-capture/src/capture.rs:273 — CaptureScopeGuard::complete 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.
D17 · Explicit Debt · HackComment · ×1
  • HackComment crates/burn-vision/src/backends/cpu/connected_components.rs:86 — /// Hack to get around mutable borrow limitations on methods — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
D2 · Cognitive Complexity · VectorizationPlanner · ×1
  • VectorizationPlanner::run (cognitive 62) crates/burn-cubecl-fusion/src/engine/launch/vectorization/planner.rs:40 — VectorizationPlanner::run has cognitive complexity 62 (threshold 15). Drivers by points: if/else 12 (26 pts), match/switch 11 (21 pts), loops 12 (15 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LBFGS · ×1
  • LBFGS::step (cognitive 44) crates/burn-optim/src/optim/lbfgs.rs:674 — LBFGS::step has cognitive complexity 44 (threshold 15). Drivers by points: if/else 19 (35 pts), loops 3 (9 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 · MorphColumnVec · ×1
  • MorphColumnVec::apply (cognitive 43) crates/burn-vision/src/backends/cpu/morphology/filter.rs:212 — MorphColumnVec::apply has cognitive complexity 43 (threshold 15). Drivers by points: loops 12 (30 pts), if/else 6 (12 pts), boolean chains 1 (nesting depth added 24). 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 · burn_optim · ×1
  • burn_optim::optim::lbfgs::strong_wolfe (cognitive 42) crates/burn-optim/src/optim/lbfgs.rs:71 — burn_optim::optim::lbfgs::strong_wolfe has cognitive complexity 42 (threshold 15). Drivers by points: if/else 19 (35 pts), boolean chains 5, loops 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 · Plan · ×1
  • Plan::new (cognitive 36) crates/burn-einsum/src/plan.rs:125 — Plan::new has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 8 (12 pts), boolean chains 4, match/switch 1 (3 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 · GraphMemoryManagement · ×1
  • GraphMemoryManagement::useful_propagation (cognitive 35) crates/burn-autodiff/src/runtime/memory_management.rs:155 — GraphMemoryManagement::useful_propagation has cognitive complexity 35 (threshold 15). Drivers by points: if/else 4 (13 pts), match/switch 4 (12 pts), loops 3 (7 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.
D2 · Cognitive Complexity · FlexTensor · ×1
  • FlexTensor::copy_contiguous (cognitive 35) crates/burn-flex/src/tensor.rs:330 — FlexTensor::copy_contiguous has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (21 pts), loops 3 (10 pts), boolean chains 4 (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 · TensorInterpreter · ×1
  • TensorInterpreter::execute_op (cognitive 29) crates/burn-router/src/interpreter.rs:287 — TensorInterpreter::execute_op has cognitive complexity 29 (threshold 15). Drivers by points: match/switch 12 (22 pts), if/else 2 (6 pts), boolean chains 1 (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.
D2 · Cognitive Complexity · LaunchPlanExecutor · ×1
  • LaunchPlanExecutor::execute (cognitive 27) crates/burn-cubecl-fusion/src/engine/launch/executor.rs:40 — LaunchPlanExecutor::execute has cognitive complexity 27 (threshold 15). Drivers by points: loops 11 (21 pts), match/switch 3 (5 pts), if/else 1 (nesting depth added 12). 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 · Unpickler · ×1
  • Unpickler::run (cognitive 26) crates/pytorch-reader/src/pickle_reader.rs:1341 — Unpickler::run has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (14 pts), match/switch 4 (11 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Autodiff · ×1
  • Autodiff::deform_conv2d (cognitive 25) crates/burn-autodiff/src/ops/module.rs:679 — Autodiff::deform_conv2d has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16, match/switch 5 (9 pts) (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ConfigAnalyzerFactory · ×1
  • ConfigAnalyzerFactory::create_struct_analyzer (cognitive 25) crates/burn-derive/src/config/analyzer.rs:38 — ConfigAnalyzerFactory::create_struct_analyzer has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 2 (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 · burn_einsum · ×1
  • burn_einsum::parse (cognitive 25) crates/burn-einsum/src/lib.rs:158 — burn_einsum::parse has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 4 (7 pts), match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ModuleDisplay · ×1
  • ModuleDisplay::format (cognitive 24) crates/burn-core/src/module/display.rs:47 — ModuleDisplay::format has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19 (23 pts), loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Actions · ×1
  • Actions::gather (cognitive 23) crates/burn-cubecl-fusion/src/engine/launch/vectorization/axis.rs:257 — Actions::gather has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 5 (8 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.
D2 · Cognitive Complexity · TuneOutput · ×1
  • TuneOutput::check_equivalence (cognitive 23) crates/burn-cubecl-fusion/src/engine/trace/base.rs:222 — TuneOutput::check_equivalence has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 1 (4 pts), loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OffPolicyStrategy · ×1
  • OffPolicyStrategy::train_loop (cognitive 23) crates/burn-train/src/learner/rl/off_policy.rs:62 — OffPolicyStrategy::train_loop has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DdpWorker · ×1
  • DdpWorker::fit (cognitive 23) crates/burn-train/src/learner/supervised/strategies/ddp/worker.rs:56 — DdpWorker::fit has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (21 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.
D2 · Cognitive Complexity · MorphColumnFilter · ×1
  • MorphColumnFilter::apply (cognitive 23) crates/burn-vision/src/backends/cpu/morphology/filter.rs:438 — MorphColumnFilter::apply has cognitive complexity 23 (threshold 15). Drivers by points: loops 10 (22 pts), boolean chains 1 (nesting depth added 12). 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 · burn_tensor · ×1
  • burn_tensor::tensor::api::einsum::execution::validate_broadcast (cognitive 22) crates/burn-tensor/src/tensor/api/einsum/execution.rs:245 — burn_tensor::tensor::api::einsum::execution::validate_broadcast has cognitive complexity 22 (threshold 15). Drivers by points: if/else 3 (12 pts), match/switch 1 (5 pts), loops 2 (3 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.
D2 · Cognitive Complexity · FileMetricLogger · ×1
  • FileMetricLogger::epochs (cognitive 22) crates/burn-train/src/logger/metric.rs:105 — FileMetricLogger::epochs has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Dag · ×1
  • Dag::reachability (cognitive 21) crates/burn-fusion/src/search/graph/dag.rs:89 — Dag::reachability has cognitive complexity 21 (threshold 15). Drivers by points: loops 7 (17 pts), if/else 1 (3 pts), match/switch 1 (nesting depth added 12). 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 · MultiAgentEnvLoop · ×1
  • MultiAgentEnvLoop::run_episodes (cognitive 21) crates/burn-train/src/learner/rl/env_runner/async_runner.rs:430 — MultiAgentEnvLoop::run_episodes has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CaptureScopeGuard · ×1
  • CaptureScopeGuard::complete (cognitive 20) crates/burn-capture/src/capture.rs:273 — CaptureScopeGuard::complete has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 6, 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 · Layout · ×1
  • Layout::slice (cognitive 20) crates/burn-flex/src/layout.rs:244 — Layout::slice has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GraphIr · ×1
  • GraphIr::classify (cognitive 20) crates/burn-ir/src/graph.rs:58 — GraphIr::classify has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (6 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 · ApplyResult · ×1
  • ApplyResult::fmt (cognitive 20) crates/burn-store/src/apply_result.rs:180 — ApplyResult::fmt has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ComposedCheckpointingStrategy · ×1
  • ComposedCheckpointingStrategy::checkpointing (cognitive 20) crates/burn-train/src/checkpoint/strategy/composed.rs:51 — ComposedCheckpointingStrategy::checkpointing has cognitive complexity 20 (threshold 15). Drivers by points: loops 5 (9 pts), if/else 4 (8 pts), match/switch 1 (3 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 · MemoryOrder · ×1
  • MemoryOrder::from_layouts (cognitive 19) crates/burn-cubecl/src/kernel/memory_order.rs:181 — MemoryOrder::from_layouts has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, loops 2, 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 · Flex · ×1
  • Flex::int_cast (cognitive 19) crates/burn-flex/src/ops/int.rs:1016 — Flex::int_cast has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 9 (17 pts), if/else 2 (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · burn_std · ×1
  • burn_std::tensor::reshape_analysis (cognitive 19) crates/burn-std/src/tensor/mod.rs:230 — burn_std::tensor::reshape_analysis has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 1 (3 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.
D2 · Cognitive Complexity · LearnerSummary · ×1
  • LearnerSummary::fmt (cognitive 19) crates/burn-train/src/learner/summary.rs:262 — LearnerSummary::fmt has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 6 (7 pts), match/switch 1 (nesting depth added 4). Of this number, 16 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TuiMetricsRenderer · ×1
  • TuiMetricsRenderer::handle_post_training (cognitive 19) crates/burn-train/src/renderer/tui/renderer.rs:570 — TuiMetricsRenderer::handle_post_training has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (14 pts), match/switch 1 (3 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 · LazyMethod · ×1
  • LazyMethod::new (cognitive 18) crates/burn-backend-extension/src/parse.rs:95 — LazyMethod::new has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), match/switch 3 (4 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.
D2 · Cognitive Complexity · FusionBehavior · ×1
  • FusionBehavior::new (cognitive 18) crates/burn-backend-extension/src/parse.rs:541 — FusionBehavior::new has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 2, 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 · SessionHandler · ×1
  • SessionHandler::process_task (cognitive 18) crates/burn-remote/src/server/worker.rs:272 — SessionHandler::process_task has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 7 (13 pts), loops 1 (3 pts), if/else 1 (2 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 · NumericEntry · ×1
  • NumericEntry::deserialize (cognitive 18) crates/burn-train/src/metric/base.rs:282 — NumericEntry::deserialize has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 4 (12 pts), if/else 5 (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 · SupervisedTraining · ×1
  • SupervisedTraining::launch (cognitive 17) crates/burn-train/src/learner/supervised/paradigm.rs:377 — SupervisedTraining::launch has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 4 (7 pts), if/else 6, boolean chains 2, 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.
D2 · Cognitive Complexity · MultiDeviceLearningStrategy · ×1
  • MultiDeviceLearningStrategy::fit (cognitive 17) crates/burn-train/src/learner/supervised/strategies/multi/strategy.rs:21 — MultiDeviceLearningStrategy::fit has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, 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 · ReduceBlockFuser · ×1
  • ReduceBlockFuser::analyze (cognitive 16) crates/burn-cubecl-fusion/src/optim/reduce_broadcasted/fuser/block.rs:72 — ReduceBlockFuser::analyze has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Processor · ×1
  • Processor::process (cognitive 16) crates/burn-fusion/src/stream/execution/processor.rs:36 — Processor::process has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 3 (6 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 · MemoryChecks · ×1
  • MemoryChecks::spawn_new (cognitive 16) crates/burn-fusion/src/stream/memory_checks.rs:183 — MemoryChecks::spawn_new has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 3 (8 pts), if/else 3 (7 pts), loops 1 (nesting depth added 9). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Evaluator · ×1
  • Evaluator::eval_all (cognitive 16) crates/burn-train/src/evaluator/base.rs:55 — Evaluator::eval_all has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (3 pts), match/switch 1 (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 · AgentEnvBaseLoop · ×1
  • AgentEnvBaseLoop::run_episodes (cognitive 16) crates/burn-train/src/learner/rl/env_runner/base.rs:221 — AgentEnvBaseLoop::run_episodes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (4 members, 20 shared lines) · ×1
  • Near-duplicate member family (4 members, 20 shared lines) crates/burn-autodiff/src/ops/tensor.rs:334 — crates/burn-autodiff/src/ops/tensor.rs:334-391 | crates/burn-autodiff/src/ops/tensor.rs:621-683 | crates/burn-autodiff/src/ops/tensor.rs:712-768 | crates/burn-autodiff/src/ops/tensor.rs:774-821 — These 4 members are variants of one another: a block of 20 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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) crates/burn-autodiff/src/ops/tensor.rs:426 — crates/burn-autodiff/src/ops/tensor.rs:426-492 | crates/burn-autodiff/src/ops/tensor.rs:528-592 | crates/burn-autodiff/src/ops/tensor.rs:712-768 | crates/burn-autodiff/src/ops/tensor.rs:3962-4038 — These 4 members are variants of one another: a block of 18 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Near-duplicate member family (4 members, 14 shared lines) · ×1
  • Near-duplicate member family (4 members, 14 shared lines) crates/burn-autodiff/src/ops/tensor.rs:334 — crates/burn-autodiff/src/ops/tensor.rs:334-391 | crates/burn-autodiff/src/ops/tensor.rs:426-492 | crates/burn-autodiff/src/ops/tensor.rs:528-592 | crates/burn-autodiff/src/ops/tensor.rs:621-683 — These 4 members are variants of one another: a block of 14 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Near-duplicate member family (3 members, 34 shared lines) · ×1
  • Near-duplicate member family (3 members, 34 shared lines) crates/burn-cubecl/src/kernel/binary.rs:226 — crates/burn-cubecl/src/kernel/binary.rs:226-297 | crates/burn-cubecl/src/kernel/binary_float.rs:146-217 | crates/burn-cubecl/src/kernel/binary_int.rs:176-245 — 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, 29 shared lines) · ×1
  • Near-duplicate member family (3 members, 29 shared lines) crates/burn-flex/src/ops/interpolate.rs:387 — crates/burn-flex/src/ops/interpolate.rs:387-504 | crates/burn-flex/src/ops/interpolate.rs:568-707 | crates/burn-flex/src/ops/interpolate.rs:788-903 — These 3 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 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, 13 shared lines) · ×1
  • Near-duplicate member family (3 members, 13 shared lines) crates/burn-nn/src/modules/conv/conv1d.rs:79 — crates/burn-nn/src/modules/conv/conv1d.rs:79-100 | crates/burn-nn/src/modules/conv/conv2d.rs:123-141 | crates/burn-nn/src/modules/conv/conv3d.rs:127-148 — These 3 members are variants of one another: a block of 13 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 (119 shared lines) · ×1
  • Near-duplicate member pair (119 shared lines) crates/burn-flex/src/ops/attention.rs:258 — crates/burn-flex/src/ops/attention.rs:258-415 | crates/burn-flex/src/ops/attention.rs:764-925 — These two members are variants of one another: 119 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 (94 shared lines) · ×1
  • Near-duplicate member pair (94 shared lines) crates/burn-flex/src/ops/fft.rs:807 — crates/burn-flex/src/ops/fft.rs:807-946 | crates/burn-flex/src/ops/fft.rs:1018-1151 — These two members are variants of one another: 94 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 (71 shared lines) · ×1
  • Near-duplicate member pair (71 shared lines) crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs:68 — crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs:68-164 | crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs:173-264 — These two members are variants of one another: 71 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) crates/burn-flex/src/ops/attention.rs:545 — crates/burn-flex/src/ops/attention.rs:545-727 | crates/burn-flex/src/ops/attention.rs:940-1055 — 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 (59 shared lines) · ×1
  • Near-duplicate member pair (59 shared lines) crates/burn-flex/src/ops/pool.rs:263 — crates/burn-flex/src/ops/pool.rs:263-398 | crates/burn-flex/src/ops/pool.rs:695-828 — These two members are variants of one another: 59 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (54 shared lines) · ×1
  • Near-duplicate member pair (54 shared lines) crates/burn-flex/src/ops/reduce.rs:858 — crates/burn-flex/src/ops/reduce.rs:858-1061 | crates/burn-flex/src/ops/reduce.rs:1203-1289 — These two members are variants of one another: 54 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (47 shared lines) · ×1
  • Near-duplicate member pair (47 shared lines) crates/burn-flex/src/ops/interpolate.rs:250 — crates/burn-flex/src/ops/interpolate.rs:250-352 | crates/burn-flex/src/ops/interpolate.rs:918-1012 — These two members are variants of one another: 47 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (45 shared lines) · ×1
  • Near-duplicate member pair (45 shared lines) crates/burn-cubecl/src/kernel/unary_float.rs:50 — crates/burn-cubecl/src/kernel/unary_float.rs:50-102 | crates/burn-cubecl/src/kernel/unary_numeric.rs:50-101 — 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 (23 shared lines) · ×1
  • Near-duplicate member pair (23 shared lines) crates/burn-flex/src/ops/reduce.rs:669 — crates/burn-flex/src/ops/reduce.rs:669-694 | crates/burn-flex/src/ops/reduce.rs:696-721 — These two members are variants of one another: 23 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Edited copy of a member (53 corresponding lines) · ×1
  • Edited copy of a member (53 corresponding lines) crates/burn-train/src/learner/rl/env_runner/async_runner.rs:222 — crates/burn-train/src/learner/rl/env_runner/async_runner.rs:222-296 | crates/burn-train/src/learner/rl/env_runner/async_runner.rs:436-526 — 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 · Members sharing a duplicated core (14 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (14 members, 50+ identical tokens) crates/burn-autodiff/src/ops/tensor.rs:849 — crates/burn-autodiff/src/ops/tensor.rs:849-887 | crates/burn-autodiff/src/ops/tensor.rs:3226-3262 | crates/burn-autodiff/src/ops/tensor.rs:3264-3302 | crates/burn-autodiff/src/ops/tensor.rs:3405-3445 | crates/burn-autodiff/src/ops/tensor.rs:3485-3522 | crates/burn-autodiff/src/ops/tensor.rs:3524-3560 | crates/burn-autodiff/src/ops/tensor.rs:3604-3639 | crates/burn-autodiff/src/ops/tensor.rs:3641-3676 | crates/burn-autodiff/src/ops/tensor.rs:3718-3756 | crates/burn-autodiff/src/ops/tensor.rs:3758-3797 | crates/burn-autodiff/src/ops/tensor.rs:3799-3837 | crates/burn-autodiff/src/ops/tensor.rs:3839-3878 | crates/burn-autodiff/src/ops/tensor.rs:3880-3919 | crates/burn-autodiff/src/ops/tensor.rs:3921-3960 — These 14 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 14 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 14 times.
D4 · Code Duplication · Members sharing a duplicated core (12 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (12 members, 50+ identical tokens) crates/burn-autodiff/src/ops/module.rs:119 — crates/burn-autodiff/src/ops/module.rs:119-151 | crates/burn-autodiff/src/ops/tensor.rs:889-941 | crates/burn-autodiff/src/ops/tensor.rs:2734-2771 | crates/burn-autodiff/src/ops/tensor.rs:2773-2808 | crates/burn-autodiff/src/ops/tensor.rs:2844-2876 | crates/burn-autodiff/src/ops/tensor.rs:2878-2913 | crates/burn-autodiff/src/ops/tensor.rs:2915-3018 | crates/burn-autodiff/src/ops/tensor.rs:4040-4074 | crates/burn-autodiff/src/ops/tensor.rs:4076-4110 | crates/burn-autodiff/src/ops/tensor.rs:4112-4146 | crates/burn-autodiff/src/ops/tensor.rs:4148-4182 | crates/burn-autodiff/src/ops/tensor.rs:4707-4770 — 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) crates/burn-autodiff/src/ops/module.rs:25 — crates/burn-autodiff/src/ops/module.rs:25-106 | crates/burn-autodiff/src/ops/module.rs:165-275 | crates/burn-autodiff/src/ops/module.rs:300-416 | crates/burn-autodiff/src/ops/module.rs:423-551 | crates/burn-autodiff/src/ops/module.rs:558-677 | crates/burn-autodiff/src/ops/module.rs:686-992 | crates/burn-autodiff/src/ops/module.rs:1011-1141 | crates/burn-autodiff/src/ops/module.rs:1148-1267 | crates/burn-autodiff/src/ops/module.rs:1274-1404 | crates/burn-autodiff/src/ops/module.rs:2276-2367 — 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 · Members sharing a duplicated core (9 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (9 members, 50+ identical tokens) crates/burn-flex/src/ops/conv.rs:248 — crates/burn-flex/src/ops/conv.rs:248-544 | crates/burn-flex/src/ops/conv.rs:860-998 | crates/burn-flex/src/ops/conv.rs:1409-1523 | crates/burn-flex/src/ops/conv.rs:1634-1764 | crates/burn-flex/src/ops/conv.rs:1842-1976 | crates/burn-flex/src/ops/conv_transpose.rs:258-541 | crates/burn-flex/src/ops/deform_conv.rs:135-359 | crates/burn-flex/src/ops/deform_conv.rs:467-676 | crates/burn-flex/src/ops/deform_conv.rs:774-940 — 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 (296 corresponding lines) · ×1
  • Edited copy of a member (296 corresponding lines) crates/burn-autodiff/src/ops/tensor.rs:1161 — crates/burn-autodiff/src/ops/tensor.rs:1161-1464 | crates/burn-autodiff/src/ops/tensor.rs:1471-1766 — These two members are one piece of code written twice and then edited apart: 296 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (154 corresponding lines) · ×1
  • Edited copy of a member (154 corresponding lines) crates/burn-flex/src/ops/int.rs:219 — crates/burn-flex/src/ops/int.rs:219-372 | crates/burn-flex/src/ops/int.rs:451-624 — These two members are one piece of code written twice and then edited apart: 154 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (143 corresponding lines) · ×1
  • Edited copy of a member (143 corresponding lines) crates/burn-ir/src/operation.rs:2688 — crates/burn-ir/src/operation.rs:2688-2830 | crates/burn-ir/src/operation.rs:3608-3772 — These two members are one piece of code written twice and then edited apart: 143 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (110 corresponding lines) · ×1
  • Edited copy of a member (110 corresponding lines) crates/burn-ir/src/operation.rs:2576 — crates/burn-ir/src/operation.rs:2576-2686 | crates/burn-ir/src/operation.rs:3497-3606 — These two members are one piece of code written twice and then edited apart: 110 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) crates/burn-cubecl/src/kernel/conv/conv_transpose2d/col2im.rs:35 — crates/burn-cubecl/src/kernel/conv/conv_transpose2d/col2im.rs:35-133 | crates/burn-cubecl/src/kernel/conv/conv_transpose3d/col2im.rs:38-150 — 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 (57 corresponding lines) · ×1
  • Edited copy of a member (57 corresponding lines) crates/burn-vision/src/backends/cpu/morphology/filter.rs:116 — crates/burn-vision/src/backends/cpu/morphology/filter.rs:116-173 | crates/burn-vision/src/backends/cpu/morphology/filter.rs:555-611 — These two members are one piece of code written twice and then edited apart: 57 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 44+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 44+ corresponding lines) crates/burn-flex/src/ops/reduce.rs:728 — crates/burn-flex/src/ops/reduce.rs:728-785 | crates/burn-flex/src/ops/reduce.rs:788-845 | crates/burn-flex/src/ops/reduce.rs:1605-1648 | crates/burn-flex/src/ops/reduce.rs:1651-1694 | crates/burn-flex/src/ops/reduce.rs:1697-1745 | crates/burn-flex/src/ops/reduce.rs:1748-1796 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 44 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or 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 copy of a member (70 corresponding lines) · ×1
  • Edited copy of a member (70 corresponding lines) crates/burn-nn/src/modules/transformer/decoder.rs:323 — crates/burn-nn/src/modules/transformer/decoder.rs:323-392 | crates/burn-nn/src/modules/transformer/decoder.rs:400-487 — 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 (67 corresponding lines) · ×1
  • Edited copy of a member (67 corresponding lines) crates/burn-ir/src/operation.rs:3866 — crates/burn-ir/src/operation.rs:3866-3932 | crates/burn-ir/src/operation.rs:5422-5489 — These two members are one piece of code written twice and then edited apart: 67 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (48 corresponding lines) · ×1
  • Edited copy of a member (48 corresponding lines) crates/burn-flex/src/simd/portable.rs:284 — crates/burn-flex/src/simd/portable.rs:284-331 | crates/burn-flex/src/simd/portable.rs:424-476 — 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 · Edited copy of a member (58 corresponding lines) · ×1
  • Edited copy of a member (58 corresponding lines) crates/burn-cubecl/src/kernel/conv/conv_transpose2d/col2im.rs:258 — crates/burn-cubecl/src/kernel/conv/conv_transpose2d/col2im.rs:258-315 | crates/burn-cubecl/src/kernel/conv/conv_transpose3d/col2im.rs:268-339 — 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 (46 corresponding lines) · ×1
  • Edited copy of a member (46 corresponding lines) crates/burn-flex/src/ops/module.rs:764 — crates/burn-flex/src/ops/module.rs:764-819 | crates/burn-flex/src/ops/module.rs:826-871 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (52 corresponding lines) · ×1
  • Edited copy of a member (52 corresponding lines) crates/burn-flex/src/ops/reduce.rs:1297 — crates/burn-flex/src/ops/reduce.rs:1297-1350 | crates/burn-flex/src/ops/reduce.rs:1366-1417 — 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 copies of one member (6 members, 54+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 54+ corresponding lines) crates/burn-autodiff/src/ops/tensor.rs:943 — crates/burn-autodiff/src/ops/tensor.rs:943-996 | crates/burn-autodiff/src/ops/tensor.rs:1048-1107 | crates/burn-autodiff/src/ops/tensor.rs:1816-1873 | crates/burn-autodiff/src/ops/tensor.rs:2316-2370 | crates/burn-autodiff/src/ops/tensor.rs:3350-3403 | crates/burn-autodiff/src/ops/tensor.rs:4574-4644 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 54 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or 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 copy of a member (63 corresponding lines) · ×1
  • Edited copy of a member (63 corresponding lines) crates/burn-cubecl-fusion/src/engine/trace/block.rs:259 — crates/burn-cubecl-fusion/src/engine/trace/block.rs:259-321 | crates/burn-cubecl-fusion/src/engine/trace/block.rs:329-402 — 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 (59 corresponding lines) · ×1
  • Edited copy of a member (59 corresponding lines) crates/burn-optim/src/optim/adam.rs:153 — crates/burn-optim/src/optim/adam.rs:153-211 | crates/burn-optim/src/optim/adamw.rs:162-226 — 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, 53+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 53+ corresponding lines) crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs:219 — crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs:219-274 | crates/burn-cubecl/src/kernel/conv/backward_weight/tune.rs:222-283 | crates/burn-cubecl/src/kernel/conv/forward/tune.rs:237-289 — 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 copy of a member (42 corresponding lines) · ×1
  • Edited copy of a member (42 corresponding lines) crates/burn-flex/src/ops/cumulative.rs:43 — crates/burn-flex/src/ops/cumulative.rs:43-95 | crates/burn-flex/src/ops/cumulative.rs:108-149 — 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 (5 members, 40+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 40+ corresponding lines) crates/burn-autodiff/src/ops/module.rs:1429 — crates/burn-autodiff/src/ops/module.rs:1429-1502 | crates/burn-autodiff/src/ops/module.rs:1512-1593 | crates/burn-autodiff/src/ops/module.rs:1616-1697 | crates/burn-autodiff/src/ops/module.rs:2218-2257 | crates/burn-autodiff/src/ops/module.rs:2375-2455 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 40 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or 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 (44 corresponding lines) · ×1
  • Edited copy of a member (44 corresponding lines) crates/burn-nn/src/modules/conv/conv3d.rs:74 — crates/burn-nn/src/modules/conv/conv3d.rs:74-117 | crates/burn-nn/src/modules/conv/deform_conv2d.rs:80-137 — 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 (4 members, 37+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 37+ corresponding lines) crates/burn-autodiff/src/ops/tensor.rs:3188 — crates/burn-autodiff/src/ops/tensor.rs:3188-3224 | crates/burn-autodiff/src/ops/tensor.rs:3447-3483 | crates/burn-autodiff/src/ops/tensor.rs:3562-3602 | crates/burn-autodiff/src/ops/tensor.rs:3678-3716 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 48+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 48+ corresponding lines) crates/burn-cubecl/src/kernel/binary.rs:302 — crates/burn-cubecl/src/kernel/binary.rs:302-354 | crates/burn-cubecl/src/kernel/binary_int.rs:250-297 | crates/burn-cubecl/src/kernel/unary_int.rs:47-95 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 48 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 22+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 22+ corresponding lines) crates/burn-train/src/metric/fbetascore.rs:127 — crates/burn-train/src/metric/fbetascore.rs:127-148 | crates/burn-train/src/metric/precision.rs:95-116 | crates/burn-train/src/metric/recall.rs:92-113 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 49+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 49+ corresponding lines) crates/burn-autodiff/src/ops/module.rs:1769 — crates/burn-autodiff/src/ops/module.rs:1769-1817 | crates/burn-autodiff/src/ops/module.rs:1899-1948 | crates/burn-autodiff/src/ops/module.rs:2020-2069 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 49 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or 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 (39 corresponding lines) · ×1
  • Edited copy of a member (39 corresponding lines) crates/burn-cubecl/src/kernel/reduce/tune.rs:283 — crates/burn-cubecl/src/kernel/reduce/tune.rs:283-321 | crates/burn-cubecl/src/kernel/reduce/tune.rs:366-410 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (36 corresponding lines) · ×1
  • Edited copy of a member (36 corresponding lines) crates/burn-cubecl/src/kernel/index/slice.rs:142 — crates/burn-cubecl/src/kernel/index/slice.rs:142-177 | crates/burn-cubecl/src/kernel/index/slice_assign.rs:57-96 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 34+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 34+ corresponding lines) crates/burn-nn/src/modules/conv/conv2d.rs:76 — crates/burn-nn/src/modules/conv/conv2d.rs:76-113 | crates/burn-nn/src/modules/conv/conv_transpose1d.rs:100-133 | crates/burn-nn/src/modules/conv/conv_transpose2d.rs:100-134 | crates/burn-nn/src/modules/conv/conv_transpose3d.rs:100-135 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 34 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or 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, 28+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 28+ corresponding lines) crates/burn-cubecl/src/kernel/pool/base.rs:142 — crates/burn-cubecl/src/kernel/pool/base.rs:142-177 | crates/burn-cubecl/src/kernel/pool/base.rs:238-267 | crates/burn-cubecl/src/kernel/pool/base.rs:319-349 | crates/burn-cubecl/src/kernel/pool/base.rs:351-378 | crates/burn-cubecl/src/kernel/pool/base.rs:380-408 | crates/burn-cubecl/src/kernel/pool/base.rs:410-439 — These 6 members are one piece of code written 6 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 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 31+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 31+ corresponding lines) crates/burn-cubecl/src/kernel/index/scatter.rs:130 — crates/burn-cubecl/src/kernel/index/scatter.rs:130-160 | crates/burn-cubecl/src/kernel/index/scatter.rs:178-215 | crates/burn-cubecl/src/kernel/index/select_assign.rs:122-159 | crates/burn-cubecl/src/kernel/index/select_assign.rs:166-197 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 31 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (30 corresponding lines) · ×1
  • Edited copy of a member (30 corresponding lines) crates/burn-cubecl/src/kernel/index/flip.rs:63 — crates/burn-cubecl/src/kernel/index/flip.rs:63-98 | crates/burn-cubecl/src/kernel/index/slice.rs:101-130 — 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 copies of one member (3 members, 23+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 23+ corresponding lines) crates/burn-autodiff/src/ops/tensor.rs:4340 — crates/burn-autodiff/src/ops/tensor.rs:4340-4362 | crates/burn-autodiff/src/ops/tensor.rs:4384-4406 | crates/burn-autodiff/src/ops/tensor.rs:4674-4696 — 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 (6 members, 18+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 18+ corresponding lines) crates/burn-dispatch/src/device.rs:541 — crates/burn-dispatch/src/device.rs:541-558 | crates/burn-dispatch/src/device.rs:621-638 | crates/burn-dispatch/src/device.rs:664-683 | crates/burn-dispatch/src/tensor.rs:290-307 | crates/burn-dispatch/src/tensor.rs:309-326 | crates/burn-dispatch/src/tensor.rs:349-366 — These 6 members are one piece of code written 6 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 6 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) crates/burn-flex/src/ops/reduce.rs:76 — crates/burn-flex/src/ops/reduce.rs:76-101 | crates/burn-flex/src/ops/reduce.rs:148-166 | crates/burn-flex/src/ops/reduce.rs:368-388 | crates/burn-flex/src/ops/reduce.rs:573-594 | crates/burn-flex/src/ops/reduce.rs:609-630 — 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 (4 members, 41+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 41+ corresponding lines) crates/burn-flex/src/ops/module.rs:318 — crates/burn-flex/src/ops/module.rs:318-358 | crates/burn-flex/src/ops/module.rs:369-409 | crates/burn-flex/src/ops/module.rs:419-459 | crates/burn-flex/src/ops/module.rs:470-510 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 41 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or 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, 21+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 21+ corresponding lines) crates/burn-autodiff/src/ops/module.rs:2469 — crates/burn-autodiff/src/ops/module.rs:2469-2489 | crates/burn-autodiff/src/ops/module.rs:2511-2531 | crates/burn-autodiff/src/ops/module.rs:2553-2573 — 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 (6 members, 16+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 16+ corresponding lines) crates/burn-flex/src/simd/portable.rs:1813 — crates/burn-flex/src/simd/portable.rs:1813-1829 | crates/burn-flex/src/simd/portable.rs:1833-1849 | crates/burn-flex/src/simd/portable.rs:1853-1869 | crates/burn-flex/src/simd/portable.rs:1889-1904 | crates/burn-flex/src/simd/portable.rs:1908-1923 | crates/burn-flex/src/simd/portable.rs:1927-1942 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 18+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 18+ corresponding lines) crates/burn-store/src/burnpack.rs:92 — crates/burn-store/src/burnpack.rs:92-109 | crates/burn-store/src/burnpack.rs:112-129 | crates/burn-store/src/burnpack.rs:143-168 — 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, 18+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 18+ corresponding lines) crates/burn-derive/src/module/codegen_struct.rs:77 — crates/burn-derive/src/module/codegen_struct.rs:77-94 | crates/burn-derive/src/module/codegen_struct.rs:96-113 | crates/burn-derive/src/module/codegen_struct.rs:139-156 | crates/burn-derive/src/module/codegen_struct.rs:158-175 | crates/burn-derive/src/module/codegen_struct.rs:177-194 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 24+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 24+ corresponding lines) crates/burn-ir/src/builder.rs:1625 — crates/burn-ir/src/builder.rs:1625-1648 | crates/burn-ir/src/builder.rs:1722-1745 | crates/burn-ir/src/builder.rs:1759-1782 — 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 copies of one member (4 members, 8+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 8+ corresponding lines) crates/burn-flex/src/ops/attention.rs:203 — crates/burn-flex/src/ops/attention.rs:203-213 | crates/burn-flex/src/ops/attention.rs:218-228 | crates/burn-flex/src/ops/module.rs:24-31 | crates/burn-flex/src/ops/module.rs:37-44 — 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 (6 members, 15+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 15+ corresponding lines) crates/burn-backend/src/backend/ops/modules/conv.rs:408 — crates/burn-backend/src/backend/ops/modules/conv.rs:408-422 | crates/burn-backend/src/backend/ops/modules/conv.rs:521-535 | crates/burn-backend/src/backend/ops/modules/conv.rs:620-634 | crates/burn-backend/src/backend/ops/modules/conv.rs:708-722 | crates/burn-backend/src/backend/ops/modules/conv.rs:791-805 | crates/burn-backend/src/backend/ops/modules/conv.rs:878-892 — These 6 members are one piece of code written 6 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 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (7 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 11+ corresponding lines) crates/burn-linalg/src/functions/vector_norm.rs:127 — crates/burn-linalg/src/functions/vector_norm.rs:127-137 | crates/burn-linalg/src/functions/vector_norm.rs:197-207 | crates/burn-linalg/src/functions/vector_norm.rs:289-299 | crates/burn-linalg/src/functions/vector_norm.rs:348-358 | crates/burn-linalg/src/functions/vector_norm.rs:402-412 | crates/burn-linalg/src/functions/vector_norm.rs:472-482 | crates/burn-linalg/src/functions/vector_norm.rs:527-537 — These 7 members are one piece of code written 7 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 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 14+ corresponding lines) crates/burn-fusion/src/server.rs:76 — crates/burn-fusion/src/server.rs:76-89 | crates/burn-fusion/src/server.rs:98-111 | crates/burn-fusion/src/server.rs:120-133 | crates/burn-fusion/src/server.rs:142-155 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 19+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 19+ corresponding lines) crates/burn-store/src/safetensors/store.rs:127 — crates/burn-store/src/safetensors/store.rs:127-145 | crates/burn-store/src/safetensors/store.rs:148-167 | crates/burn-store/src/safetensors/store.rs:606-624 — 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 (5 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 14+ corresponding lines) crates/burn-tensor/src/tensor/module.rs:163 — crates/burn-tensor/src/tensor/module.rs:163-179 | crates/burn-tensor/src/tensor/module.rs:191-207 | crates/burn-tensor/src/tensor/module.rs:288-301 | crates/burn-tensor/src/tensor/module.rs:309-322 | crates/burn-tensor/src/tensor/module.rs:330-343 — 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 (6 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 9+ corresponding lines) crates/burn-flex/src/ops/conv_common.rs:66 — crates/burn-flex/src/ops/conv_common.rs:66-75 | crates/burn-flex/src/ops/conv_common.rs:77-85 | crates/burn-flex/src/ops/interpolate.rs:1219-1228 | crates/burn-flex/src/ops/interpolate.rs:1230-1239 | crates/burn-flex/src/ops/pool.rs:1776-1785 | crates/burn-flex/src/ops/pool.rs:1787-1795 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 16+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 16+ corresponding lines) crates/burn-store/src/applier.rs:344 — crates/burn-store/src/applier.rs:344-362 | crates/burn-store/src/applier.rs:364-379 | crates/burn-store/src/applier.rs:384-399 — 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 (8 members, 7+ corresponding lines) · ×1
  • Edited copies of one member (8 members, 7+ corresponding lines) crates/burn-backend/src/backend/ops/int_tensor.rs:1298 — crates/burn-backend/src/backend/ops/int_tensor.rs:1298-1304 | crates/burn-backend/src/backend/ops/int_tensor.rs:1318-1324 | crates/burn-backend/src/backend/ops/int_tensor.rs:1337-1344 | crates/burn-backend/src/backend/ops/int_tensor.rs:1359-1366 | crates/burn-backend/src/backend/ops/tensor.rs:1734-1740 | crates/burn-backend/src/backend/ops/tensor.rs:1755-1761 | crates/burn-backend/src/backend/ops/tensor.rs:1774-1781 | crates/burn-backend/src/backend/ops/tensor.rs:1796-1803 — These 8 members are one piece of code written 8 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 8 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) crates/burn-tensor/src/tensor/api/base.rs:177 — crates/burn-tensor/src/tensor/api/base.rs:177-183 | crates/burn-tensor/src/tensor/api/base.rs:231-237 | crates/burn-tensor/src/tensor/api/base.rs:275-281 | crates/burn-tensor/src/tensor/api/base.rs:323-334 — 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 (6 members, 7+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 7+ corresponding lines) crates/burn-vision/src/ops/base.rs:249 — crates/burn-vision/src/ops/base.rs:249-255 | crates/burn-vision/src/ops/base.rs:263-269 | crates/burn-vision/src/ops/base.rs:296-302 | crates/burn-vision/src/ops/base.rs:310-316 | crates/burn-vision/src/ops/base.rs:343-349 | crates/burn-vision/src/ops/base.rs:357-363 — 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 (7 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 9+ corresponding lines) crates/burn-cubecl/src/ops/collective.rs:34 — crates/burn-cubecl/src/ops/collective.rs:34-44 | crates/burn-cubecl/src/ops/collective.rs:46-54 | crates/burn-cubecl/src/ops/collective.rs:60-68 | crates/burn-cubecl/src/ops/collective.rs:87-97 | crates/burn-cubecl/src/ops/collective.rs:99-107 | crates/burn-cubecl/src/ops/collective.rs:113-121 | crates/burn-cubecl/src/ops/collective.rs:137-145 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 6+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 6+ corresponding lines) crates/burn-backend/src/backend/ops/bool_tensor.rs:525 — crates/burn-backend/src/backend/ops/bool_tensor.rs:525-530 | crates/burn-backend/src/backend/ops/bool_tensor.rs:544-549 | crates/burn-backend/src/backend/ops/bool_tensor.rs:561-567 | crates/burn-backend/src/backend/ops/bool_tensor.rs:581-587 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (7 members, 8+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 8+ corresponding lines) crates/burn-store/src/safetensors/store.rs:195 — crates/burn-store/src/safetensors/store.rs:195-202 | crates/burn-store/src/safetensors/store.rs:214-221 | crates/burn-store/src/safetensors/store.rs:232-239 | crates/burn-store/src/safetensors/store.rs:246-253 | crates/burn-store/src/safetensors/store.rs:265-272 | crates/burn-store/src/safetensors/store.rs:278-285 | crates/burn-store/src/safetensors/store.rs:288-295 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 15+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 15+ corresponding lines) crates/burn-derive/src/module/codegen_enum.rs:91 — crates/burn-derive/src/module/codegen_enum.rs:91-105 | crates/burn-derive/src/module/codegen_enum.rs:107-121 | crates/burn-derive/src/module/codegen_enum.rs:167-181 | crates/burn-derive/src/module/codegen_enum.rs:183-197 | crates/burn-derive/src/module/codegen_enum.rs:199-213 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 5+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 5+ corresponding lines) crates/burn-shard/src/backend/tensor.rs:419 — crates/burn-shard/src/backend/tensor.rs:419-423 | crates/burn-shard/src/backend/tensor.rs:428-432 | crates/burn-shard/src/backend/tensor.rs:437-441 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (7 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 10+ corresponding lines) crates/burn-tensor/src/bridge/ops/float.rs:134 — crates/burn-tensor/src/bridge/ops/float.rs:134-145 | crates/burn-tensor/src/bridge/ops/float.rs:203-214 | crates/burn-tensor/src/bridge/ops/float.rs:259-270 | crates/burn-tensor/src/bridge/ops/float.rs:295-304 | crates/burn-tensor/src/bridge/ops/float.rs:861-873 | crates/burn-tensor/src/bridge/ops/float.rs:875-887 | crates/burn-tensor/src/bridge/ops/float.rs:889-901 — These 7 members are one piece of code written 7 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 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 8+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 8+ corresponding lines) crates/burn-nn/src/modules/pool/avg_pool2d.rs:71 — crates/burn-nn/src/modules/pool/avg_pool2d.rs:71-79 | crates/burn-nn/src/modules/pool/avg_pool3d.rs:67-75 | crates/burn-nn/src/modules/pool/lp_pool2d.rs:49-56 | crates/burn-nn/src/modules/pool/max_pool2d.rs:63-71 | crates/burn-nn/src/modules/pool/max_pool3d.rs:65-73 | crates/burn-nn/src/modules/unfold.rs:49-56 — These 6 members are one piece of code written 6 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 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (7 members, 6+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 6+ corresponding lines) crates/burn-flex/src/ops/int.rs:715 — crates/burn-flex/src/ops/int.rs:715-722 | crates/burn-flex/src/ops/int.rs:728-735 | crates/burn-flex/src/ops/int.rs:741-748 | crates/burn-flex/src/ops/int.rs:759-764 | crates/burn-flex/src/ops/int.rs:966-971 | crates/burn-flex/src/ops/int.rs:977-982 | crates/burn-flex/src/ops/int.rs:988-993 — These 7 members are one piece of code written 7 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 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 8+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 8+ corresponding lines) crates/burn-remote/src/client/service/conn.rs:229 — crates/burn-remote/src/client/service/conn.rs:229-236 | crates/burn-remote/src/client/service/conn.rs:238-245 | crates/burn-remote/src/client/service/conn.rs:257-264 | crates/burn-remote/src/client/service/conn.rs:266-273 | crates/burn-remote/src/server/transport.rs:64-71 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (3 corresponding lines) · ×1
  • Edited copy of a member (3 corresponding lines) crates/burn-train/src/metric/vision/lpips/alexnet.rs:99 — crates/burn-train/src/metric/vision/lpips/alexnet.rs:99-101 | crates/burn-train/src/metric/vision/lpips/squeezenet.rs:156-163 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 4+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 4+ corresponding lines) crates/burn-tensor/src/tensor/api/base.rs:2569 — crates/burn-tensor/src/tensor/api/base.rs:2569-2572 | crates/burn-tensor/src/tensor/api/float.rs:802-805 | crates/burn-tensor/src/tensor/api/orderable.rs:514-517 — 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 (61–62 lines × 2) · ×1
  • Duplicated block (61–62 lines × 2) crates/burn-flex/src/ops/conv.rs:385 — crates/burn-flex/src/ops/conv.rs:385-446 | crates/burn-flex/src/ops/conv.rs:467-527 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/conv.rs:385` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (53–54 lines × 2) · ×1
  • Duplicated block (53–54 lines × 2) crates/burn-train/src/learner/rl/env_runner/async_runner.rs:234 — crates/burn-train/src/learner/rl/env_runner/async_runner.rs:234-287 | crates/burn-train/src/learner/rl/env_runner/async_runner.rs:466-518 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/burn-train/src/learner/rl/env_runner/async_runner.rs:289` calls `push` and `crates/burn-train/src/learner/rl/env_runner/async_runner.rs:520` 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 (48–49 lines × 2) · ×1
  • Duplicated block (48–49 lines × 2) crates/burn-flex/src/ops/deform_conv.rs:202 — crates/burn-flex/src/ops/deform_conv.rs:202-250 | crates/burn-flex/src/ops/deform_conv.rs:284-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 `crates/burn-flex/src/ops/deform_conv.rs:202` it does not close everything it opens, so those exact lines cannot be lifted 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–46 lines × 2) · ×1
  • Duplicated block (42–46 lines × 2) crates/burn-cubecl/src/kernel/ctc.rs:240 — crates/burn-cubecl/src/kernel/ctc.rs:240-285 | crates/burn-cubecl/src/kernel/ctc.rs:466-507 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/ctc.rs:240` it begins part-way through the construct above it, so those exact lines cannot be lifted 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) · ×1
  • Duplicated block (40 lines × 2) crates/burn-cubecl/src/kernel/binary.rs:258 — crates/burn-cubecl/src/kernel/binary.rs:258-297 | crates/burn-cubecl/src/kernel/binary_float.rs:178-217 — before extracting anything, compare `crates/burn-cubecl/src/kernel/binary.rs` and `crates/burn-cubecl/src/kernel/binary_float.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 105 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/binary.rs:258` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted 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–39 lines × 2) · ×1
  • Duplicated block (38–39 lines × 2) crates/burn-backend/src/backend/ops/modules/conv.rs:1221 — crates/burn-backend/src/backend/ops/modules/conv.rs:1221-1259 | crates/burn-backend/src/backend/ops/modules/conv.rs:1515-1552 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-backend/src/backend/ops/modules/conv.rs:1221` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (64–65 lines × 2) · ×1
  • Duplicated block (64–65 lines × 2) crates/burn-flex/src/ops/attention.rs:297 — crates/burn-flex/src/ops/attention.rs:297-361 | crates/burn-flex/src/ops/attention.rs:806-869 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/attention.rs:297` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (37 lines × 2) · ×1
  • Duplicated block (37 lines × 2) crates/burn-autodiff/src/ops/tensor.rs:3036 — crates/burn-autodiff/src/ops/tensor.rs:3036-3072 | crates/burn-autodiff/src/ops/tensor.rs:3103-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 `crates/burn-autodiff/src/ops/tensor.rs:3036` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted 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) crates/burn-cubecl/src/kernel/ctc.rs:205 — crates/burn-cubecl/src/kernel/ctc.rs:205-239 | crates/burn-cubecl/src/kernel/ctc.rs:431-464 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/ctc.rs:205` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (33 lines × 2) · ×1
  • Duplicated block (33 lines × 2) crates/burn-cubecl-fusion/src/engine/trace/block.rs:260 — crates/burn-cubecl-fusion/src/engine/trace/block.rs:260-292 | crates/burn-cubecl-fusion/src/engine/trace/block.rs:330-362 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (29–32 lines × 2) · ×1
  • Duplicated block (29–32 lines × 2) crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:296 — crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:296-324 | crates/burn-cubecl/src/kernel/pool/max_pool3d.rs:253-284 — before extracting anything, compare `crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs` and `crates/burn-cubecl/src/kernel/pool/max_pool3d.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/pool/max_pool3d.rs:253` it does not close everything it opens, so those 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 (31–32 lines × 2) · ×1
  • Duplicated block (31–32 lines × 2) crates/burn-flex/src/ops/reduce.rs:859 — crates/burn-flex/src/ops/reduce.rs:859-890 | crates/burn-flex/src/ops/reduce.rs:1204-1234 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/reduce.rs:859` it does not close everything it opens, so those 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 (32 lines × 2) · ×1
  • Duplicated block (32 lines × 2) crates/burn-tensor/src/tensor/api/check.rs:1010 — crates/burn-tensor/src/tensor/api/check.rs:1010-1041 | crates/burn-tensor/src/tensor/api/check.rs:1082-1113 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-tensor/src/tensor/api/check.rs:1010` it does not close everything it opens, so those exact lines cannot be lifted 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–31 lines × 2) · ×1
  • Duplicated block (28–31 lines × 2) crates/burn-flex/src/ops/fft.rs:457 — crates/burn-flex/src/ops/fft.rs:457-487 | crates/burn-flex/src/ops/fft.rs:520-547 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/fft.rs:457` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (29 lines × 2) · ×1
  • Duplicated block (29 lines × 2) crates/burn-cubecl-fusion/src/optim/reduce/fuser.rs:225 — crates/burn-cubecl-fusion/src/optim/reduce/fuser.rs:225-253 | crates/burn-cubecl-fusion/src/optim/reduce/fuser.rs:255-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.
D4 · Code Duplication · Duplicated block (30 lines × 2) · ×1
  • Duplicated block (30 lines × 2) crates/burn-cubecl/src/kernel/binary.rs:227 — crates/burn-cubecl/src/kernel/binary.rs:227-256 | crates/burn-cubecl/src/kernel/binary_float.rs:147-176 — before extracting anything, compare `crates/burn-cubecl/src/kernel/binary.rs` and `crates/burn-cubecl/src/kernel/binary_float.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 105 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/binary.rs:227` it does not close everything it opens, so those exact lines cannot be lifted 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–29 lines × 2) · ×1
  • Duplicated block (27–29 lines × 2) crates/burn-flex/src/ops/deform_conv.rs:81 — crates/burn-flex/src/ops/deform_conv.rs:81-107 | crates/burn-flex/src/ops/deform_conv.rs:872-900 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/deform_conv.rs:81` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×1
  • Duplicated block (28 lines × 2) crates/burn-backend/src/backend/ops/modules/conv.rs:1151 — crates/burn-backend/src/backend/ops/modules/conv.rs:1151-1178 | crates/burn-backend/src/backend/ops/modules/conv.rs:1445-1472 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-backend/src/backend/ops/modules/conv.rs:1151` it begins part-way through the construct above it, so those exact lines cannot be lifted 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 × 4) · ×1
  • Duplicated block (26–27 lines × 4) crates/burn-flex/src/ops/conv.rs:403 — crates/burn-flex/src/ops/conv.rs:403-429 | crates/burn-flex/src/ops/conv.rs:484-510 | crates/burn-flex/src/ops/deform_conv.rs:211-237 | crates/burn-flex/src/ops/deform_conv.rs:293-318 — before extracting anything, compare `crates/burn-flex/src/ops/conv.rs` and `crates/burn-flex/src/ops/deform_conv.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/conv.rs:403` it begins part-way through the construct above it, so those exact lines cannot be lifted 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) crates/burn-flex/src/ops/gather_scatter.rs:545 — crates/burn-flex/src/ops/gather_scatter.rs:545-571 | crates/burn-flex/src/ops/gather_scatter.rs:584-609 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/gather_scatter.rs:545` it begins part-way through the construct above it, so those exact lines cannot be lifted 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–27 lines × 2) · ×1
  • Duplicated block (24–27 lines × 2) crates/burn-nn/src/modules/transformer/decoder.rs:269 — crates/burn-nn/src/modules/transformer/decoder.rs:269-295 | crates/burn-nn/src/modules/transformer/encoder.rs:275-298 — before extracting anything, compare `crates/burn-nn/src/modules/transformer/decoder.rs` and `crates/burn-nn/src/modules/transformer/encoder.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-nn/src/modules/transformer/decoder.rs:269` it does not close everything it opens, so those 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 `config` to `&TransformerDecoderConfig` in one and `&TransformerEncoderConfig` 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 (16–26 lines × 2) · ×1
  • Duplicated block (16–26 lines × 2) crates/burn-backend/src/backend/ops/modules/conv.rs:470 — crates/burn-backend/src/backend/ops/modules/conv.rs:470-485 | crates/burn-backend/src/backend/ops/modules/conv.rs:573-598 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-backend/src/backend/ops/modules/conv.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.
D4 · Code Duplication · Duplicated block (21–25 lines × 3) · ×1
  • Duplicated block (21–25 lines × 3) crates/burn-cubecl/src/kernel/pool/base.rs:26 — crates/burn-cubecl/src/kernel/pool/base.rs:26-47 | crates/burn-cubecl/src/kernel/pool/base.rs:79-103 | crates/burn-cubecl/src/kernel/pool/base.rs:188-208 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/pool/base.rs:79` it does not close everything it opens, so those 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 (31 lines × 2) · ×1
  • Duplicated block (31 lines × 2) crates/burn-flex/src/ops/mask.rs:272 — crates/burn-flex/src/ops/mask.rs:272-302 | crates/burn-flex/src/ops/mask.rs:323-353 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/mask.rs:272` it begins part-way through the construct above it, so those 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 (24–25 lines × 2) · ×1
  • Duplicated block (24–25 lines × 2) crates/burn-nn/src/modules/rnn/basic.rs:366 — crates/burn-nn/src/modules/rnn/basic.rs:366-389 | crates/burn-nn/src/modules/rnn/gru.rs:417-441 — before extracting anything, compare `crates/burn-nn/src/modules/rnn/basic.rs` and `crates/burn-nn/src/modules/rnn/gru.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-nn/src/modules/rnn/basic.rs:366` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (23–24 lines × 6) · ×1
  • Duplicated block (23–24 lines × 6) crates/burn-backend/src/backend/ops/modules/conv.rs:1072 — crates/burn-backend/src/backend/ops/modules/conv.rs:1072-1094 | crates/burn-backend/src/backend/ops/modules/conv.rs:1123-1145 | crates/burn-backend/src/backend/ops/modules/conv.rs:1192-1215 | crates/burn-backend/src/backend/ops/modules/conv.rs:1355-1377 | crates/burn-backend/src/backend/ops/modules/conv.rs:1417-1439 | crates/burn-backend/src/backend/ops/modules/conv.rs:1486-1509 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-backend/src/backend/ops/modules/conv.rs:1072` it does not close everything it opens, so those exact lines cannot be lifted 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–24 lines × 2) · ×1
  • Duplicated block (22–24 lines × 2) crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:769 — crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:769-792 | crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:818-839 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:769` it does not close everything it opens, so those 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 (24 lines × 2) · ×1
  • Duplicated block (24 lines × 2) crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:71 — crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:71-94 | crates/burn-cubecl/src/kernel/pool/max_pool3d.rs:74-97 — before extracting anything, compare `crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs` and `crates/burn-cubecl/src/kernel/pool/max_pool3d.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:71` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (23 lines × 3) · ×1
  • Duplicated block (23 lines × 3) crates/burn-autodiff/src/ops/tensor.rs:1389 — crates/burn-autodiff/src/ops/tensor.rs:1389-1411 | crates/burn-autodiff/src/ops/tensor.rs:1694-1716 | crates/burn-autodiff/src/ops/tensor.rs:2224-2246 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×1
  • Duplicated block (23 lines × 2) crates/burn-cubecl/src/kernel/ctc.rs:186 — crates/burn-cubecl/src/kernel/ctc.rs:186-208 | crates/burn-cubecl/src/kernel/ctc.rs:406-428 — both copies are in the same file, so extract the 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–23 lines × 2) · ×1
  • Duplicated block (20–23 lines × 2) crates/burn-cubecl/src/kernel/ctc.rs:287 — crates/burn-cubecl/src/kernel/ctc.rs:287-309 | crates/burn-cubecl/src/kernel/ctc.rs:510-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 `crates/burn-cubecl/src/kernel/ctc.rs:287` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (22–23 lines × 2) · ×1
  • Duplicated block (22–23 lines × 2) crates/burn-flex/src/ops/conv.rs:1438 — crates/burn-flex/src/ops/conv.rs:1438-1459 | crates/burn-flex/src/ops/conv.rs:1664-1686 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/conv.rs:1438` it does not close everything it opens, so those exact lines cannot be lifted 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 × 4) · ×1
  • Duplicated block (20–21 lines × 4) crates/burn-cubecl-fusion/src/engine/launch/vectorization/base.rs:254 — crates/burn-cubecl-fusion/src/engine/launch/vectorization/base.rs:254-274 | crates/burn-cubecl-fusion/src/engine/launch/vectorization/base.rs:292-311 | crates/burn-cubecl-fusion/src/engine/launch/vectorization/base.rs:361-381 | crates/burn-cubecl-fusion/src/engine/launch/vectorization/base.rs:454-474 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl-fusion/src/engine/launch/vectorization/base.rs:254` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21 lines × 3) · ×1
  • Duplicated block (21 lines × 3) crates/burn-autodiff/src/ops/module.rs:1729 — crates/burn-autodiff/src/ops/module.rs:1729-1749 | crates/burn-autodiff/src/ops/module.rs:1859-1879 | crates/burn-autodiff/src/ops/module.rs:1980-2000 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/module.rs:1729` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted 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 × 2) · ×1
  • Duplicated block (19–21 lines × 2) crates/burn-cubecl/src/kernel/index/gather_nd.rs:33 — crates/burn-cubecl/src/kernel/index/gather_nd.rs:33-51 | crates/burn-cubecl/src/kernel/index/scatter_nd.rs:33-53 — before extracting anything, compare `crates/burn-cubecl/src/kernel/index/gather_nd.rs` and `crates/burn-cubecl/src/kernel/index/scatter_nd.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 (13–21 lines × 2) · ×1
  • Duplicated block (13–21 lines × 2) crates/burn-flex/src/ops/fft.rs:695 — crates/burn-flex/src/ops/fft.rs:695-715 | crates/burn-flex/src/ops/fft.rs:995-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 `crates/burn-flex/src/ops/fft.rs:695` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (1–21 lines × 8) · ×1
  • Duplicated block (1–21 lines × 8) crates/burn-flex/src/simd/kernels.rs:95 — crates/burn-flex/src/simd/kernels.rs:95-115 | crates/burn-flex/src/simd/kernels.rs:138-156 | crates/burn-flex/src/simd/portable.rs:87-87 | crates/burn-flex/src/simd/portable.rs:93-93 | crates/burn-flex/src/simd/portable.rs:99-99 | crates/burn-flex/src/simd/portable.rs:105-105 | crates/burn-flex/src/simd/portable.rs:116-116 | crates/burn-flex/src/simd/portable.rs:122-122 — there are 8 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 8 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/simd/kernels.rs:95` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those 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 (28–32 lines × 4) · ×1
  • Duplicated block (28–32 lines × 4) crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:39 — crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:39-66 | crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:170-201 | crates/burn-cubecl/src/kernel/pool/max_pool3d.rs:40-67 | crates/burn-cubecl/src/kernel/pool/max_pool3d.rs:144-174 — before extracting anything, compare `crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs` and `crates/burn-cubecl/src/kernel/pool/max_pool3d.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (18–19 lines × 2) · ×1
  • Duplicated block (18–19 lines × 2) crates/burn-flex/src/ops/conv.rs:923 — crates/burn-flex/src/ops/conv.rs:923-940 | crates/burn-flex/src/ops/conv.rs:958-976 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/conv.rs:923` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted 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) crates/burn-flex/src/ops/deform_conv.rs:321 — crates/burn-flex/src/ops/deform_conv.rs:321-339 | crates/burn-flex/src/ops/deform_conv.rs:908-924 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/deform_conv.rs:321` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (18 lines × 3) · ×1
  • Duplicated block (18 lines × 3) crates/burn-flex/src/ops/mask.rs:115 — crates/burn-flex/src/ops/mask.rs:115-132 | crates/burn-flex/src/ops/mask.rs:149-166 | crates/burn-flex/src/ops/mask.rs:193-210 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/mask.rs:115` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those 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 `value` to `f32` in one and `f64` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (15–18 lines × 2) · ×1
  • Duplicated block (15–18 lines × 2) crates/burn-train/src/metric/cer.rs:96 — crates/burn-train/src/metric/cer.rs:96-110 | crates/burn-train/src/metric/wer.rs:74-91 — before extracting anything, compare `crates/burn-train/src/metric/cer.rs` and `crates/burn-train/src/metric/wer.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-train/src/metric/cer.rs:96` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17 lines × 4) · ×1
  • Duplicated block (17 lines × 4) crates/burn-fusion/src/client.rs:351 — crates/burn-fusion/src/client.rs:351-367 | crates/burn-fusion/src/client.rs:396-412 | crates/burn-fusion/src/client.rs:442-458 | crates/burn-fusion/src/client.rs:487-503 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-fusion/src/client.rs:351` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16–17 lines × 3) · ×1
  • Duplicated block (16–17 lines × 3) crates/burn-cubecl/src/kernel/ctc.rs:270 — crates/burn-cubecl/src/kernel/ctc.rs:270-286 | crates/burn-cubecl/src/kernel/ctc.rs:493-508 | crates/burn-cubecl/src/kernel/ctc.rs:582-597 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/ctc.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.
D4 · Code Duplication · Duplicated block (14–17 lines × 2) · ×1
  • Duplicated block (14–17 lines × 2) crates/burn-flex/src/ops/conv.rs:971 — crates/burn-flex/src/ops/conv.rs:971-987 | crates/burn-flex/src/ops/conv.rs:1955-1968 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/conv.rs:971` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside 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 (16 lines × 7) · ×1
  • Duplicated block (16 lines × 7) crates/burn-flex/src/ops/interpolate.rs:251 — crates/burn-flex/src/ops/interpolate.rs:251-266 | crates/burn-flex/src/ops/interpolate.rs:394-409 | crates/burn-flex/src/ops/interpolate.rs:576-591 | crates/burn-flex/src/ops/interpolate.rs:795-810 | crates/burn-flex/src/ops/interpolate.rs:919-934 | crates/burn-flex/src/ops/interpolate.rs:1030-1045 | crates/burn-flex/src/ops/interpolate.rs:1135-1150 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (16 lines × 5) · ×1
  • Duplicated block (16 lines × 5) crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:298 — crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:298-313 | crates/burn-cubecl/src/kernel/pool/base.rs:28-43 | crates/burn-cubecl/src/kernel/pool/base.rs:81-96 | crates/burn-cubecl/src/kernel/pool/base.rs:189-204 | crates/burn-cubecl/src/kernel/pool/max_pool3d.rs:255-270 — before extracting anything, compare `crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs` and `crates/burn-cubecl/src/kernel/pool/max_pool3d.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (14–16 lines × 4) · ×1
  • Duplicated block (14–16 lines × 4) crates/burn-autodiff/src/ops/tensor.rs:1220 — crates/burn-autodiff/src/ops/tensor.rs:1220-1233 | crates/burn-autodiff/src/ops/tensor.rs:1290-1305 | crates/burn-autodiff/src/ops/tensor.rs:1992-2005 | crates/burn-autodiff/src/ops/tensor.rs:2460-2473 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/tensor.rs:1220` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/burn-autodiff/src/ops/tensor.rs:1235` calls `float_zeros`, `dtype`, `into` and `crates/burn-autodiff/src/ops/tensor.rs:1306` 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 (14–16 lines × 3) · ×1
  • Duplicated block (14–16 lines × 3) crates/burn-autodiff/src/ops/tensor.rs:1530 — crates/burn-autodiff/src/ops/tensor.rs:1530-1545 | crates/burn-autodiff/src/ops/tensor.rs:1596-1609 | crates/burn-autodiff/src/ops/tensor.rs:2400-2413 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/tensor.rs:1530` it does not close everything it opens, so those 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–16 lines × 2) · ×1
  • Duplicated block (12–16 lines × 2) crates/burn-communication/src/websocket/client.rs:75 — crates/burn-communication/src/websocket/client.rs:75-90 | crates/burn-communication/src/websocket/client.rs:158-169 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-communication/src/websocket/client.rs:75` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted 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 × 2) · ×1
  • Duplicated block (14–16 lines × 2) crates/burn-flex/src/ops/reduce.rs:1227 — crates/burn-flex/src/ops/reduce.rs:1227-1242 | crates/burn-flex/src/ops/reduce.rs:1311-1324 — both copies are in the same file, so extract the 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 (15 lines × 6) · ×1
  • Duplicated block (15 lines × 6) crates/burn-autodiff/src/ops/module.rs:347 — crates/burn-autodiff/src/ops/module.rs:347-361 | crates/burn-autodiff/src/ops/module.rs:474-488 | crates/burn-autodiff/src/ops/module.rs:606-620 | crates/burn-autodiff/src/ops/module.rs:1062-1076 | crates/burn-autodiff/src/ops/module.rs:1196-1210 | crates/burn-autodiff/src/ops/module.rs:1325-1339 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/module.rs:347` it does not close everything it opens, so those exact lines cannot be lifted 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 × 4) · ×1
  • Duplicated block (14–15 lines × 4) crates/burn-backend/src/backend/ops/modules/conv.rs:1157 — crates/burn-backend/src/backend/ops/modules/conv.rs:1157-1171 | crates/burn-backend/src/backend/ops/modules/conv.rs:1237-1251 | crates/burn-backend/src/backend/ops/modules/conv.rs:1451-1465 | crates/burn-backend/src/backend/ops/modules/conv.rs:1531-1544 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-backend/src/backend/ops/modules/conv.rs:1157` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/burn-backend/src/backend/ops/modules/conv.rs:1252` calls `from` and `crates/burn-backend/src/backend/ops/modules/conv.rs:1172` 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–20 lines × 3) · ×1
  • Duplicated block (18–20 lines × 3) crates/burn-autodiff/src/ops/module.rs:709 — crates/burn-autodiff/src/ops/module.rs:709-728 | crates/burn-autodiff/src/ops/module.rs:750-767 | crates/burn-autodiff/src/ops/module.rs:786-803 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/module.rs:709` it does not close everything it opens, so those exact lines cannot be lifted 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) · ×1
  • Duplicated block (14–15 lines × 3) crates/burn-cubecl/src/kernel/binary.rs:282 — crates/burn-cubecl/src/kernel/binary.rs:282-295 | crates/burn-cubecl/src/kernel/binary_float.rs:202-215 | crates/burn-cubecl/src/kernel/binary_int.rs:231-245 — before extracting anything, compare `crates/burn-cubecl/src/kernel/binary.rs` and `crates/burn-cubecl/src/kernel/binary_float.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 105 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/binary.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 (13–15 lines × 3) · ×1
  • Duplicated block (13–15 lines × 3) crates/burn-flex/src/ops/pool.rs:1032 — crates/burn-flex/src/ops/pool.rs:1032-1046 | crates/burn-flex/src/ops/pool.rs:1080-1092 | crates/burn-flex/src/ops/pool.rs:1684-1696 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/pool.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.
D4 · Code Duplication · Duplicated block (12–15 lines × 2) · ×1
  • Duplicated block (12–15 lines × 2) crates/burn-optim/src/optim/adamw.rs:163 — crates/burn-optim/src/optim/adamw.rs:163-177 | crates/burn-optim/src/optim/lamb.rs:75-86 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-optim/src/optim/adamw.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.
D4 · Code Duplication · Duplicated block (14 lines × 4) · ×1
  • Duplicated block (14 lines × 4) crates/burn-autodiff/src/ops/tensor.rs:4046 — crates/burn-autodiff/src/ops/tensor.rs:4046-4059 | crates/burn-autodiff/src/ops/tensor.rs:4082-4095 | crates/burn-autodiff/src/ops/tensor.rs:4118-4131 | crates/burn-autodiff/src/ops/tensor.rs:4154-4167 — 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.
D4 · Code Duplication · Duplicated block (12–14 lines × 3) · ×1
  • Duplicated block (12–14 lines × 3) crates/burn-flex/src/ops/fft.rs:855 — crates/burn-flex/src/ops/fft.rs:855-867 | crates/burn-flex/src/ops/fft.rs:1052-1063 | crates/burn-flex/src/ops/fft.rs:1435-1448 — all 3 copies are in the same file, so extract the block into one function there and call 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 (13–14 lines × 3) · ×1
  • Duplicated block (13–14 lines × 3) crates/burn-nn/src/modules/conv/conv1d.rs:87 — crates/burn-nn/src/modules/conv/conv1d.rs:87-100 | crates/burn-nn/src/modules/conv/conv2d.rs:129-141 | crates/burn-nn/src/modules/conv/conv3d.rs:135-148 — before extracting anything, compare `crates/burn-nn/src/modules/conv/conv2d.rs` and `crates/burn-nn/src/modules/conv/conv3d.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-nn/src/modules/conv/conv1d.rs:87` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted 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) · ×1
  • Duplicated block (12–14 lines × 2) crates/burn-flex/src/ops/attention.rs:597 — crates/burn-flex/src/ops/attention.rs:597-610 | crates/burn-flex/src/ops/attention.rs:968-979 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/attention.rs:597` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (11–14 lines × 2) · ×1
  • Duplicated block (11–14 lines × 2) crates/burn-flex/src/ops/conv.rs:1481 — crates/burn-flex/src/ops/conv.rs:1481-1491 | crates/burn-flex/src/ops/conv.rs:1711-1724 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/conv.rs:1481` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (12–13 lines × 8) · ×1
  • Duplicated block (12–13 lines × 8) crates/burn-flex/src/ops/interpolate.rs:1093 — crates/burn-flex/src/ops/interpolate.rs:1093-1105 | crates/burn-flex/src/ops/interpolate.rs:1190-1202 | crates/burn-flex/src/ops/matmul.rs:729-741 | crates/burn-flex/src/ops/matmul.rs:800-811 | crates/burn-flex/src/ops/matmul.rs:878-889 | crates/burn-flex/src/ops/pool.rs:1276-1287 | crates/burn-flex/src/ops/pool.rs:1568-1579 | crates/burn-flex/src/ops/pool.rs:1718-1729 — there are 8 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 8 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/interpolate.rs:1093` it begins part-way through the construct above it, so those exact lines cannot be lifted 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 × 5) · ×1
  • Duplicated block (12–13 lines × 5) crates/burn-backend/src/backend/ops/modules/conv.rs:1158 — crates/burn-backend/src/backend/ops/modules/conv.rs:1158-1170 | crates/burn-backend/src/backend/ops/modules/conv.rs:1238-1250 | crates/burn-backend/src/backend/ops/modules/conv.rs:1389-1401 | crates/burn-backend/src/backend/ops/modules/conv.rs:1452-1464 | crates/burn-backend/src/backend/ops/modules/conv.rs:1532-1543 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-backend/src/backend/ops/modules/conv.rs:1158` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/burn-backend/src/backend/ops/modules/conv.rs:1252` calls `from` and `crates/burn-backend/src/backend/ops/modules/conv.rs:1172` 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 (11–13 lines × 3) · ×1
  • Duplicated block (11–13 lines × 3) crates/burn-fusion/src/search/merging.rs:175 — crates/burn-fusion/src/search/merging.rs:175-185 | crates/burn-fusion/src/search/merging.rs:190-200 | crates/burn-fusion/src/search/merging.rs:205-217 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-fusion/src/search/merging.rs:175` it begins part-way through the construct above it, so those exact lines cannot be lifted 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) · ×1
  • Duplicated block (9–13 lines × 2) crates/burn-cubecl/src/kernel/conv/conv_transpose2d/col2im.rs:161 — crates/burn-cubecl/src/kernel/conv/conv_transpose2d/col2im.rs:161-169 | crates/burn-cubecl/src/kernel/conv/conv_transpose3d/col2im.rs:165-177 — `crates/burn-cubecl/src/kernel/conv/conv_transpose2d/col2im.rs` and `crates/burn-cubecl/src/kernel/conv/conv_transpose3d/col2im.rs` are one unit implemented 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 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 `crates/burn-cubecl/src/kernel/conv/conv_transpose2d/col2im.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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code 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–13 lines × 2) · ×1
  • Duplicated block (10–13 lines × 2) crates/burn-flex/src/ops/deform_conv.rs:639 — crates/burn-flex/src/ops/deform_conv.rs:639-651 | crates/burn-flex/src/ops/matmul.rs:465-474 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/deform_conv.rs:639` it does not close everything it opens, so those 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–13 lines × 3) · ×1
  • Duplicated block (2–13 lines × 3) crates/burn-flex/src/simd/portable.rs:285 — crates/burn-flex/src/simd/portable.rs:285-297 | crates/burn-flex/src/simd/portable.rs:425-434 | crates/burn-flex/src/simd/portable.rs:437-438 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/simd/portable.rs:285` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 5) · ×1
  • Duplicated block (12 lines × 5) crates/burn-flex/src/ops/gather_scatter.rs:720 — crates/burn-flex/src/ops/gather_scatter.rs:720-731 | crates/burn-flex/src/ops/gather_scatter.rs:738-749 | crates/burn-flex/src/ops/gather_scatter.rs:760-771 | crates/burn-flex/src/ops/gather_scatter.rs:1110-1121 | crates/burn-flex/src/ops/gather_scatter.rs:1156-1167 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×1
  • Duplicated block (12 lines × 4) crates/burn-autodiff/src/ops/module.rs:716 — crates/burn-autodiff/src/ops/module.rs:716-727 | crates/burn-autodiff/src/ops/module.rs:755-766 | crates/burn-autodiff/src/ops/module.rs:791-802 | crates/burn-autodiff/src/ops/module.rs:826-837 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/burn-autodiff/src/ops/module.rs:713` calls `Some`, `retrieve_node_output` and `crates/burn-autodiff/src/ops/module.rs:752` 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–12 lines × 3) · ×1
  • Duplicated block (10–12 lines × 3) crates/burn-cubecl/src/kernel/pool/base.rs:145 — crates/burn-cubecl/src/kernel/pool/base.rs:145-154 | crates/burn-cubecl/src/kernel/pool/base.rs:240-251 | crates/burn-cubecl/src/kernel/pool/base.rs:354-363 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-cubecl/src/kernel/pool/base.rs:240` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/burn-cubecl/src/kernel/pool/base.rs:144` calls `into_contiguous_aligned`, `permute_nchw_to_nhwc` and `crates/burn-cubecl/src/kernel/pool/base.rs:239` 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 (11 lines × 4) · ×1
  • Duplicated block (11 lines × 4) crates/burn-autodiff/src/ops/tensor.rs:245 — crates/burn-autodiff/src/ops/tensor.rs:245-255 | crates/burn-autodiff/src/ops/tensor.rs:314-324 | crates/burn-autodiff/src/ops/tensor.rs:601-611 | crates/burn-autodiff/src/ops/tensor.rs:692-702 — 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.
D4 · Code Duplication · Duplicated block (9–11 lines × 3) · ×1
  • Duplicated block (9–11 lines × 3) crates/burn-flex/src/ops/reduce.rs:1226 — crates/burn-flex/src/ops/reduce.rs:1226-1236 | crates/burn-flex/src/ops/reduce.rs:1310-1318 | crates/burn-flex/src/ops/reduce.rs:1379-1387 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/reduce.rs:1226` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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–11 lines × 3) · ×1
  • Duplicated block (10–11 lines × 3) crates/burn-flex/src/simd/portable.rs:1731 — crates/burn-flex/src/simd/portable.rs:1731-1740 | crates/burn-flex/src/simd/portable.rs:1776-1785 | crates/burn-flex/src/simd/portable.rs:2058-2068 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/simd/portable.rs:1731` it does not close everything it opens, so those 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 `a` to `&[u8]` in one and `&mut [u8]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (9–11 lines × 2) · ×1
  • Duplicated block (9–11 lines × 2) crates/burn-flex/src/ops/gather_scatter.rs:848 — crates/burn-flex/src/ops/gather_scatter.rs:848-858 | crates/burn-flex/src/ops/gather_scatter.rs:894-902 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/gather_scatter.rs:848` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 14) · ×1
  • Duplicated block (10 lines × 14) crates/burn-autodiff/src/ops/tensor.rs:856 — crates/burn-autodiff/src/ops/tensor.rs:856-865 | crates/burn-autodiff/src/ops/tensor.rs:3233-3242 | crates/burn-autodiff/src/ops/tensor.rs:3271-3280 | crates/burn-autodiff/src/ops/tensor.rs:3412-3421 | crates/burn-autodiff/src/ops/tensor.rs:3492-3501 | crates/burn-autodiff/src/ops/tensor.rs:3531-3540 | crates/burn-autodiff/src/ops/tensor.rs:3611-3620 | crates/burn-autodiff/src/ops/tensor.rs:3648-3657 | crates/burn-autodiff/src/ops/tensor.rs:3725-3734 | crates/burn-autodiff/src/ops/tensor.rs:3765-3774 | crates/burn-autodiff/src/ops/tensor.rs:3806-3815 | crates/burn-autodiff/src/ops/tensor.rs:3846-3855 | crates/burn-autodiff/src/ops/tensor.rs:3887-3896 | crates/burn-autodiff/src/ops/tensor.rs:3928-3937 — 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 `crates/burn-autodiff/src/ops/tensor.rs:856` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/burn-autodiff/src/ops/tensor.rs:3281` calls `float_add_scalar`, `into` and `crates/burn-autodiff/src/ops/tensor.rs:3243` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (8–10 lines × 8) · ×1
  • Duplicated block (8–10 lines × 8) crates/burn-autodiff/src/ops/module.rs:174 — crates/burn-autodiff/src/ops/module.rs:174-181 | crates/burn-autodiff/src/ops/module.rs:309-316 | crates/burn-autodiff/src/ops/module.rs:432-439 | crates/burn-autodiff/src/ops/module.rs:567-574 | crates/burn-autodiff/src/ops/module.rs:1020-1027 | crates/burn-autodiff/src/ops/module.rs:1157-1164 | crates/burn-autodiff/src/ops/module.rs:1283-1290 | crates/burn-autodiff/src/ops/module.rs:2300-2309 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/module.rs:174` it does not close everything it opens, so those exact lines cannot be lifted 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) · ×1
  • Duplicated block (10 lines × 5) crates/burn-autodiff/src/ops/tensor.rs:347 — crates/burn-autodiff/src/ops/tensor.rs:347-356 | crates/burn-autodiff/src/ops/tensor.rs:541-550 | crates/burn-autodiff/src/ops/tensor.rs:634-643 | crates/burn-autodiff/src/ops/tensor.rs:723-732 | crates/burn-autodiff/src/ops/tensor.rs:785-794 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/tensor.rs:347` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/burn-autodiff/src/ops/tensor.rs:358` calls `float_mul`, `unwrap` and `crates/burn-autodiff/src/ops/tensor.rs:554` 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–10 lines × 4) · ×1
  • Duplicated block (8–10 lines × 4) crates/burn-autodiff/src/ops/tensor.rs:1227 — crates/burn-autodiff/src/ops/tensor.rs:1227-1235 | crates/burn-autodiff/src/ops/tensor.rs:1537-1546 | crates/burn-autodiff/src/ops/tensor.rs:1999-2007 | crates/burn-autodiff/src/ops/tensor.rs:2407-2414 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/tensor.rs:1227` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (9–10 lines × 3) · ×1
  • Duplicated block (9–10 lines × 3) crates/burn-flex/src/ops/binary.rs:252 — crates/burn-flex/src/ops/binary.rs:252-261 | crates/burn-flex/src/ops/bool.rs:169-177 | crates/burn-flex/src/ops/comparison.rs:285-293 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/binary.rs:252` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (8–10 lines × 2) · ×1
  • Duplicated block (8–10 lines × 2) crates/burn-autodiff/src/ops/module.rs:38 — crates/burn-autodiff/src/ops/module.rs:38-47 | crates/burn-autodiff/src/ops/module.rs:812-819 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/module.rs:38` it begins part-way through the construct above it, so those exact lines cannot be lifted 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) crates/burn-flex/src/ops/reduce.rs:1882 — crates/burn-flex/src/ops/reduce.rs:1882-1891 | crates/burn-flex/src/ops/reduce.rs:1939-1944 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/reduce.rs:1882` it does not close everything it opens, so those exact lines cannot be lifted 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 × 12) · ×1
  • Duplicated block (8–9 lines × 12) crates/burn-autodiff/src/ops/module.rs:126 — crates/burn-autodiff/src/ops/module.rs:126-134 | crates/burn-autodiff/src/ops/tensor.rs:912-920 | crates/burn-autodiff/src/ops/tensor.rs:2741-2749 | crates/burn-autodiff/src/ops/tensor.rs:2780-2788 | crates/burn-autodiff/src/ops/tensor.rs:2851-2859 | crates/burn-autodiff/src/ops/tensor.rs:2885-2893 | crates/burn-autodiff/src/ops/tensor.rs:2922-2930 | crates/burn-autodiff/src/ops/tensor.rs:4048-4055 | crates/burn-autodiff/src/ops/tensor.rs:4084-4091 | crates/burn-autodiff/src/ops/tensor.rs:4120-4127 | crates/burn-autodiff/src/ops/tensor.rs:4156-4163 | crates/burn-autodiff/src/ops/tensor.rs:4730-4738 — there are 12 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 12 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/module.rs:126` it does not close everything it opens, so those exact lines cannot be lifted 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 × 8) · ×1
  • Duplicated block (8–9 lines × 8) crates/burn-flex/src/ops/conv.rs:252 — crates/burn-flex/src/ops/conv.rs:252-259 | crates/burn-flex/src/ops/conv.rs:1414-1422 | crates/burn-flex/src/ops/conv.rs:1639-1647 | crates/burn-flex/src/ops/conv.rs:1846-1854 | crates/burn-flex/src/ops/conv_transpose.rs:262-269 | crates/burn-flex/src/ops/deform_conv.rs:143-151 | crates/burn-flex/src/ops/deform_conv.rs:476-484 | crates/burn-flex/src/ops/deform_conv.rs:782-790 — before extracting anything, compare `crates/burn-flex/src/ops/conv.rs` and `crates/burn-flex/src/ops/conv_transpose.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/burn-flex/src/ops/deform_conv.rs:139` calls `to_contiguous`, `layout`, `shape` and `crates/burn-flex/src/ops/conv.rs:250` 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 × 7) · ×1
  • Duplicated block (8–9 lines × 7) crates/burn-autodiff/src/ops/module.rs:399 — crates/burn-autodiff/src/ops/module.rs:399-406 | crates/burn-autodiff/src/ops/module.rs:531-538 | crates/burn-autodiff/src/ops/module.rs:659-666 | crates/burn-autodiff/src/ops/module.rs:1120-1128 | crates/burn-autodiff/src/ops/module.rs:1249-1256 | crates/burn-autodiff/src/ops/module.rs:1383-1391 | crates/burn-autodiff/src/ops/tensor.rs:4529-4536 — there are 7 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 7 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/module.rs:399` it begins part-way through the construct above it, so those exact lines cannot be lifted 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–9 lines × 8) · ×1
  • Duplicated block (4–9 lines × 8) crates/burn-autodiff/src/ops/tensor.rs:343 — crates/burn-autodiff/src/ops/tensor.rs:343-351 | crates/burn-autodiff/src/ops/tensor.rs:435-443 | crates/burn-autodiff/src/ops/tensor.rs:537-545 | crates/burn-autodiff/src/ops/tensor.rs:630-638 | crates/burn-autodiff/src/ops/tensor.rs:719-727 | crates/burn-autodiff/src/ops/tensor.rs:781-789 | crates/burn-autodiff/src/ops/tensor.rs:2096-2099 | crates/burn-autodiff/src/ops/tensor.rs:3971-3979 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/tensor.rs:343` it does not close everything it opens, so those 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, `crates/burn-autodiff/src/ops/tensor.rs:444` calls `duplicate` and `crates/burn-autodiff/src/ops/tensor.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.
D4 · Code Duplication · Duplicated block (4–9 lines × 4) · ×1
  • Duplicated block (4–9 lines × 4) crates/burn-flex/src/ops/mask.rs:102 — crates/burn-flex/src/ops/mask.rs:102-110 | crates/burn-flex/src/ops/mask.rs:136-144 | crates/burn-flex/src/ops/mask.rs:180-188 | crates/burn-flex/src/ops/mask.rs:226-229 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/mask.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 `value` to `f32` in one and `f64` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/burn-flex/src/ops/mask.rs:110` calls `num_elements` and `crates/burn-flex/src/ops/mask.rs:229` 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) crates/burn-train/src/metric/vision/lpips/metric.rs:301 — crates/burn-train/src/metric/vision/lpips/metric.rs:301-319 | crates/burn-train/src/metric/vision/lpips/metric.rs:326-344 | crates/burn-train/src/metric/vision/lpips/metric.rs:351-363 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-train/src/metric/vision/lpips/metric.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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code 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 × 7) · ×1
  • Duplicated block (8 lines × 7) crates/burn-autodiff/src/ops/module.rs:207 — crates/burn-autodiff/src/ops/module.rs:207-214 | crates/burn-autodiff/src/ops/module.rs:347-354 | crates/burn-autodiff/src/ops/module.rs:474-481 | crates/burn-autodiff/src/ops/module.rs:606-613 | crates/burn-autodiff/src/ops/module.rs:1062-1069 | crates/burn-autodiff/src/ops/module.rs:1196-1203 | crates/burn-autodiff/src/ops/module.rs:1325-1332 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/module.rs:207` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 6) · ×1
  • Duplicated block (8 lines × 6) crates/burn-flex/src/ops/conv.rs:249 — crates/burn-flex/src/ops/conv.rs:249-256 | crates/burn-flex/src/ops/conv.rs:861-868 | crates/burn-flex/src/ops/conv.rs:1411-1418 | crates/burn-flex/src/ops/conv.rs:1636-1643 | crates/burn-flex/src/ops/conv.rs:1843-1850 | crates/burn-flex/src/ops/conv_transpose.rs:259-266 — before extracting anything, compare `crates/burn-flex/src/ops/conv.rs` and `crates/burn-flex/src/ops/conv_transpose.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 5) · ×1
  • Duplicated block (8 lines × 5) crates/burn-autodiff/src/ops/module.rs:1436 — crates/burn-autodiff/src/ops/module.rs:1436-1443 | crates/burn-autodiff/src/ops/module.rs:1525-1534 | crates/burn-autodiff/src/ops/module.rs:1629-1638 | crates/burn-autodiff/src/ops/module.rs:2224-2231 | crates/burn-autodiff/src/ops/module.rs:2395-2402 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/module.rs:1436` it does not close everything it opens, so those exact lines cannot be lifted 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) · ×1
  • Duplicated block (13 lines × 4) crates/burn-flex/src/ops/reduce.rs:2130 — crates/burn-flex/src/ops/reduce.rs:2130-2142 | crates/burn-flex/src/ops/reduce.rs:2185-2197 | crates/burn-flex/src/ops/reduce.rs:2251-2263 | crates/burn-flex/src/ops/reduce.rs:2308-2320 — 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) crates/burn-flex/src/ops/pool.rs:1259 — crates/burn-flex/src/ops/pool.rs:1259-1265 | crates/burn-flex/src/ops/pool.rs:1484-1491 | crates/burn-flex/src/ops/pool.rs:1677-1684 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/pool.rs:1259` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/burn-flex/src/ops/pool.rs:1256` calls `storage` and `crates/burn-flex/src/ops/pool.rs:1480` 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–8 lines × 3) · ×1
  • Duplicated block (4–8 lines × 3) crates/burn-backend/src/backend/ops/modules/ctc.rs:68 — crates/burn-backend/src/backend/ops/modules/ctc.rs:68-71 | crates/burn-cubecl/src/kernel/ctc.rs:327-334 | crates/burn-cubecl/src/kernel/ctc.rs:624-631 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/burn-cubecl/src/kernel/ctc.rs:334` calls `shape` and `crates/burn-backend/src/backend/ops/modules/ctc.rs:71` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×1
  • Duplicated block (7–8 lines × 2) crates/burn-nn/src/modules/transformer/decoder.rs:334 — crates/burn-nn/src/modules/transformer/decoder.rs:334-341 | crates/burn-nn/src/modules/transformer/decoder.rs:413-419 — both copies are in the same file, so extract the 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 (6–7 lines × 11) · ×1
  • Duplicated block (6–7 lines × 11) crates/burn-autodiff/src/ops/module.rs:70 — crates/burn-autodiff/src/ops/module.rs:70-76 | crates/burn-autodiff/src/ops/module.rs:379-384 | crates/burn-autodiff/src/ops/module.rs:506-511 | crates/burn-autodiff/src/ops/module.rs:639-644 | crates/burn-autodiff/src/ops/module.rs:889-894 | crates/burn-autodiff/src/ops/module.rs:926-931 | crates/burn-autodiff/src/ops/module.rs:963-968 | crates/burn-autodiff/src/ops/module.rs:1094-1099 | crates/burn-autodiff/src/ops/module.rs:1229-1234 | crates/burn-autodiff/src/ops/module.rs:1357-1362 | crates/burn-autodiff/src/ops/module.rs:2330-2335 — all 11 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/module.rs:70` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (7 lines × 10) · ×1
  • Duplicated block (7 lines × 10) crates/burn-autodiff/src/ops/module.rs:41 — crates/burn-autodiff/src/ops/module.rs:41-47 | crates/burn-autodiff/src/ops/module.rs:175-181 | crates/burn-autodiff/src/ops/module.rs:310-316 | crates/burn-autodiff/src/ops/module.rs:433-439 | crates/burn-autodiff/src/ops/module.rs:568-574 | crates/burn-autodiff/src/ops/module.rs:813-819 | crates/burn-autodiff/src/ops/module.rs:1021-1027 | crates/burn-autodiff/src/ops/module.rs:1158-1164 | crates/burn-autodiff/src/ops/module.rs:1284-1290 | crates/burn-autodiff/src/ops/module.rs:2303-2309 — all 10 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/module.rs:41` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (7 lines × 7) · ×1
  • Duplicated block (7 lines × 7) crates/burn-ir/src/operation.rs:4740 — crates/burn-ir/src/operation.rs:4740-4746 | crates/burn-ir/src/operation.rs:4762-4768 | crates/burn-ir/src/operation.rs:4788-4794 | crates/burn-ir/src/operation.rs:4814-4820 | crates/burn-ir/src/operation.rs:4873-4879 | crates/burn-ir/src/operation.rs:4881-4887 | crates/burn-ir/src/operation.rs:4889-4895 — 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. 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 lines × 6) · ×1
  • Duplicated block (7 lines × 6) crates/burn-fusion/src/stream/context.rs:276 — crates/burn-fusion/src/stream/context.rs:276-282 | crates/burn-fusion/src/stream/context.rs:285-291 | crates/burn-fusion/src/stream/context.rs:309-315 | crates/burn-fusion/src/stream/context.rs:318-324 | crates/burn-fusion/src/stream/context.rs:342-348 | crates/burn-fusion/src/stream/context.rs:351-357 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-fusion/src/stream/context.rs:276` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted 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–7 lines × 5) · ×1
  • Duplicated block (3–7 lines × 5) crates/burn-autodiff/src/ops/tensor.rs:1897 — crates/burn-autodiff/src/ops/tensor.rs:1897-1903 | crates/burn-autodiff/src/ops/tensor.rs:1976-1982 | crates/burn-autodiff/src/ops/tensor.rs:2073-2079 | crates/burn-autodiff/src/ops/tensor.rs:2189-2195 | crates/burn-autodiff/src/ops/tensor.rs:2389-2391 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/tensor.rs:1897` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (6–7 lines × 3) · ×1
  • Duplicated block (6–7 lines × 3) crates/burn-flex/src/ops/fft.rs:704 — crates/burn-flex/src/ops/fft.rs:704-710 | crates/burn-flex/src/ops/fft.rs:1001-1006 | crates/burn-flex/src/ops/fft.rs:1281-1287 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (4–6 lines × 3) · ×1
  • Duplicated block (4–6 lines × 3) crates/burn-flex/src/ops/sort.rs:185 — crates/burn-flex/src/ops/sort.rs:185-190 | crates/burn-flex/src/ops/sort.rs:207-210 | crates/burn-flex/src/ops/sort.rs:385-390 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/sort.rs:185` it begins part-way through the construct above it, so those 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, `crates/burn-flex/src/ops/sort.rs:184` calls `sort_unstable_by`, `cmp` and `crates/burn-flex/src/ops/sort.rs:207` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (5 lines × 6) · ×1
  • Duplicated block (5 lines × 6) crates/burn-autodiff/src/ops/module.rs:1443 — crates/burn-autodiff/src/ops/module.rs:1443-1448 | crates/burn-autodiff/src/ops/module.rs:1534-1539 | crates/burn-autodiff/src/ops/module.rs:1638-1643 | crates/burn-autodiff/src/ops/module.rs:2471-2475 | crates/burn-autodiff/src/ops/module.rs:2513-2517 | crates/burn-autodiff/src/ops/module.rs:2555-2559 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-autodiff/src/ops/module.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.
D4 · Code Duplication · Duplicated block (9 lines × 6) · ×1
  • Duplicated block (9 lines × 6) crates/burn-flex/src/ops/reduce.rs:1820 — crates/burn-flex/src/ops/reduce.rs:1820-1828 | crates/burn-flex/src/ops/reduce.rs:1871-1879 | crates/burn-flex/src/ops/reduce.rs:1928-1936 | crates/burn-flex/src/ops/reduce.rs:1986-1994 | crates/burn-flex/src/ops/reduce.rs:2028-2036 | crates/burn-flex/src/ops/reduce.rs:2085-2093 — 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 first that the copies are not typed on the same thing: the declarations holding them bind `dim` to `usize) -> (FlexTensor` in one and `usize` 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 × 5) · ×1
  • Duplicated block (5 lines × 5) crates/burn-flex/src/ops/interpolate.rs:462 — crates/burn-flex/src/ops/interpolate.rs:462-466 | crates/burn-flex/src/ops/interpolate.rs:484-488 | crates/burn-flex/src/ops/interpolate.rs:662-666 | crates/burn-flex/src/ops/interpolate.rs:687-691 | crates/burn-flex/src/ops/interpolate.rs:883-887 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/interpolate.rs:462` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/burn-flex/src/ops/interpolate.rs:467` calls `bilinear_sample` and `crates/burn-flex/src/ops/interpolate.rs:667` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (8 lines × 8) · ×1
  • Duplicated block (8 lines × 8) crates/burn-nn/src/loss/hinge_embedding.rs:74 — crates/burn-nn/src/loss/hinge_embedding.rs:74-81 | crates/burn-nn/src/loss/huber.rs:90-97 | crates/burn-nn/src/loss/lp_loss.rs:145-153 | crates/burn-nn/src/loss/mse.rs:35-42 | crates/burn-nn/src/loss/multi_margin.rs:95-102 | crates/burn-nn/src/loss/poisson.rs:134-141 | crates/burn-nn/src/loss/soft_margin.rs:40-47 | crates/burn-vision/src/loss/gram_matrix/gram_matrix_loss.rs:169-177 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 8 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 8 times. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-nn/src/loss/hinge_embedding.rs:74` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 8) · ×1
  • Duplicated block (7 lines × 8) crates/burn-optim/src/optim/adafactor.rs:128 — crates/burn-optim/src/optim/adafactor.rs:128-134 | crates/burn-optim/src/optim/adagrad.rs:97-103 | crates/burn-optim/src/optim/adam.rs:117-123 | crates/burn-optim/src/optim/adamw.rs:140-146 | crates/burn-optim/src/optim/adan.rs:127-133 | crates/burn-optim/src/optim/lamb.rs:161-167 | crates/burn-optim/src/optim/lion.rs:65-71 | crates/burn-optim/src/optim/rmsprop.rs:64-71 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 8 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/burn-optim/src/optim/adagrad.rs:88` calls `as_ref` and `crates/burn-optim/src/optim/rmsprop.rs:55` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (5 lines × 9) · ×1
  • Duplicated block (5 lines × 9) crates/burn-train/src/metric/acc.rs:85 — crates/burn-train/src/metric/acc.rs:85-89 | crates/burn-train/src/metric/cer.rs:144-148 | crates/burn-train/src/metric/fbetascore.rs:150-154 | crates/burn-train/src/metric/hamming.rs:97-101 | crates/burn-train/src/metric/precision.rs:118-122 | crates/burn-train/src/metric/recall.rs:115-119 | crates/burn-train/src/metric/rouge.rs:156-160 | crates/burn-train/src/metric/top_k_acc.rs:118-122 | crates/burn-train/src/metric/wer.rs:127-131 — before extracting anything, compare `crates/burn-train/src/metric/cer.rs` and `crates/burn-train/src/metric/wer.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/burn-train/src/metric/acc.rs:91` calls `clear`, `reset` and `crates/burn-train/src/metric/wer.rs:133` 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 × 9) · ×1
  • Duplicated block (6 lines × 9) crates/burn-backend/src/backend/ops/int_tensor.rs:1047 — crates/burn-backend/src/backend/ops/int_tensor.rs:1047-1052 | crates/burn-backend/src/backend/ops/int_tensor.rs:1095-1100 | crates/burn-backend/src/backend/ops/int_tensor.rs:1125-1130 | crates/burn-backend/src/backend/ops/qtensor.rs:1053-1058 | crates/burn-backend/src/backend/ops/qtensor.rs:1107-1112 | crates/burn-backend/src/backend/ops/qtensor.rs:1161-1166 | crates/burn-backend/src/backend/ops/tensor.rs:1593-1598 | crates/burn-backend/src/backend/ops/tensor.rs:1648-1653 | crates/burn-backend/src/backend/ops/tensor.rs:1703-1708 — there are 9 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 9 sites; resolving a subset leaves the remainder to drift apart. Note first that the copies are not typed on the same thing: the declarations holding them bind `tensor` to `IntTensor<B>` in one and `QuantizedTensor<B>` 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 × 4) · ×1
  • Duplicated block (6 lines × 4) crates/burn-flex/src/ops/conv.rs:282 — crates/burn-flex/src/ops/conv.rs:282-287 | crates/burn-flex/src/ops/conv.rs:882-887 | crates/burn-flex/src/ops/conv.rs:1433-1438 | crates/burn-flex/src/ops/conv.rs:1659-1664 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/burn-flex/src/ops/conv.rs:282` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D5 · Coupling · Unstable project burn-dispatch · ×1
  • Unstable project burn-dispatch — burn-dispatch has instability 0.83 with 2 dependents.
D5 · Coupling · Unstable project burn-signal · ×1
  • Unstable project burn-signal — burn-signal has instability 0.89 with 1 dependents.
D5 · Coupling · Unstable project burn-train · ×1
  • Unstable project burn-train — burn-train has instability 0.89 with 1 dependents.
D5 · Coupling · Unstable project burn-vision · ×1
  • Unstable project burn-vision — burn-vision has instability 0.86 with 1 dependents.
P3 · Security & performance tooling · SAST runs, but gates no merge · ×1
  • SAST runs, but gates no merge — `REDACTED` run(s) a static-analysis scan, but no workflow that runs one is triggered by a pull request (or a merge queue, or an unfiltered push) — the scan fires on a schedule or a manual dispatch only. A vulnerable change therefore merges clean and is reported on the next scheduled run, by which time it is on the default branch and the only remedy is a follow-up fix. Add the pull-request trigger to the workflow that runs the scan so the finding arrives before the merge rather than after it.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×1
  • Outbound HTTP without resilience crates/burn-std/src/network.rs:23 — `Client::new()` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Minor — 67 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×25
  • Orphaned file crates/burn-train/src/metric/vision/afine/heads.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/burn-train/src/metric/vision/afine/metric.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/burn-vision/src/backends/cpu/morphology/filter_engine.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/burn-train/src/metric/vision/afine/clip_vit.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/burn-vision/src/backends/cpu/connected_components/spaghetti/mod.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/burn-communication/src/external_comm.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/burn-optim/src/lr_scheduler/step.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/burn-train/src/metric/vision/afine/calibrators.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/burn-optim/src/lr_scheduler/sequential.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/burn-optim/src/lr_scheduler/linear.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/burn-vision/src/backends/cpu/connected_components/spaghetti/Spaghetti_first_line_forest_code.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/burn-train/src/metric/vision/dists/vgg16_l2pool.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/burn-train/src/metric/vision/lpips/squeezenet.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/burn-optim/src/lr_scheduler/exponential.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/burn-train/src/metric/vision/dists/l2pool.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/burn-train/src/metric/vision/dists/weights.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/burn-train/src/metric/vision/afine/clip_attention.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/burn-train/src/metric/vision/lpips/vgg.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/burn-train/src/metric/vision/lpips/alexnet.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/burn-nn/src/activation/shrink.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/burn-nn/src/activation/soft_shrink.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/burn-train/src/metric/vision/fid/weights.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/burn-nn/src/activation/hard_shrink.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/burn-nn/src/activation/hard_sigmoid.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/burn-vision/src/backends/cpu/connected_components/spaghetti/Spaghetti_single_line_forest_code.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
X10 · Duplicated predicate · Duplicated predicate · ×14
  • Duplicated predicate crates/burn-store/src/burnpack.rs:455 — `!self.allow_partial && !result.missing.is_empty()` appears character-identically in 2 files — crates/burn-store/src/burnpack.rs, crates/burn-store/src/pytorch/store.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 crates/burn-store/src/applier.rs:330 — `!self.skip_enum_variants || !container_type.starts_with("Enum:")` appears character-identically in 2 files — crates/burn-store/src/applier.rs, crates/burn-store/src/collector.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 crates/burn-train/src/learner/supervised/strategies/ddp/epoch.rs:167 — `accumulation_current > 0 && !interrupter.should_stop()` appears character-identically in 3 files — crates/burn-train/src/learner/supervised/strategies/ddp/epoch.rs, crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs, crates/burn-train/src/learner/supervised/strategies/single/epoch.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 crates/burn-backend/src/backend/ops/modules/conv.rs:268 — `ceil_mode && (effective_kernel - padded) < stride` appears character-identically in 2 files — crates/burn-backend/src/backend/ops/modules/conv.rs, crates/burn-flex/src/ops/pool.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 crates/burn-train/src/learner/supervised/strategies/multi/strategy.rs:86 — `checkpointer.is_some() || early_stopping.is_some()` appears character-identically in 2 files — crates/burn-train/src/learner/supervised/strategies/multi/strategy.rs, crates/burn-train/src/learner/supervised/strategies/single/strategy.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 crates/burn-linalg/src/functions/det.rs:85 — `original_dtype == DType::F16 || original_dtype == DType::BF16` appears character-identically in 3 files — crates/burn-linalg/src/functions/det.rs, crates/burn-linalg/src/functions/lu.rs, crates/burn-linalg/src/functions/svd.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 crates/burn-store/src/burnpack.rs:447 — `self.validate && !result.errors.is_empty()` appears character-identically in 2 files — crates/burn-store/src/burnpack.rs, crates/burn-store/src/pytorch/store.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 crates/burn-train/src/learner/rl/env_runner/async_runner.rs:101 — `step_result.done || step_result.truncated` appears character-identically in 2 files — crates/burn-train/src/learner/rl/env_runner/async_runner.rs, crates/burn-train/src/learner/rl/env_runner/base.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 crates/burn-cubecl/src/kernel/binary.rs:316 — `tensor.can_mut() && tensor.is_nonoverlapping()` appears character-identically in 9 files — crates/burn-cubecl/src/kernel/binary.rs, crates/burn-cubecl/src/kernel/binary_int.rs, crates/burn-cubecl/src/kernel/index/scatter.rs, crates/burn-cubecl/src/kernel/index/scatter_nd.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 crates/burn-flex/src/ops/comparison.rs:863 — `tensor.is_contiguous() && tensor.layout().start_offset() == 0` appears character-identically in 2 files — crates/burn-flex/src/ops/comparison.rs, crates/burn-linalg/src/cholesky_cpu.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 crates/burn-flex/src/ops/bool.rs:209 — `tensor.is_unique() && tensor.layout().is_contiguous() && tensor.layout().start_offset() == 0` appears character-identically in 3 files — crates/burn-flex/src/ops/bool.rs, crates/burn-flex/src/ops/slice.rs, crates/burn-flex/src/ops/unary.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 crates/burn-flex/src/ops/gather_scatter.rs:536 — `tensor.is_unique() && tensor.layout().is_dense_unique_storage()` appears character-identically in 2 files — crates/burn-flex/src/ops/gather_scatter.rs, crates/burn-flex/src/ops/mask.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 crates/burn-nn/src/modules/rnn/basic.rs:665 — `val >= -clip_value as f32 && val <= clip_value as f32` appears character-identically in 2 files — crates/burn-nn/src/modules/rnn/basic.rs, crates/burn-nn/src/modules/rnn/gru.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 crates/burn-flex/src/ops/float.rs:1412 — `y.to_bits() == expected.to_bits() || (y.is_nan() && expected.is_nan())` appears character-identically in 2 files — crates/burn-flex/src/ops/float.rs, crates/burn-flex/src/simd/portable.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
D16 · Bus Factor · Off-boarding risk · ×5
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 30 significant file(s) lose their only recent owner: crates/burn-flex/src/ops/qtensor.rs, crates/burn-remote/src/server/pump.rs, crates/burn-tensor/src/tensor/api/extension.rs, crates/burn-core/src/module/display.rs, crates/burn-remote/src/telemetry.rs, crates/burn-std/src/tensor/quantization/packing.rs, crates/burn-core/src/module/param/reparameterization_dyn.rs, crates/burn-tensor/src/wgpu.rs (+22 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 4 significant file(s) lose their only recent owner: crates/burn-flex/src/simd/portable.rs, crates/burn-flex/src/ops/unary.rs, crates/burn-pack/src/atomic.rs, crates/pytorch-reader/src/lib.rs. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 4 significant file(s) lose their only recent owner: crates/burn-train/src/metric/mcc.rs, crates/burn-optim/src/optim/adafactor/tests.rs, crates/burn-optim/src/optim/lamb.rs, crates/burn-optim/src/optim/adafactor.rs. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 4 significant file(s) lose their only recent owner: crates/burn-nn/src/modules/pixel_shuffle.rs, crates/burn-nn/src/loss/multi_margin.rs, crates/burn-nn/src/modules/fold.rs, crates/burn-nn/src/loss/margin_ranking.rs. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #5 — If anonymized user #5 becomes unavailable, 4 significant file(s) lose their only recent owner: crates/burn-fusion/src/stream/execution/processor.rs, crates/burn-fusion/src/stream/execution/explorer.rs, crates/burn-std/src/config/fusion.rs, crates/burn-cubecl-fusion/src/engine/settings.rs. Pair on, review, or document these before any departure.
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Medium vulnerability · ×3
  • REDACTED
  • REDACTED
  • REDACTED
C2 · Access Controls · No named authorization policies · ×1
  • No named authorization policies — Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 2 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (49 single-owned of 860 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 860 of the 1235 production source files in this repository met that bar). They are anonymized user #6 (2 file(s)), anonymized user #7 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: crates/burn-cubecl/src/kernel/conv/conv_transpose3d/col2im.rs, crates/burn-cubecl/src/kernel/conv/conv_transpose3d/tune.rs, crates/burn-dataset/src/dataset/base.rs.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found crates/burn-instrument-report/src/main.rs:1 — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `crates/burn-instrument-report/src/main.rs` makes this repository a deployable product (line 1).
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 8 of 40 project(s) overshoot their size bounds, lowering Project Cohesion to 6.2/10. The most over is `crates/burn-train` (29247 LoC, 270 module-visible types across 26 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D34 · Knowledge Freshness · Further orphaned files (smaller) · ×1
  • Further orphaned files (smaller) — 25 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: crates/burn-train/src/metric/vision/afine/heads.rs, crates/burn-train/src/metric/vision/afine/metric.rs, crates/burn-vision/src/backends/cpu/morphology/filter_engine.rs, crates/burn-train/src/metric/vision/afine/clip_vit.rs, crates/burn-vision/src/backends/cpu/connected_components/spaghetti/mod.rs, crates/burn-communication/src/external_comm.rs, crates/burn-optim/src/lr_scheduler/step.rs, crates/burn-train/src/metric/vision/afine/calibrators.rs (and 17 more) (28 orphaned of 860 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 860 of the 1235 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
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.
M4 · Documentation accuracy · README/code drift · ×1
  • README/code drift crates/burn/README.md:13 — crates/burn/README.md links to `assets/ci-powered-by-blaze.svg`, but `crates/burn/assets/ci-powered-by-blaze.svg` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 13/15 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `crates/burn-instrument-report`.
P4 · Deployment & Rollback · No release approval gate · ×1
  • No release approval gate — The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
P6 · Release Hygiene · Changelog looks stale/thin · ×1
  • Changelog looks stale/thin — The changelog this check read carries 0 versioned entries, against a bar of 3. Counted as either the distinct `x.y.z` versions it names (a link's target is not counted) or its version-shaped section headings (`## [1.2.0]`, `## V14.x.x`, `## Updates in 8.0.x`), whichever is the larger — so a log sectioned by minor series counts its sections, not its individual patch numbers. Entries recorded somewhere this check does not read — release notes generated at tag time from a generator config it did not recognise, or a log kept outside the repository — are not counted here, and this row is about what is re-findable in the tree rather than about how often you release.
S1 · Web-Security Posture · No app-layer HTTPS enforcement detected · ×1
  • No app-layer HTTPS enforcement detected — This repository starts an HTTP server and nothing in its Rust source or committed `Rocket.toml` secures the transport: no TLS served (actix-web `bind_rustls`/`bind_openssl`, axum-server `bind_rustls` with a `RustlsConfig`, tonic `ServerTlsConfig`, a `TlsAcceptor`, Rocket's `[default.tls]`), no `Strict-Transport-Security` header, no `X-Forwarded-Proto` read from a TLS-terminating proxy — so its traffic may cross the network in clear text. (−2.0 on this card.) The server: `axum::serve(` (crates/burn-communication/src/websocket/server.rs:68).
S1 · Web-Security Posture · No security response headers detected · ×1
  • No security response headers detected — None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is set on a response this repository's Rust server sends — defense in depth, even when a proxy could set them. (−2.0 on this card.) The server: `axum::serve(` (crates/burn-communication/src/websocket/server.rs:68).
S1 · Web-Security Posture · No inbound request validation detected · ×1
  • No inbound request validation detected — No handler of this repository's Rust server answers 400, 413 or 422 (`StatusCode::BAD_REQUEST`, `HttpResponse::BadRequest()`, `Status::BadRequest`, tonic `Status::invalid_argument`), and nothing declares validation — no `validator`/`garde` derive, no body limit (`DefaultBodyLimit::max`, `RequestBodyLimitLayer`, `JsonConfig::default().limit(…)`, Rocket `Limits`) — nothing shows inbound requests being checked, and refused, before a handler acts on them. A check that answers its failure with 200 and an error body is not seen. (−2.0 on this card.) The server: `axum::serve(` (crates/burn-communication/src/websocket/server.rs:68).
Minor — 20 finding(s)
D12 · Dependency Hygiene · Outdated · ×20
  • Outdated: bon — `bon` is locked at 3.10.1 but 3.10.3 is the current stable release on crates.io, and it already satisfies the `"3.10.1"` requirement declared in crates/burn-vision/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p bon` and commit the updated REDACTED.
  • Outdated: crc32fast — `crc32fast` is locked at 1.5.2 but 1.5.5 is the current stable release on crates.io, and it already satisfies the `"1.5.2"` requirement declared in crates/pytorch-reader/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p crc32fast` and commit the updated REDACTED.
  • Outdated: encoding_rs — `encoding_rs` is locked at 0.8.42 but 0.8.44 is the current stable release on crates.io, and it already satisfies the `"0.8.42"` requirement declared in crates/burn-dataset/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p encoding_rs` and commit the updated REDACTED.
  • Outdated: enumset — `enumset` is locked at 1.1.14 but 1.1.15 is the current stable release on crates.io, and it already satisfies the `"1.1.14"` requirement declared in crates/burn-backend/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p enumset` and commit the updated REDACTED.
  • Outdated: flate2 — `flate2` is locked at 1.1.10 but 1.1.11 is the current stable release on crates.io, and it already satisfies the `"1.1.10"` requirement declared in crates/burn-dataset/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p flate2` and commit the updated REDACTED.
  • Outdated: iroh — `iroh` is locked at 1.3.0 but 1.4.1 is the current stable release on crates.io, and it already satisfies the `"1.3.0"` requirement declared in crates/burn-remote/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p iroh` and commit the updated REDACTED.
  • Outdated: js-sys — `js-sys` is locked at 0.3.106 but 0.3.107 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in examples/mnist-inference-web/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p js-sys` and commit the updated REDACTED.
  • Outdated: log — `log` is locked at 0.4.34 but 0.4.35 is the current stable release on crates.io, and it already satisfies the `"0.4.34"` requirement declared in xtask/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p log` and commit the updated REDACTED.
  • Outdated: memmap2 — `memmap2` is locked at 0.9.11 but 0.9.12 is the current stable release on crates.io, and it already satisfies the `"0.9"` requirement declared in crates/burn-store/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p memmap2` and commit the updated REDACTED.
  • Outdated: serde_json — `serde_json` is locked at 1.0.151 but 1.0.154 is the current stable release on crates.io, and it already satisfies the `"1.0.151"` requirement declared in crates/burn-core/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p serde_json` and commit the updated REDACTED.
  • Outdated: smallvec — `smallvec` is locked at 1.16.4 but 1.16.5 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/burn-shard/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p smallvec` and commit the updated REDACTED.
  • Outdated: syn — `syn` is locked at 3.0.9 but 3.0.10 is the current stable release on crates.io, and it already satisfies the `"3.0.6"` requirement declared in crates/burn-backend-extension/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p syn` and commit the updated REDACTED.
  • Outdated: tokio — `tokio` is locked at 1.53.1 but 1.54.1 is the current stable release on crates.io, and it already satisfies the `"1.53.1"` requirement declared in crates/burn-communication/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tokio` and commit the updated REDACTED.
  • Outdated: tokio-util — `tokio-util` is locked at 0.7.19 but 0.7.20 is the current stable release on crates.io, and it already satisfies the `"0.7"` requirement declared in crates/burn-communication/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tokio-util` and commit the updated REDACTED.
  • Outdated: turso — `turso` is locked at 0.8.2 but 0.8.3 is the current stable release on crates.io, and it already satisfies the `"0.8.2"` requirement declared in crates/burn-dataset/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p turso` and commit the updated REDACTED.
  • Outdated: unicode-width — `unicode-width` is locked at 0.2.2 but 0.2.3 is the current stable release on crates.io, and it already satisfies the `"0.2"` requirement declared in crates/burn-train/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p unicode-width` and commit the updated REDACTED.
  • Outdated: uuid — `uuid` is locked at 1.26.1 but 1.29.2 is the current stable release on crates.io, and it already satisfies the `"1.26.1"` requirement declared in crates/burn-std/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p uuid` and commit the updated REDACTED.
  • Outdated: wasm-bindgen — `wasm-bindgen` is locked at 0.2.129 but 0.2.130 is the current stable release on crates.io, and it already satisfies the `"0.2"` requirement declared in examples/mnist-inference-web/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p wasm-bindgen` and commit the updated REDACTED.
  • Outdated: wasm-bindgen-futures — `wasm-bindgen-futures` is locked at 0.4.79 but 0.4.80 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in crates/burn-remote/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p wasm-bindgen-futures` and commit the updated REDACTED.
  • Outdated: zip — `zip` is locked at 9.0.4 but 9.5.1 is the current stable release on crates.io, and it already satisfies the `"9.0.4"` requirement declared in crates/pytorch-reader/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p zip` and commit the updated REDACTED.

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-2d2674b61d074701b07ec7e68fb6ed57/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-2d2674b61d074701b07ec7e68fb6ed57/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 .91artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .19artifacts/raw/osv-scanner.json
D31 · IaC & Container Securitytrivy—trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.0—
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .0artifacts/raw/osv-scanner.json

Run 01a1daaf-7bf6-7899-a492-b6583f1431a9 · 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