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

tracel-ai/burn

Measured 27 October 2026, 01:34 UTC, at code version 881f878

No regression since the last survey Test reliability: not measured

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

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

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

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

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

Findings by how serious they are

88 critical 1139 serious 58 minor

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

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
27 October 2026, 01:34 UTC

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

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

64of 64 dimensions measured by tools.
1244of 1285 findings point to an exact file and line, so you can open each one in the code. The other 41 concern the repository as a whole, such as missing documentation.
64dimensions across 7 lenses, read from 311,407 lines of product code in 40 projects.
Chapters

Executive summary

tracel-ai/burn meets our standard for a preview release. It scores 65 out of 100 and is rated Strong, and 86 of its 88 critical findings are security problems in the build pipeline and in its automatic dependency updates.

Security and Compliance, at 57, is the weakest lens and counts most in the score. The best first steps are recording design decisions and restricting the build's access tokens, each worth about 3 points. Raising Security and Compliance to 68 would lift the score to about 69.

Eighty-four 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 one secret can leak from the build pipeline. Pinning each tool to an exact version, setting a waiting period for automatic updates and limiting the secret to its own step would close these risks. The two tests the project itself marks as unreliable need fixing or deleting.

The product code is 311,407 lines, about €480,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 57 · counts for 46%Production Readiness 61 · counts for 25%Maturity 69 · counts for 14%Code Health 89 · counts for 8%Architecture 95 · counts for 4%Performance 97 · counts for 2%Event Sourcing 100 · counts for 1%

If Security and Compliance rose from 57 to 68, the lowest score rated Strong, the score would rise from 65 to about 69.

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

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

  • Cyclomatic Complexity · burn_linalg::cholesky_gpu::panel (cyclomatic 45) crates/burn-linalg/src/cholesky_gpu.rs
  • Cyclomatic Complexity · burn_linalg::functions::cholesky::cholesky (cyclomatic 16) crates/burn-linalg/src/functions/cholesky.rs
  • Cognitive Complexity · burn_linalg::cholesky_gpu::panel (cognitive 100) crates/burn-linalg/src/cholesky_gpu.rs
  • Cognitive Complexity · burn_flex::ops::conv::conv2d_im2col_nchw (cognitive 21) crates/burn-flex/src/ops/conv.rs
  • Cognitive Complexity · burn_linalg::functions::cholesky::cholesky (cognitive 20) crates/burn-linalg/src/functions/cholesky.rs
  • Cognitive Complexity · burn_flex::ops::conv::im2col_nchw_row (cognitive 19) crates/burn-flex/src/ops/conv.rs
  • Cognitive Complexity · burn_linalg::cholesky_cpu::factor_batch (cognitive 18) crates/burn-linalg/src/cholesky_cpu.rs
  • Cognitive Complexity · MultiDeviceLearningStrategy::fit (cognitive 17) crates/burn-train/src/learner/supervised/strategies/multi/strategy.rs
  • Cognitive Complexity · Evaluator::eval_all (cognitive 16) crates/burn-train/src/evaluator/base.rs
  • Cognitive Complexity · MultiDeviceTrainEpoch::run_optim_main (cognitive 16) crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs
  • God Classes · FunctionTooLong: burn_linalg::cholesky_gpu::panel crates/burn-linalg/src/cholesky_gpu.rs
  • God Classes · ClassTooLong: Dispatch crates/burn-dispatch/src/backend.rs
  • God Classes · MethodTooLong: OffPolicyStrategy.train_loop crates/burn-train/src/learner/rl/off_policy.rs
  • God Classes · ClassTooLong: RemoteService crates/burn-remote/src/client/service.rs
  • Code Duplication · Near-duplicate member family (4 members, 20 shared lines) crates/burn-autodiff/src/ops/tensor.rs
  • Code Duplication · Near-duplicate member family (4 members, 14 shared lines) crates/burn-autodiff/src/ops/tensor.rs
  • Code Duplication · Near-duplicate member pair (62 shared lines) crates/burn-train/src/learner/supervised/strategies/multi/epoch.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 (25 corresponding lines) crates/burn-nn/src/modules/transformer/decoder.rs
  • Code Duplication · Edited copy of a member (22 corresponding lines) crates/burn-store/src/adapter.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-flex/src/ops/conv.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-fusion/src/client.rs
  • Code Duplication · Duplicated block (31–32 lines × 2) crates/burn-train/src/learner/supervised/strategies/ddp/epoch.rs
  • Code Duplication · Duplicated block (24–25 lines × 2) crates/burn-nn/src/modules/rnn/basic.rs
  • Code Duplication · Duplicated block (22 lines × 2) crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs
  • Code Duplication · Duplicated block (16–18 lines × 2) crates/burn-train/src/learner/supervised/strategies/ddp/epoch.rs
  • Code Duplication · Duplicated block (15–18 lines × 2) crates/burn-train/src/metric/cer.rs
  • Code Duplication · Duplicated block (15 lines × 2) crates/burn-autodiff/src/ops/tensor.rs
  • Code Duplication · Duplicated block (13–15 lines × 2) crates/burn-flex/src/ops/conv.rs
  • Code Duplication · Duplicated block (11 lines × 4) crates/burn-autodiff/src/ops/tensor.rs
  • Code Duplication · Duplicated block (11 lines × 3) crates/burn-nn/src/modules/conv/conv_transpose1d.rs
  • Code Duplication · Duplicated block (11 lines × 2) crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs
  • Code Duplication · Duplicated block (10–11 lines × 2) crates/burn-train/src/learner/supervised/strategies/ddp/epoch.rs
  • Code Duplication · Duplicated block (10 lines × 2) crates/burn-nn/src/modules/transformer/decoder.rs
  • Code Duplication · Duplicated block (10 lines × 2) crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs
  • Code Duplication · Duplicated block (10 lines × 2) crates/burn-train/src/metric/processor/full.rs
  • Code Duplication · Duplicated block (10 lines × 2) crates/burn-train/src/metric/processor/full.rs
  • Code Duplication · Duplicated block (9–10 lines × 2) crates/burn-train/src/renderer/tui/metric_numeric.rs
  • Code Duplication · Duplicated block (4–9 lines × 8) crates/burn-autodiff/src/ops/tensor.rs
  • Code Duplication · Duplicated block (8–9 lines × 3) crates/burn-autodiff/src/ops/tensor.rs
  • Code Duplication · Duplicated block (9 lines × 2) crates/burn-autodiff/src/ops/tensor.rs
  • Code Duplication · Duplicated block (9 lines × 2) crates/burn-cubecl/src/kernel/binary_float.rs
  • Code Duplication · Duplicated block (8–9 lines × 2) crates/burn-store/src/adapter.rs
  • Code Duplication · Duplicated block (9 lines × 2) crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs
  • Code Duplication · Duplicated block (8 lines × 2) crates/burn-linalg/src/cholesky_gpu.rs
  • Code Duplication · Duplicated block (8 lines × 2) crates/burn-store/src/adapter.rs
  • Code Duplication · Duplicated block (8 lines × 2) crates/burn-train/src/metric/processor/full.rs
  • Code Duplication · Duplicated block (8 lines × 3) crates/burn-train/src/metric/vision/lpips/weights.rs
  • Code Duplication · Duplicated block (7 lines × 2) crates/burn-backend/src/backend/ops/collective.rs
  • Code Duplication · Duplicated block (7 lines × 2) crates/burn-cubecl/src/kernel/ctc.rs
  • Code Duplication · Duplicated block (6 lines × 5) crates/burn-autodiff/src/ops/tensor.rs
  • Code Duplication · Duplicated block (6 lines × 2) crates/burn-autodiff/src/ops/tensor.rs
  • Code Duplication · Duplicated block (6 lines × 2) crates/burn-cubecl/src/kernel/unary_float.rs
  • Code Duplication · Duplicated block (5 lines × 2) crates/burn-train/src/metric/processor/minimal.rs
  • Code Duplication · Duplicated block (5 lines × 2) crates/burn-train/src/renderer/cli.rs
  • Code Duplication · Duplicated block (5 lines × 2) crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs
  • Code Duplication · Duplicated block (9 lines × 2) crates/burn-nn/src/modules/norm/group.rs
  • Code Duplication · Duplicated block (9 lines × 3) crates/burn-nn/src/modules/pool/avg_pool1d.rs
  • Code Duplication · Duplicated block (9 lines × 3) crates/burn-nn/src/modules/pool/max_pool1d.rs
  • Code Duplication · Duplicated block (5 lines × 2) crates/burn-train/src/renderer/cli.rs
  • Code Duplication · Duplicated block (5 lines × 3) crates/burn-backend-extension/src/lib.rs
  • Code Duplication · Duplicated block (9 lines × 3) crates/burn-nn/src/modules/conv/conv1d.rs
  • Code Duplication · Duplicated block (8 lines × 3) crates/burn-nn/src/modules/conv/conv_transpose1d.rs
  • Code Duplication · Duplicated block (8 lines × 2) crates/burn-signal/src/functions/fft.rs
  • Code Duplication · Duplicated block (6 lines × 2) crates/burn-nn/src/modules/conv/conv2d.rs
  • Cohesion (LCOM4) · Low cohesion: Tensor (LCOM4 8) crates/burn-tensor/src/tensor/api/base.rs
  • Churn × Complexity Hotspots · Hotspot: crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs
  • Churn × Complexity Hotspots · Hotspot: crates/burn-cubecl/src/kernel/unary_float.rs crates/burn-cubecl/src/kernel/unary_float.rs
  • Churn × Complexity Hotspots · Hotspot: crates/burn-optim/src/optim/lbfgs.rs crates/burn-optim/src/optim/lbfgs.rs
  • Churn × Complexity Hotspots · Hotspot: crates/burn-cubecl/src/kernel/ctc.rs crates/burn-cubecl/src/kernel/ctc.rs
  • Churn × Complexity Hotspots · Repeated repair: crates/burn-tensor/src/tensor/api/check.rs crates/burn-tensor/src/tensor/api/check.rs
  • Churn × Complexity Hotspots · Repeated repair: crates/burn-tensor/src/tensor/api/orderable.rs crates/burn-tensor/src/tensor/api/orderable.rs
  • Churn × Complexity Hotspots · Repeated repair: crates/burn-core/src/module/lora.rs crates/burn-core/src/module/lora.rs
  • Static Analysis (SAST) · REDACTED
  • Static Analysis (SAST) · REDACTED
  • Static Analysis (SAST) · REDACTED
  • Dependency Vulnerabilities · REDACTED
  • Dependency Vulnerabilities · REDACTED
  • Dependency Vulnerabilities · REDACTED
  • Dependency Vulnerabilities · REDACTED
  • Dependency Vulnerabilities · REDACTED
  • Dependency Vulnerabilities · REDACTED
  • Dependency Vulnerabilities · REDACTED
  • Dependency Vulnerabilities · REDACTED
  • Dependency Vulnerabilities · REDACTED
  • Dependency Vulnerabilities · REDACTED
  • Dependency Vulnerabilities · REDACTED
  • Change Coupling · Change coupling: avg_pool1d.rs ↔ avg_pool2d.rs crates/burn-nn/src/modules/pool/avg_pool1d.rs
  • Change Coupling · Change-coupling hub: interpreter.rs → tensor.rs, module.rs, context.rs, task.rs, module.rs, int.rs crates/burn-router/src/interpreter.rs
  • Change Coupling · Change coupling: task.rs ↔ base.rs crates/burn-remote/src/shared/task.rs
  • Change Coupling · Change coupling: embedding.rs ↔ linear.rs crates/burn-nn/src/modules/embedding.rs
  • Change Coupling · Change coupling: bool_tensor.rs ↔ base.rs crates/burn-autodiff/src/ops/bool_tensor.rs
  • Supply-chain Provenance & Signing · REDACTED
  • Supply-chain Provenance & Signing · REDACTED
  • Supply-chain Provenance & Signing · REDACTED
  • Supply-chain Provenance & Signing · REDACTED

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

Fixed since the last survey: 55 findings

These 55 critical or serious findings were in the previous survey, on 13 October 2026, and are gone from this one.

  • Cyclomatic Complexity · SessionHandler::process_task (cyclomatic 20) crates/burn-remote/src/server/worker.rs
  • Cognitive Complexity · burn_derive::module::generics::parse_module_generics (cognitive 24) crates/burn-derive/src/module/generics.rs
  • Cognitive Complexity · burn_flex::ops::gather_scatter::scatter_or (cognitive 24) crates/burn-flex/src/ops/gather_scatter.rs
  • Cognitive Complexity · burn_derive::module::codegen_struct::parse_module_field_type (cognitive 19) crates/burn-derive/src/module/codegen_struct.rs
  • Code Duplication · Near-duplicate member pair (49 shared lines) crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs
  • Code Duplication · Near-duplicate member pair (27 shared lines) crates/burn-autodiff/src/ops/tensor.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 (25 corresponding lines) crates/burn-nn/src/modules/transformer/decoder.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-flex/src/ops/conv.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-fusion/src/client.rs
  • Code Duplication · Duplicated block (41–43 lines × 2) crates/burn-nn/src/modules/attention/cross_attention.rs
  • Code Duplication · Duplicated block (27 lines × 2) crates/burn-train/src/learner/supervised/strategies/ddp/epoch.rs
  • Code Duplication · Duplicated block (19–22 lines × 2) crates/burn-nn/src/modules/rnn/basic.rs
  • Code Duplication · Duplicated block (22 lines × 2) crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs
  • Code Duplication · Duplicated block (19 lines × 2) crates/burn-flex/src/ops/conv.rs
  • Code Duplication · Duplicated block (16–18 lines × 2) crates/burn-train/src/learner/supervised/strategies/ddp/epoch.rs
  • Code Duplication · Duplicated block (17 lines × 2) crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs
  • Code Duplication · Duplicated block (17 lines × 2) crates/burn-flex/src/ops/gather_scatter.rs
  • Code Duplication · Duplicated block (15–17 lines × 2) crates/burn-nn/src/modules/transformer/decoder.rs
  • Code Duplication · Duplicated block (16–17 lines × 2) crates/burn-train/src/learner/supervised/strategies/ddp/epoch.rs
  • Code Duplication · Duplicated block (11–13 lines × 2) crates/burn-cubecl/src/kernel/ctc.rs
  • Code Duplication · Duplicated block (11 lines × 3) crates/burn-autodiff/src/ops/tensor.rs
  • Code Duplication · Duplicated block (11 lines × 2) crates/burn-nn/src/modules/transformer/decoder.rs
  • Code Duplication · Duplicated block (10 lines × 2) crates/burn-std/src/data/tensor/base.rs
  • Code Duplication · Duplicated block (4–9 lines × 7) crates/burn-autodiff/src/ops/tensor.rs
  • Code Duplication · Duplicated block (9 lines × 2) crates/burn-autodiff/src/ops/tensor.rs
  • Code Duplication · Duplicated block (9 lines × 2) crates/burn-train/src/metric/bleu.rs
  • Code Duplication · Duplicated block (8 lines × 2) crates/burn-autodiff/src/ops/tensor.rs
  • Code Duplication · Duplicated block (8 lines × 2) crates/burn-optim/src/optim/lbfgs.rs
  • Code Duplication · Duplicated block (8 lines × 2) crates/burn-train/src/metric/processor/full.rs
  • Code Duplication · Duplicated block (8 lines × 2) crates/burn-train/src/metric/vision/lpips/weights.rs
  • Code Duplication · Duplicated block (7 lines × 2) crates/burn-nn/src/modules/attention/mha.rs
  • Code Duplication · Duplicated block (6 lines × 4) crates/burn-autodiff/src/ops/tensor.rs
  • Code Duplication · Duplicated block (6 lines × 2) crates/burn-router/src/interpreter.rs
  • Code Duplication · Duplicated block (5 lines × 2) crates/burn-fusion/src/tensor/base.rs
  • Code Duplication · Duplicated block (5 lines × 2) crates/burn-train/src/metric/processor/minimal.rs
  • Code Duplication · Duplicated block (5 lines × 2) crates/burn-train/src/renderer/cli.rs
  • Code Duplication · Duplicated block (5 lines × 2) crates/burn-train/src/renderer/cli.rs
  • Code Duplication · Duplicated block (8 lines × 2) crates/burn-train/src/metric/vision/lpips/weights.rs
  • Code Duplication · Duplicated block (8 lines × 2) crates/burn-train/src/metric/vision/lpips/weights.rs
  • Cohesion (LCOM4) · Low cohesion: Tensor (LCOM4 9) crates/burn-tensor/src/tensor/api/base.rs
  • Churn × Complexity Hotspots · Hotspot: crates/burn-train/src/renderer/tui/renderer.rs crates/burn-train/src/renderer/tui/renderer.rs
  • Churn × Complexity Hotspots · Repeated repair: crates/burn-train/src/metric/top_k_acc.rs crates/burn-train/src/metric/top_k_acc.rs
  • Churn × Complexity Hotspots · Repeated repair: crates/burn-train/src/metric/acc.rs crates/burn-train/src/metric/acc.rs
  • Explicit Debt · TodoComment crates/burn-backend-tests/tests/autodiff/all_reduce.rs
  • Explicit Debt · TodoComment crates/burn-cubecl-fusion/src/lib.rs
  • Explicit Debt · TodoComment crates/burn-cubecl/src/lib.rs
  • Change Coupling · Change-coupling hub: avg_pool2d.rs → base.rs, avg_pool1d.rs, max_pool2d.rs crates/burn-nn/src/modules/pool/avg_pool2d.rs
  • Change Coupling · Change-coupling hub: interpreter.rs → module.rs, context.rs, task.rs, module.rs, int.rs crates/burn-router/src/interpreter.rs
  • Change Coupling · Change coupling: module.rs ↔ module.rs crates/burn-autodiff/src/ops/module.rs
  • Change Coupling · Change coupling: executor.rs ↔ output.rs crates/burn-cubecl-fusion/src/engine/launch/executor.rs
  • Supply-chain Provenance & Signing REDACTED
Rebuild cost: about €480,000 · Estimate
Cost to rebuild€160,000 to €800,000, for 2,639 to 8,371 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 65. 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: 311,407 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

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

Top priorities

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

1
Resolve the 1 No ADRs found finding(s) in ADR Quality.
Raises the score by about 3 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 €480,000 to build again, about 3.3 person-years of work. Its weakest lens is Security and Compliance, at 57 (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 3 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 7.4 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 2% to 5% on every change. The history of the code shows how much it changes: about 216,539 lines over the last 90 days, which is about 878,186 lines a year. At that pace, the extra work comes to an estimated 43.9 to 292.7 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture — module dependency graph

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

arch 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-backend burn-backend 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-fusion burn-cubecl-fusion burn-cubecl->burn-cubecl-fusion burn-cubecl->burn-fusion burn-cubecl->burn-ir burn-cubecl->burn-std burn-cubecl-fusion->burn-backend burn-cubecl-fusion->burn-fusion burn-cubecl-fusion->burn-ir burn-cubecl-fusion->burn-std burn-dispatch->burn-backend burn-dispatch->burn-capture burn-dispatch->burn-cubecl burn-flex burn-flex burn-dispatch->burn-flex burn-remote burn-remote burn-dispatch->burn-remote 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-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-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.

913 modules, with 2759 dependencies between them. 12 loops run through 158 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 873 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.checkpoint.state2 burn_autodiff.grads3 burn_core.module.display4 burn_optim.lr_scheduler.base5 burn_std.distributed6 burn_train.metric.base7 burn_tensor.device8 burn_pack.tensor9 burn_core.module.param.base10 burn_instrument.bounds11 burn_nn.activation.activation_wrapper12 burn_std.tensor.dtype13 burn_train.metric.state14 burn_backend.backend.base15 burn_backend.backend.primitive16 burn_core.module.base17 burn_cubecl_fusion.engine.codegen.ir18 burn_ir.tensor19 burn_nn.initializer20 burn_pack.base21 burn_std.data.tensor.base22 burn_cubecl_fusion.engine.trace.base23 burn_flex.tensor24 burn_ir.handle25 burn_optim.optim.module.module_optimizer26 burn_remote.shared.task27 burn_cubecl.tensor.base28 burn_fusion.stream.context29 burn_train.learner.base30 burn_ir.operation31 burn_std.ops32 burn_autodiff.backend33 burn_dispatch.backend34 burn_flex.backend35 burn_fusion.backend36 burn_tensor.bridge.ops.numeric37 burn_cubecl.backend38 burn_router.backend39 burn_tensor.bridge.kind40 burn_tensor.tensor.api.base
1 burn_autodiff.checkpoint.state
2 burn_autodiff.grads
3 burn_core.module.display
4 burn_optim.lr_scheduler.base
5 burn_std.distributed
6 burn_train.metric.base
7 burn_tensor.device2
8 burn_pack.tensor11
9 burn_core.module.param.base3411
10 burn_instrument.bounds1
11 burn_nn.activation.activation_wrapper11
12 burn_std.tensor.dtype3
13 burn_train.metric.state62
14 burn_backend.backend.base111
15 burn_backend.backend.primitive22
16 burn_core.module.base212
17 burn_cubecl_fusion.engine.codegen.ir1
18 burn_ir.tensor14
19 burn_nn.initializer221
20 burn_pack.base2
21 burn_std.data.tensor.base3
22 burn_cubecl_fusion.engine.trace.base24
23 burn_flex.tensor1211
24 burn_ir.handle131
25 burn_optim.optim.module.module_optimizer11
26 burn_remote.shared.task12
27 burn_cubecl.tensor.base11111
28 burn_fusion.stream.context2
29 burn_train.learner.base111
30 burn_ir.operation121102216
31 burn_std.ops12
32 burn_autodiff.backend12133116
33 burn_dispatch.backend121331119
34 burn_flex.backend23211117
35 burn_fusion.backend134211113118
36 burn_tensor.bridge.ops.numeric111111
37 burn_cubecl.backend1142111171
38 burn_router.backend1132111191
39 burn_tensor.bridge.kind2343352
40 burn_tensor.tensor.api.base131222111213
Uses a module listed above itPart of a loopThe module itself
1 burn_autodiff.checkpoint.state2 burn_autodiff.grads3 burn_core.module.display4 burn_optim.lr_scheduler.base5 burn_std.distributed6 burn_train.metric.base7 burn_tensor.device8 burn_pack.tensor9 burn_core.module.param.base10 burn_instrument.bounds11 burn_nn.activation.activation_wrapper12 burn_std.tensor.dtype13 burn_train.metric.state14 burn_backend.backend.base15 burn_backend.backend.primitive16 burn_core.module.base17 burn_cubecl_fusion.engine.codegen.ir18 burn_ir.tensor19 burn_nn.initializer20 burn_pack.base21 burn_std.data.tensor.base22 burn_cubecl_fusion.engine.trace.base23 burn_flex.tensor24 burn_ir.handle25 burn_optim.optim.module.module_optimizer26 burn_remote.shared.task27 burn_cubecl.tensor.base28 burn_fusion.stream.context29 burn_train.learner.base30 burn_ir.operation31 burn_std.ops32 burn_autodiff.backend33 burn_dispatch.backend34 burn_flex.backend35 burn_fusion.backend36 burn_tensor.bridge.ops.numeric37 burn_cubecl.backend38 burn_router.backend39 burn_tensor.bridge.kind40 burn_tensor.tensor.api.baseburn_autodiff.checkpoint.state1burn_autodiff.grads2burn_core.module.display3burn_optim.lr_scheduler.base4burn_std.distributed5burn_train.metric.base6burn_tensor.device7burn_pack.tensor8burn_core.module.param.base9burn_instrument.bounds10burn_nn.activation.activation_wrapper11burn_std.tensor.dtype12burn_train.metric.state13burn_backend.backend.base14burn_backend.backend.primitive15burn_core.module.base16burn_cubecl_fusion.engine.codegen.ir17burn_ir.tensor18burn_nn.initializer19burn_pack.base20burn_std.data.tensor.base21burn_cubecl_fusion.engine.trace.base22burn_flex.tensor23burn_ir.handle24burn_optim.optim.module.module_optimizer25burn_remote.shared.task26burn_cubecl.tensor.base27burn_fusion.stream.context28burn_train.learner.base29burn_ir.operation30burn_std.ops31burn_autodiff.backend32burn_dispatch.backend33burn_flex.backend34burn_fusion.backend35burn_tensor.bridge.ops.numeric36burn_cubecl.backend37burn_router.backend38burn_tensor.bridge.kind39burn_tensor.tensor.api.base40211341111136211122212114221232412111311112111112111121102216121213311612133111923211117134211113118111111114211117111321111912343352131222111213+873 more modules (most-connected shown)

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

At a glance — Architecture · 95% · Exemplary ·

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

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

At a glance — Security · 57% · 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 — Injection86High / Critical
A03:2025 — Software Supply Chain Failures23Medium

Roadmap

First, secure the server's transport by enforcing HTTPS with HSTS headers or configuring a TLS-terminating proxy. Next, establish a formal architecture documentation process by recording significant design decisions in a dedicated folder to ensure traceability. Then, centralize access control rules by defining roles and permissions explicitly to make them reviewable and testable. Finally, restrict workflow token permissions in key CI/CD files to strengthen supply-chain provenance and signing.

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.+3.4 ptsLowADR Quality
Resolve the 4 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED.+2.5 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.0 ptsMediumWeb-Security Posture
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED.+1.8 ptsLowStatic Analysis (SAST)
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.2 ptsMediumArchitecture documentation
Resolve the 2 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED.+1.5 ptsLowSupply-chain Provenance & Signing
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.+2.7 ptsMediumAccess Controls
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.+2.5 ptsMediumOutbound HTTP resilience

File quality

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

FileScoreBandWorst signal
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.7MixedStatic Analysis (SAST): High: REDACTED
crates/burn-fusion/src/stream/context.rs5.5MixedGod Classes: MethodTooLong: ModuleOperationIr.to_relative
crates/burn-backend/src/backend/ops/bool_tensor.rs5.5MixedCode Duplication: Duplicated block (6 lines × 3)
crates/burn-router/src/interpreter.rs5.5MixedCyclomatic Complexity: TensorInterpreter::register_op (cyclomatic 338)
crates/burn-nn/src/modules/transformer/decoder.rs5.5MixedCode Duplication: Edited copy of a member (25 corresponding lines)
crates/burn-cubecl/src/kernel/binary.rs5.6MixedCode Duplication: Duplicated block (16 lines × 2)
crates/burn-nn/src/modules/conv/conv2d.rs5.6MixedCode Duplication: Duplicated block (16 lines × 2)
REDACTED5.8MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.8MixedDependency Vulnerabilities: Medium advisory (unsound): REDACTED
crates/burn-nn/src/modules/conv/conv1d.rs5.9MixedCode Duplication: Near-duplicate member family (3 members, 13 shared lines)
crates/burn-ir/src/operation.rs6.0MixedExplicit Debt: TodoComment
crates/burn-cubecl/src/kernel/matmul/tune/base.rs6.0MixedExplicit Debt: TodoComment
crates/burn-autodiff/src/ops/module.rs6.0MixedExplicit Debt: TodoComment
crates/burn-cubecl-fusion/src/optim/reduce/fuser.rs6.0MixedExplicit Debt: TodoComment
crates/burn-flex/src/tensor.rs6.0MixedExplicit Debt: TodoComment

How the grades work

Every finding carries one of four grades. Three say how serious it is. The fourth says this survey could not settle it — and it is a grade, not a gap.

Critical — 88

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

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

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

Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 64 of 64 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.

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

What we checked — 64 dimensions across the health lenses
D1D2D3D4D5D6D9D12D13D14D15D16D17D19D20D23D26D28D29D30D34D35D36D43AX10AX3AX4AX8AX9C2ES1ES2M1M2M3M4P1P10P2P3P4P6P7PF1PF3S1X1X12X13X14X15X17X19X21X22X23X24X25X26X27X28X29X3X30

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

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

Tools & methods

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

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

Every finding is locatable in findings.md. Run 01a17afe-dbf4-72db-98ab-42378aa22304.

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

Run transparency — what happened this run

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

  • D8 Code Coverage — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT READ here — but this repository measures it: a Codecov configuration (codecov.yml, target 80%) and a coverage step in CI (`codecov/codecov-action`) shows that coverage is collected and tracked in your own CI. The built-in collector has no runner for this ecosystem (.rs, .py), so the analyzer could not read the number — a gap in the analyzer's language coverage, not an unmeasured repo. Not scored. To have the real number read, produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`, or `coverage run -m pytest` then `coverage xml`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures. You can widen what we reach: optional: produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`, or `coverage run -m pytest` then `coverage xml`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then the real number is read on the next scan.
  • D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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 — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D21 Naming Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
  • D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D24 Comment Value — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
  • D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • D44 Platform End-of-Life — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This 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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • AXB1 Runtime evidence locked — no reproducible boot — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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. Watchdog then boots 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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and no C#, F#, JavaScript/TypeScript, Dart, Ruby or Scala was found, and this repository's Python, Rust is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and no C#, JavaScript/TypeScript, Java, Dart, Ruby or Scala was found, and this repository's Python, Rust is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • M4 Documentation accuracy — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9). Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • X16 Unfloored truncation loop — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X18 Disposal-pattern correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala or PHP was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax and MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, and Kotlin source only, and no C# was loaded, no TypeScript was found, and this repository's Python, Rust is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
  • 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 is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • 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: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • 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

69 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was TensorInterpreter::register_op at 338. 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 58), 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/pytorch-reader/src/nested/data.rs (NestedValue::fmt at 21), crates/burn-nn/src/activation/activation_wrapper.rs (ActivationConfig::init at 20), 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) · ×21crates/burn-flex/src/ops/reduce.rs:858
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
burn_linalg::cholesky_gpu::panel (cyclomatic 45) · ×4crates/burn-linalg/src/cholesky_gpu.rs:76
burn_cubecl::kernel::matmul::tune::base::matmul_autotune (cyclomatic 39) · ×4crates/burn-cubecl/src/kernel/matmul/tune/base.rs:76
burn_cubecl_fusion::optim::matmul::tune::fused_matmul_autotune (cyclomatic 29) · ×4crates/burn-cubecl-fusion/src/optim/matmul/tune.rs:63

+ 23 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::register_op (cyclomatic 338). — Refactoring it lifts Cyclomatic Complexity from 4.7 to about 5.8/10.
  2. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

161 method(s) exceeded the cognitive complexity threshold of 15; the worst was burn_flex::ops::pool::avg_pool3d_backward_impl at 116.

burn_flex::ops::pool::avg_pool3d_backward_impl (cognitive 116) · ×49crates/burn-flex/src/ops/pool.rs:1434
burn_cubecl::kernel::pool::avg_pool3d::avg_pool3d_backward_kernel (cognitive 74) · ×17crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:133
burn_cubecl_fusion::optim::matmul::tune::fused_matmul_autotune (cognitive 48) · ×12crates/burn-cubecl-fusion/src/optim/matmul/tune.rs:63
burn_vision::backends::cpu::connected_components::spaghetti::process (cognitive 77) · ×8crates/burn-vision/src/backends/cpu/connected_components/spaghetti/mod.rs:32
burn_linalg::cholesky_gpu::panel (cognitive 100) · ×6crates/burn-linalg/src/cholesky_gpu.rs:76

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

What to do

  1. Bring the 13 bodies over 60 down to 60 or less in Cognitive Complexity — start with burn_flex::ops::pool::avg_pool3d_backward_impl (cognitive 116), burn_linalg::cholesky_gpu::panel (cognitive 100), burn_linalg::svd_host::bidiag_host (cognitive 90). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 13 together lifts Cognitive Complexity from 5.9 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
  2. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D3 · God Classes8.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

132 god class(es) detected.

FileTooLong: src/operation.rs · ×52crates/burn-ir/src/operation.rs
FunctionTooLong: burn_cubecl::kernel::matmul::tune::base::matmul_autotune · ×33crates/burn-cubecl/src/kernel/matmul/tune/base.rs:76
MethodTooLong: TensorInterpreter.register_op · ×27crates/burn-router/src/interpreter.rs:239
ClassTooLong: TensorInterpreter · ×11crates/burn-router/src/interpreter.rs:59
TooManyMethods: Tensor · ×6crates/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 52 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 (52 warning-level).
  2. Resolve the 33 FunctionTooLong finding(s) in God Classes — start with conv.rs (4), mod.rs (3), deform_conv.rs (3). — One of this dimension's main actionable groups (33 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).
  4. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D4 · Code Duplication9.1 / 10Stronggated by 575 serious findings✓ Tool-verified

What it measures: Copy-pasted code that should be shared instead.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.

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

537 duplicated block group(s) detected. A further 38 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 5 of the 575 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) · ×44crates/burn-autodiff/src/ops/tensor.rs:828
Duplicated block (9 lines × 2) · ×32crates/burn-autodiff/src/ops/tensor.rs:476
Duplicated block (5 lines × 2) · ×31crates/burn-autodiff/src/ops/tensor.rs:225
Duplicated block (7 lines × 2) · ×30crates/burn-autodiff/src/ops/maxmin.rs:20
Duplicated block (10 lines × 2) · ×25crates/burn-autodiff/src/ops/base.rs:224

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

What to do

  1. Resolve the 44 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with base.rs (4), tensor.rs (3), backend.rs (2). — One of this dimension's main actionable groups (44 warning-level).
  2. Resolve the 32 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with tensor.rs (5), col2im.rs (2), matmul.rs (2). — One of this dimension's main actionable groups (32 warning-level).
  3. Resolve the 31 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with tensor.rs (2), sort.rs (2), lu.rs (2). — One of this dimension's main actionable groups (31 warning-level).
  4. Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

D5 · Coupling8.4 / 10Strong✓ Tool-verified

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

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

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

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

39 production modules (Cargo), 0 dependency cycle(s), 3 unstable depended-on module(s). Read from the build's own module declarations; 4 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 · ×4
Unstable project burn-signal
Unstable project burn-train
Unstable project burn-vision

What to do

  1. Resolve the 4 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (4 warning-level).
  2. Resolve the 1 Unstable project burn-signal finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 Unstable project burn-train finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
  4. Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D6 · Cohesion (LCOM4)9.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 499 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).
  2. Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.

Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.

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

6392 test methods: 3122 unit, 3270 integration, 0 BDD, 0 e2e. The Rust suite contributes 6392 `#[test]` function(s) across 932 file(s) declaring at least one; its unit/integration split is Cargo's own — 524 of those file(s) are integration-test targets under a crate's tests/ directory, and the rest are #[test] functions compiled into the crate they test.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md.

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

What it measures: Whether dependencies are current, secure, and not bloated.

Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.

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

11 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 · ×11

✓ 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 34 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 47 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 (20×338=6760); crates/burn-ir/src/operation.rs (17×76=1292); crates/pytorch-reader/src/pickle_reader.rs (14×68=952) Repeated repair below the complexity floor: crates/burn-autodiff/src/ops/tensor.rs (8 of 14 changes were fixes); crates/burn-tensor/src/tensor/api/check.rs (7 of 13 changes were fixes); crates/burn-tensor/src/tensor/api/orderable.rs (7 of 10 changes were fixes)

Hotspot: crates/burn-router/src/interpreter.rs · ×32crates/burn-router/src/interpreter.rs:239
Repeated repair: crates/burn-autodiff/src/ops/tensor.rs · ×15crates/burn-autodiff/src/ops/tensor.rs:1153

What to do

  1. Resolve the 32 Hotspot finding(s) in Churn × Complexity Hotspots — start with base.rs (5), interpreter.rs, operation.rs. — One of this dimension's main actionable groups (32 warning-level).
  2. Resolve the 15 Repeated repair finding(s) in Churn × Complexity Hotspots — start with tensor.rs (2), lora.rs (2), check.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

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

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

✓ On the Gold path — maintain.

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

D17 · Explicit Debt9.9 / 10Stronggated by 93 serious findings✓ Tool-verified

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

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

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

93 deducted task-comment markers across 311407 LoC (0.0/KLoC) → score 9.9. 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 · ×90xtask/src/commands/test.rs:91
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 90 TodoComment finding(s) in Explicit Debt — start with base.rs (11), builder.rs (9), tensor.rs (4). — One of this dimension's main actionable groups (90 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).
  4. Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

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

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

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

1 of 1 documentation facets pass in full. 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: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.

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

No architecture decision records were found.

No ADRs found

What to do

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d23_recommendation.md.

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

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

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

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

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

86 finding(s): 0 critical, 86 high, 0 medium, 0 low. 84 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. Separately, one or more rules could not re-parse an embedded snippet in 1 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED

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 51 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 (51 issue-level, 0 of them charged here).
  3. No action in Static Analysis (SAST) — all 33 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 (33 issue-level, 0 of them charged here).

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

D30 · Dependency Vulnerabilities7.9 / 10Strong✓ 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.

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

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

REDACTED

What to do

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

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

D34 · Knowledge Freshness9.8 / 10Exemplary✓ Tool-verified

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

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

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

14 of 808 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is crates/burn-communication/src/external_comm.rs. Counted over 808 of the 1175 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned file · ×14crates/burn-communication/src/external_comm.rs:1
Orphaned files with no living knowledge

✓ On the Gold path — maintain.

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

D35 · Change Coupling9.6 / 10Stronggated by 30 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.6 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: int_tensor.rs↔int_tensor.rs 100%; conv1d.rs↔conv2d.rs 83%; dequantize.rs↔quantize.rs 80%

Change coupling: int_tensor.rs ↔ int_tensor.rs · ×28crates/burn-fusion/src/ops/int_tensor.rs:1
Change-coupling hub: interpreter.rs → tensor.rs, module.rs, context.rs, task.rs, module.rs, int.rs · ×2crates/burn-router/src/interpreter.rs

What to do

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

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

D36 · Supply-chain Provenance & 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. Scored 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. SCORED, not informational.

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.

What to do

  • The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

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

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

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

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

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

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

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

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.2 / 10Exemplary✓ Tool-verified

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

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

What to do

  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
  • Add a README to the 14 of 64 project(s) that lack one — worth up to 0.4 pts.
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 repo is organised deliberately — src/test separation and consistent project naming.

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

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

Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).

Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.

P1 · CI/CD 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 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.
  • Consider OpenTelemetry tracing/metrics (opentelemetry with tracing-opentelemetry) and a health-check endpoint (a /health route on your axum/actix router) for operability.
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 the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

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.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reference — by lens

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

LensScoreRatingImpact
Code Health89%ExemplarySolid.
Architecture95%ExemplarySolid.
Maturity69%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness61%Adequate — gated by P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security57%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 — 13 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 — 53 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.
  • AC7 A11y enforcement — 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 — ~92600 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 is measured on C# only; JavaScript, Python, Rust, html 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# and Visual Basic comments only — this repository's production source is .py, .rs, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • 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 included — suite not readable by the collector
  • 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); 66 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 — no coverage report found on disk — produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
  • PF2 Allocation hygiene — Not applicable: Rust spells out every heap allocation and makes borrowed slices (&[T], &str) its ordinary parameter types, so the allocation-aware style this card rewards elsewhere is the language's baseline rather than a rung to climb.
  • X16 Unfloored truncation loop — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X18 Disposal-pattern correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X2 Cancellation propagation — no C# was loaded; this repository's Python and Rust were read, and no request in it can be cancelled by a caller — a Python request takes no token: asyncio cancels the task and trio or anyio the scope that made it, from outside the call, and requests, httpx, aiohttp and gRPC take a timeout, not a cancellation; a Rust request takes no token: a future is cancelled by dropping it, from outside the call (select!, a timeout, an aborted task), and reqwest, hyper and tonic take none
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X4 Structured logging — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Rust was read, and it logs through none: the `log` crate's macros take one finished message (as log4net does in C#; its `kv` values are an opt-in its backends mostly drop), `println!`/`eprintln!` are not loggers, or it makes no log call outside its tests and examples at all. Calls through `tracing` (`tracing::info!`, or `info!` imported from it) would be judged.
  • X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X7 Silent fallback defaults — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

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

Critical — 88 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
  • + 26 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
  • + 8 more in this group — see findings.md.
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
Serious — 1139 finding(s)
D17 · Explicit Debt · TodoComment · ×90
  • TodoComment xtask/src/commands/test.rs:91 — // 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:393 — // 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:480 — // 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/bleu.rs:291 — // TODO: Epoch-level aggregation averages batch BLEU scores, which is — 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/learning_rate.rs:41 — // TODO: We only log the default learning rate. Yet another motivation to introduce metric groups. — 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/learning_rate.rs:73 — // TODO: LR should probably just report the current value, the aggregated values don't make as much sense esp. for visualization — 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:159 — // 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:1207 — // 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:3292 — // 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:294 — // 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:339 — // 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-router/src/bridge/base.rs:31 — // TODO: change_backend_quantized — 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.
  • + 65 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×52
  • FileTooLong: src/operation.rs crates/burn-ir/src/operation.rs — FileTooLong — 3453 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 2953 over it, 6.91× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: ops/tensor.rs crates/burn-autodiff/src/ops/tensor.rs — FileTooLong — 3252 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 (109-4885). The bar is 500 significant lines; this is 2752 over it, 6.50× 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 — 2052 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 (17-3046). The bar is 500 significant lines; this is 1552 over it, 4.10× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: ops/module.rs crates/burn-autodiff/src/ops/module.rs — FileTooLong — 1778 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 94% of them inside a single declaration: Autodiff (18-2332). The bar is 500 significant lines; this is 1278 over it, 3.56× 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 — 1741 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, 59-2383). The bar is 500 significant lines; this is 1241 over it, 3.48× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: ops/int_tensor.rs crates/burn-fusion/src/ops/int_tensor.rs — FileTooLong — 1692 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 (17-2519). The bar is 500 significant lines; this is 1192 over it, 3.38× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: 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/module.rs crates/burn-fusion/src/ops/module.rs — FileTooLong — 1495 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 (39-1968). The bar is 500 significant lines; this is 995 over it, 2.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/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: stream/context.rs crates/burn-fusion/src/stream/context.rs — FileTooLong — 1267 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 767 over it, 2.53× 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 — 1226 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 76 free functions. The bar is 500 significant lines; this is 726 over it, 2.45× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/builder.rs crates/burn-ir/src/builder.rs — FileTooLong — 1226 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 726 over it, 2.45× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: ops/tensor.rs crates/burn-router/src/ops/tensor.rs — FileTooLong — 1177 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 (22-1681). The bar is 500 significant lines; this is 677 over it, 2.35× 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: 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 — 1129 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 66% of them inside a single declaration: Tensor (7 blocks, 76-3785). The bar is 500 significant lines; this is 629 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/gather_scatter.rs crates/burn-flex/src/ops/gather_scatter.rs — FileTooLong — 1026 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 43 free functions. The bar is 500 significant lines; this is 526 over it, 2.05× 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 — 1010 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 (14-1301). The bar is 500 significant lines; this is 510 over it, 2.02× 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.rs crates/burn-flex/src/ops/int.rs — FileTooLong — 976 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 94% of them inside a single declaration: Flex (94-1449). The bar is 500 significant lines; this is 476 over it, 1.95× 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 — 949 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 (21-1358). The bar is 500 significant lines; this is 449 over it, 1.90× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: api/check.rs crates/burn-tensor/src/tensor/api/check.rs — FileTooLong — 916 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 94% of them inside a single declaration: TensorCheck (2 blocks, 35-1434). The bar is 500 significant lines; this is 416 over it, 1.83× 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: tensor/module.rs crates/burn-tensor/src/tensor/module.rs — FileTooLong — 902 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 402 over it, 1.80× 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/routing.rs crates/burn-backend-extension/src/routing.rs — FileTooLong — 880 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 380 over it, 1.76× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: ops/float.rs crates/burn-flex/src/ops/float.rs — FileTooLong — 859 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 (49-1314). The bar is 500 significant lines; this is 359 over it, 1.72× 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.
  • + 27 more in this group — see findings.md.
D2 · Cognitive Complexity · burn_flex · ×49
  • burn_flex::ops::pool::avg_pool3d_backward_impl (cognitive 116) crates/burn-flex/src/ops/pool.rs:1434 — 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:803 — 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::pool::adaptive_avg_pool3d_impl (cognitive 57) crates/burn-flex/src/ops/pool.rs:993 — 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::attention::flash_attention_head (cognitive 46) crates/burn-flex/src/ops/attention.rs:533 — burn_flex::ops::attention::flash_attention_head has cognitive complexity 46 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 8 (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.
  • 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:651 — 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:806 — 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:689 — 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:1628 — 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:281 — 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:1030 — 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:46 — 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:245 — 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::conv::conv_plane_accumulate_kh_outer (cognitive 26) crates/burn-flex/src/ops/conv.rs:1310 — burn_flex::ops::conv::conv_plane_accumulate_kh_outer has cognitive complexity 26 (threshold 15). Drivers by points: loops 5 (16 pts), if/else 4 (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::fft::rfft_fiber (cognitive 25) crates/burn-flex/src/ops/fft.rs:753 — burn_flex::ops::fft::rfft_fiber has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 3 (8 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.
  • + 24 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×44
  • Duplicated block (8 lines × 2) crates/burn-autodiff/src/ops/tensor.rs:828 — crates/burn-autodiff/src/ops/tensor.rs:828-835 | crates/burn-autodiff/src/ops/tensor.rs:4550-4558 — both copies are in the same file, so extract the block into 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-autodiff/src/ops/tensor.rs:1326 — crates/burn-autodiff/src/ops/tensor.rs:1326-1333 | crates/burn-autodiff/src/ops/tensor.rs:1634-1641 — both copies are in the same file, so extract the block into 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-autodiff/src/ops/tensor.rs:3063 — crates/burn-autodiff/src/ops/tensor.rs:3063-3070 | crates/burn-autodiff/src/ops/tensor.rs:3130-3137 — both copies are in the same file, so extract the block into 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-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.
  • 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.
  • Duplicated block (8 lines × 2) crates/burn-cubecl/src/kernel/conv/forward/depthwise.rs:48 — crates/burn-cubecl/src/kernel/conv/forward/depthwise.rs:48-55 | 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.
  • 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/index/gather_nd.rs:67 — crates/burn-cubecl/src/kernel/index/gather_nd.rs:67-74 | crates/burn-cubecl/src/kernel/index/scatter_nd.rs:101-108 — 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 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) crates/burn-cubecl/src/kernel/index/slice.rs:212 — crates/burn-cubecl/src/kernel/index/slice.rs:212-219 | crates/burn-cubecl/src/kernel/index/slice_assign.rs:210-217 — 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 4 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.
  • Duplicated block (8 lines × 2) crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:263 — crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:263-270 | crates/burn-cubecl/src/kernel/pool/max_pool3d.rs:228-235 — 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 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) crates/burn-cubecl/src/kernel/pool/base.rs:41 — crates/burn-cubecl/src/kernel/pool/base.rs:41-48 | crates/burn-cubecl/src/kernel/pool/base.rs:203-210 — both copies are in the same file, so extract the block into 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-dispatch/src/backend.rs:364 — crates/burn-dispatch/src/backend.rs:364-371 | crates/burn-dispatch/src/backend.rs:406-413 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) crates/burn-dispatch/src/backend.rs:663 — crates/burn-dispatch/src/backend.rs:663-670 | crates/burn-dispatch/src/backend.rs:691-698 — both copies are in the same file, so extract the block into 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/attention.rs:362 — crates/burn-flex/src/ops/attention.rs:362-369 | crates/burn-flex/src/ops/attention.rs:857-864 — both copies are in the same file, so extract the block into 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:864 — crates/burn-flex/src/ops/gather_scatter.rs:864-871 | crates/burn-flex/src/ops/gather_scatter.rs:875-882 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • 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.
  • 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.
  • 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.
  • Duplicated block (8 lines × 2) crates/burn-flex/src/simd/portable.rs:813 — crates/burn-flex/src/simd/portable.rs:813-820 | crates/burn-flex/src/simd/portable.rs:856-863 — both copies are in the same file, so extract the block into 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/simd/portable.rs:822 — crates/burn-flex/src/simd/portable.rs:822-829 | crates/burn-flex/src/simd/portable.rs:864-871 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • 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.
  • 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.
  • + 19 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×33
  • FunctionTooLong: burn_cubecl::kernel::matmul::tune::base::matmul_autotune crates/burn-cubecl/src/kernel/matmul/tune/base.rs:76 — FunctionTooLong — burn_cubecl::kernel::matmul::tune::base::matmul_autotune runs 323 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 223 over it, 3.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.
  • FunctionTooLong: burn_backend_extension::fusion::expand_method crates/burn-backend-extension/src/fusion.rs:60 — FunctionTooLong — burn_backend_extension::fusion::expand_method 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.
  • 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_cubecl_fusion::optim::matmul::tune::fused_matmul_autotune crates/burn-cubecl-fusion/src/optim/matmul/tune.rs:63 — FunctionTooLong — burn_cubecl_fusion::optim::matmul::tune::fused_matmul_autotune runs 143 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 43 over it, 1.43× 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_backend_extension::fusion::derive_adapter crates/burn-backend-extension/src/fusion.rs:621 — FunctionTooLong — burn_backend_extension::fusion::derive_adapter 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_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_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_naive_impl crates/burn-flex/src/ops/attention.rs:741 — FunctionTooLong — burn_flex::ops::attention::attention_naive_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_flex::ops::attention::attention_impl crates/burn-flex/src/ops/attention.rs:248 — FunctionTooLong — burn_flex::ops::attention::attention_impl runs 126 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 26 over it, 1.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.
  • 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_flex::ops::attention::flash_attention_head crates/burn-flex/src/ops/attention.rs:533 — FunctionTooLong — burn_flex::ops::attention::flash_attention_head runs 115 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 15 over it, 1.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • 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.
  • FunctionTooLong: burn_flex::ops::conv::conv3d_small_channel_impl crates/burn-flex/src/ops/conv.rs:1618 — FunctionTooLong — burn_flex::ops::conv::conv3d_small_channel_impl 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.
  • + 8 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×32
  • Hotspot: crates/burn-router/src/interpreter.rs crates/burn-router/src/interpreter.rs:239 — crates/burn-router/src/interpreter.rs changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 338 in TensorInterpreter::register_op at line 239. 2 of those changes were fix/bug commits, and the other 18 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04: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:4485 — crates/burn-ir/src/operation.rs changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 76 in ModuleOperationIr::visit_mut at line 4485. 1 of those changes was a fix/bug commit, and the other 16 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04: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 14 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 11 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04: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-fusion/src/stream/context.rs crates/burn-fusion/src/stream/context.rs:217 — crates/burn-fusion/src/stream/context.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 58 in ModuleOperationIr::to_relative at line 217. 1 of those changes was a fix/bug commit, and the other 11 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04:00' --full-history --no-merges -- crates/burn-fusion/src/stream/context.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/int.rs crates/burn-flex/src/ops/int.rs:197 — crates/burn-flex/src/ops/int.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 45 in Flex::int_scatter at line 197. 5 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04:00' --full-history --no-merges -- crates/burn-flex/src/ops/int.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:232 — crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 37 in burn_cubecl_fusion::engine::codegen::kernel::fuse at line 232. 7 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04: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-cubecl-fusion/src/engine/codegen/ir.rs crates/burn-cubecl-fusion/src/engine/codegen/ir.rs:214 — crates/burn-cubecl-fusion/src/engine/codegen/ir.rs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in FuseOp::fmt at line 214. 3 of those changes were fix/bug commits, and the other 7 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04:00' --full-history --no-merges -- crates/burn-cubecl-fusion/src/engine/codegen/ir.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: xtask/src/commands/test.rs xtask/src/commands/test.rs:380 — xtask/src/commands/test.rs changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in xtask::commands::test::handle_command at line 380. 6 of those changes were fix/bug commits, and the other 14 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04:00' --full-history --no-merges -- xtask/src/commands/test.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-tensor/src/tensor/api/base.rs crates/burn-tensor/src/tensor/api/base.rs:3294 — crates/burn-tensor/src/tensor/api/base.rs changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in DataIterFmt::next at line 3294. 7 of those changes were fix/bug commits, and the other 16 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04:00' --full-history --no-merges -- crates/burn-tensor/src/tensor/api/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/float.rs crates/burn-flex/src/ops/float.rs:308 — crates/burn-flex/src/ops/float.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in Flex::float_scatter at line 308. 6 of those changes were fix/bug commits, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04:00' --full-history --no-merges -- crates/burn-flex/src/ops/float.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 8 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. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04: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-cubecl/src/ops/base.rs crates/burn-cubecl/src/ops/base.rs:340 — 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 340. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04: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-cubecl/src/kernel/matmul/tune/base.rs crates/burn-cubecl/src/kernel/matmul/tune/base.rs:76 — crates/burn-cubecl/src/kernel/matmul/tune/base.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in burn_cubecl::kernel::matmul::tune::base::matmul_autotune at line 76. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04:00' --full-history --no-merges -- crates/burn-cubecl/src/kernel/matmul/tune/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/pool.rs crates/burn-flex/src/ops/pool.rs:1434 — crates/burn-flex/src/ops/pool.rs changed 9 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 1434. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04: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-std/src/data/tensor/base.rs crates/burn-std/src/data/tensor/base.rs:731 — crates/burn-std/src/data/tensor/base.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in TensorData::fmt at line 731. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04: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.
  • 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 6 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. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04: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-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 4 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04: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-cubecl-fusion/src/optim/matmul/tune.rs crates/burn-cubecl-fusion/src/optim/matmul/tune.rs:63 — crates/burn-cubecl-fusion/src/optim/matmul/tune.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in burn_cubecl_fusion::optim::matmul::tune::fused_matmul_autotune at line 63. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04:00' --full-history --no-merges -- crates/burn-cubecl-fusion/src/optim/matmul/tune.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/qtensor.rs crates/burn-cubecl/src/ops/qtensor.rs:84 — crates/burn-cubecl/src/ops/qtensor.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in burn_cubecl::ops::qtensor::new_quantized at line 84. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04:00' --full-history --no-merges -- crates/burn-cubecl/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.
  • Hotspot: crates/burn-cubecl/src/kernel/unary_float.rs crates/burn-cubecl/src/kernel/unary_float.rs:161 — crates/burn-cubecl/src/kernel/unary_float.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in BasicFloatUnary::execute at line 161. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04:00' --full-history --no-merges -- crates/burn-cubecl/src/kernel/unary_float.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 6 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04: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 4 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04: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/src/kernel/reduce/base.rs crates/burn-cubecl/src/kernel/reduce/base.rs:481 — crates/burn-cubecl/src/kernel/reduce/base.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in burn_cubecl::kernel::reduce::base::reduce_dim_with_indices at line 481. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04:00' --full-history --no-merges -- crates/burn-cubecl/src/kernel/reduce/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-cubecl/src/kernel/ctc.rs crates/burn-cubecl/src/kernel/ctc.rs:394 — crates/burn-cubecl/src/kernel/ctc.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in burn_cubecl::kernel::ctc::ctc_alpha_beta_kernel at line 394. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04:00' --full-history --no-merges -- crates/burn-cubecl/src/kernel/ctc.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:236 — crates/burn-remote/src/server/worker.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in SessionHandler::process_task at line 236. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04: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.
  • + 7 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×32
  • Duplicated block (9 lines × 2) crates/burn-autodiff/src/ops/tensor.rs:476 — crates/burn-autodiff/src/ops/tensor.rs:476-484 | crates/burn-autodiff/src/ops/tensor.rs:574-582 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) crates/burn-autodiff/src/ops/tensor.rs:1526 — crates/burn-autodiff/src/ops/tensor.rs:1526-1534 | crates/burn-autodiff/src/ops/tensor.rs:1771-1779 — both copies are in the same file, so extract the block into 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-autodiff/src/ops/tensor.rs:2334 — crates/burn-autodiff/src/ops/tensor.rs:2334-2342 | crates/burn-autodiff/src/ops/tensor.rs:2396-2404 — both copies are in the same file, so extract the block into 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-autodiff/src/ops/tensor.rs:2670 — crates/burn-autodiff/src/ops/tensor.rs:2670-2678 | crates/burn-autodiff/src/ops/tensor.rs:2707-2715 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • 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.
  • 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.
  • 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.
  • 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:104-112 — 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/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:164 — crates/burn-cubecl/src/kernel/comparison.rs:164-172 | crates/burn-cubecl/src/kernel/comparison.rs:252-260 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • 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.
  • 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/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.
  • 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:71-79 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (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-derive/src/shared/attribute.rs:40 — crates/burn-derive/src/shared/attribute.rs:40-48 | crates/burn-derive/src/shared/field.rs:59-67 — 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-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.
  • 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.
  • 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.
  • Duplicated block (9 lines × 2) crates/burn-flex/src/ops/pool.rs:357 — crates/burn-flex/src/ops/pool.rs:357-365 | crates/burn-flex/src/ops/pool.rs:803-811 — both copies are in the same file, so extract the block into 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-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.
  • 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.
  • Duplicated block (9 lines × 2) crates/burn-flex/src/ops/unary.rs:186 — crates/burn-flex/src/ops/unary.rs:186-194 | crates/burn-flex/src/ops/unary.rs:217-225 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) crates/burn-flex/src/simd/portable.rs:369 — crates/burn-flex/src/simd/portable.rs:369-377 | crates/burn-flex/src/simd/portable.rs:418-426 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • + 7 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×31
  • Duplicated block (5 lines × 2) crates/burn-autodiff/src/ops/tensor.rs:225 — crates/burn-autodiff/src/ops/tensor.rs:225-229 | crates/burn-autodiff/src/ops/tensor.rs:294-298 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) crates/burn-autodiff/src/ops/tensor.rs:1096 — crates/burn-autodiff/src/ops/tensor.rs:1096-1100 | crates/burn-autodiff/src/ops/tensor.rs:4633-4637 — both copies are in the same file, so extract the block into 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-backend/src/backend/ops/modules/conv.rs:434 — crates/burn-backend/src/backend/ops/modules/conv.rs:434-438 | crates/burn-backend/src/backend/ops/modules/conv.rs:734-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.
  • 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.
  • Duplicated block (5 lines × 2) crates/burn-cubecl/src/kernel/conv/deform_conv_transpose2d.rs:381 — crates/burn-cubecl/src/kernel/conv/deform_conv_transpose2d.rs:381-385 | crates/burn-cubecl/src/kernel/conv/deform_conv_transpose2d.rs:627-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.
  • Duplicated block (5 lines × 2) crates/burn-cubecl/src/kernel/index/slice.rs:206 — crates/burn-cubecl/src/kernel/index/slice.rs:206-210 | crates/burn-cubecl/src/kernel/index/slice_assign.rs:204-208 — 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 4 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.
  • Duplicated block (5 lines × 2) crates/burn-flex/src/ops/binary.rs:229 — crates/burn-flex/src/ops/binary.rs:229-233 | 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.
  • Duplicated block (5 lines × 2) crates/burn-flex/src/ops/gather_scatter.rs:1233 — crates/burn-flex/src/ops/gather_scatter.rs:1233-1237 | crates/burn-flex/src/ops/gather_scatter.rs:1305-1309 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) crates/burn-flex/src/ops/pool.rs:273 — crates/burn-flex/src/ops/pool.rs:273-277 | crates/burn-flex/src/ops/pool.rs:723-727 — both copies are in the same file, so extract the block into 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-flex/src/ops/reduce.rs:732 — crates/burn-flex/src/ops/reduce.rs:732-736 | crates/burn-flex/src/ops/reduce.rs:792-796 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (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.
  • 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-linalg/src/functions/lu.rs:140 — crates/burn-linalg/src/functions/lu.rs:140-144 | crates/burn-linalg/src/functions/lu.rs:249-253 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) crates/burn-linalg/src/functions/lu.rs:298 — crates/burn-linalg/src/functions/lu.rs:298-304 | 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.
  • 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.
  • 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.
  • Duplicated block (5 lines × 2) crates/burn-store/src/pytorch/store.rs:42 — crates/burn-store/src/pytorch/store.rs:42-46 | crates/burn-store/src/safetensors/store.rs:56-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.
  • Duplicated block (5 lines × 2) crates/burn-train/src/metric/processor/minimal.rs:75 — crates/burn-train/src/metric/processor/minimal.rs:75-79 | crates/burn-train/src/metric/processor/minimal.rs:134-138 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) crates/burn-train/src/renderer/cli.rs:45 — crates/burn-train/src/renderer/cli.rs:45-49 | crates/burn-train/src/renderer/tui/renderer.rs:254-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.
  • 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.
  • Duplicated block (5 lines × 2) crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:1155 — crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:1155-1159 | 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.
  • 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.
  • + 6 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×30
  • Duplicated block (7 lines × 2) crates/burn-autodiff/src/ops/maxmin.rs:20 — crates/burn-autodiff/src/ops/maxmin.rs:20-26 | crates/burn-autodiff/src/ops/sort.rs:20-26 — 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-autodiff/src/ops/tensor.rs:3034 — crates/burn-autodiff/src/ops/tensor.rs:3034-3040 | crates/burn-autodiff/src/ops/tensor.rs:3101-3107 — both copies are in the same file, so extract the block into 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-backend-extension/src/derive.rs:237 — crates/burn-backend-extension/src/derive.rs:237-243 | crates/burn-backend-extension/src/derive.rs:263-269 — both copies are in the same file, so extract the block into 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-backend/src/backend/ops/collective.rs:289 — crates/burn-backend/src/backend/ops/collective.rs:289-295 | crates/burn-backend/src/backend/ops/collective.rs:316-322 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • 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.
  • 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.
  • 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.
  • 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.
  • Duplicated block (7 lines × 2) crates/burn-cubecl-fusion/src/optim/matmul/optimization.rs:344 — crates/burn-cubecl-fusion/src/optim/matmul/optimization.rs:344-350 | crates/burn-cubecl-fusion/src/optim/matmul/optimization.rs:352-358 — both copies are in the same file, so extract the block into 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/comparison.rs:248 — crates/burn-cubecl/src/kernel/comparison.rs:248-254 | crates/burn-cubecl/src/kernel/unary_int.rs:48-54 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • 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.
  • 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:263 — crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:263-269 | crates/burn-cubecl/src/kernel/pool/max_pool3d.rs:114-120 — 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 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (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.
  • Duplicated block (7 lines × 2) crates/burn-flex/src/ops/binary.rs:165 — crates/burn-flex/src/ops/binary.rs:165-182 | crates/burn-flex/src/ops/binary.rs:185-191 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • 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.
  • 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.
  • 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.
  • 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.
  • Duplicated block (7 lines × 2) crates/burn-flex/src/tensor.rs:656 — crates/burn-flex/src/tensor.rs:656-662 | crates/burn-flex/src/tensor.rs:673-679 — both copies are in the same file, so extract the block into 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-ir/src/builder.rs:582 — crates/burn-ir/src/builder.rs:582-588 | crates/burn-ir/src/builder.rs:1567-1574 — both copies are in the same file, so extract the block into 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/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/cpu/morphology/filter.rs:235 — crates/burn-vision/src/backends/cpu/morphology/filter.rs:235-241 | crates/burn-vision/src/backends/cpu/morphology/filter.rs:354-360 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) 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.
  • + 5 more in this group — see findings.md.
D35 · Change Coupling · Change coupling · ×28
  • 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 83% of the time (20 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 20 shared commits counted here, the most recent 3 are `7b815b01` feat(backend)!: support asymmetric padding in conv1d and conv2d (#5521); `f6754f53` fix(nn): conv1d initializer fan out (#4973); `c0c12f53` [Breaking] Add asymmetric padding support for conv and pool operation… — 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 77% of the time (10 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — 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 `9ef29431` Qa/tiled storage (#5839); `df92ec07` Feat/storage tiled carrier (#5631); `d45b2ac0` perf(cube): pooling and interpolate optimization (#5112) — 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: 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 72% of the time (13 of the 18 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 `d17b8eda` feat(tensor): add 3D pooling (`avg_pool3d`, `max_pool3d`) (#5801); `7d4839a9` feat(nn): add AdaptiveAvgPool3d module (#5115); `b71e848b` Add ctc_loss backend trait hook + tch and cubecl impls (#4819) — 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: 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: 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 61% of the time (14 of the 23 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 14 shared commits counted here, the most recent 3 are `0fa63b3e` Chore/cubecl adaptive pool (#5797); `d0365962` Feat/profiling (#5726); `7bbf4d43` Let a caller install and read a device's memory pools (#5425) — 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 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `42bee66b` perf(remote): read a transaction's tensors in one request (#5983); `d0365962` Feat/profiling (#5726); `d4260ad9` Add device dtype usage (#4404) — 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 58% of the time (14 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 14 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…; `a30a9214` docs(tensor): fix unfold window formula (#5559) — 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: 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: 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: 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 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 `d17b8eda` feat(tensor): add 3D pooling (`avg_pool3d`, `max_pool3d`) (#5801); `0e31c3d8` refactor(nn): add functional `batch_norm` forward operation (#5347); `7d4839a9` feat(nn): add AdaptiveAvgPool3d module (#5115) — 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 56% of the time (10 of the 18 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: 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: 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 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 `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`); `bdec8d58` [Refactor - JIT] Gather Scatter new implementations (#1356) (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: 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 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 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 13 shared commits counted here, the most recent 3 are `a30a9214` docs(tensor): fix unfold window formula (#5559); `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`) — 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: 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: 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: client.rs ↔ multi.rs crates/burn-fusion/src/client.rs:1 — `crates/burn-fusion/src/client.rs` and `crates/burn-fusion/src/stream/multi.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 `7bc1dd62` perf(fusion): defer a cross-thread drop until its producer runs inste…; `d0365962` Feat/profiling (#5726); `3fb74589` fix(fusion): a panicking operation must not poison its stream (#5535) — run `git show` on any of them.
  • Change coupling: linear.rs ↔ layer.rs crates/burn-nn/src/modules/linear.rs:1 — `crates/burn-nn/src/modules/linear.rs` and `crates/burn-nn/src/modules/norm/layer.rs` change together 50% of the time (8 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — 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/linear.rs` and `crates/burn-core/src/nn/norm/layer.rs`); `37b79bcc` Add init_with for nn modules (#280) (at that commit the files were still `burn-core/src/nn/linear.rs` and `burn-core/src/nn/norm/layer.rs`); `7d750468` Refactor/init modules (#250) (at that commit the files were still `burn-core/src/nn/linear.rs` and `burn-core/src/nn/norm/layer.rs`) — run `git show` on any of them.
  • + 3 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×27
  • MethodTooLong: TensorInterpreter.register_op crates/burn-router/src/interpreter.rs:239 — MethodTooLong — register_op runs 1516 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 1416 over it, 15.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ModuleOperationIr.to_relative crates/burn-fusion/src/stream/context.rs:217 — MethodTooLong — to_relative runs 422 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 322 over it, 4.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: Autodiff.float_select_assign crates/burn-autodiff/src/ops/tensor.rs:1873 — 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: ModuleOperationIr.visit_mut crates/burn-ir/src/operation.rs:4485 — MethodTooLong — visit_mut runs 293 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 193 over it, 2.93× 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:1153 — MethodTooLong — to_relative runs 245 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 145 over it, 2.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Autodiff.deform_conv2d crates/burn-autodiff/src/ops/module.rs:678 — 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: FusedMatmulLaunch.matmul_fused crates/burn-cubecl-fusion/src/optim/matmul/optimization.rs:427 — MethodTooLong — matmul_fused runs 224 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 124 over it, 2.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ModuleOperationIr.mark_read_only crates/burn-ir/src/operation.rs:4173 — MethodTooLong — mark_read_only runs 224 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 124 over it, 2.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Autodiff.float_scatter crates/burn-autodiff/src/ops/tensor.rs:1153 — 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:1464 — 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:2950 — MethodTooLong — visit_mut runs 199 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 99 over it, 1.99× 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: SessionHandler.process_task crates/burn-remote/src/server/worker.rs:236 — MethodTooLong — process_task 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.
  • 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:1468 — 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:747 — MethodTooLong — to_relative runs 133 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 33 over it, 1.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: NumericOperationIr.mark_read_only crates/burn-ir/src/operation.rs:2767 — 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: FloatOperationIr.visit_mut crates/burn-ir/src/operation.rs:3411 — MethodTooLong — visit_mut 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:429 — 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:2492 — 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:1000 — 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.
  • + 2 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×25
  • 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:1066 — crates/burn-autodiff/src/ops/tensor.rs:1066-1075 | crates/burn-autodiff/src/ops/tensor.rs:4593-4602 — both copies are in the same file, so extract the block into 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:1773 — crates/burn-autodiff/src/ops/tensor.rs:1773-1782 | crates/burn-autodiff/src/ops/tensor.rs:2336-2345 — both copies are in the same file, so extract the block into 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-cubecl-fusion/src/engine/trace/block.rs:191 — crates/burn-cubecl-fusion/src/engine/trace/block.rs:191-200 | crates/burn-cubecl-fusion/src/engine/trace/block.rs:309-318 — both copies are in the same file, so extract the block into 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-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.
  • 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:361-370 — 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-flex/src/ops/binary.rs:77 — crates/burn-flex/src/ops/binary.rs:77-86 | crates/burn-flex/src/ops/binary.rs:102-111 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) crates/burn-flex/src/ops/interpolate.rs:235 — crates/burn-flex/src/ops/interpolate.rs:235-244 | crates/burn-flex/src/ops/interpolate.rs:857-866 — both copies are in the same file, so extract the block into 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/interpolate.rs:540 — crates/burn-flex/src/ops/interpolate.rs:540-549 | crates/burn-flex/src/ops/interpolate.rs:756-765 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) crates/burn-flex/src/ops/interpolate.rs:617 — crates/burn-flex/src/ops/interpolate.rs:617-626 | crates/burn-flex/src/ops/interpolate.rs:808-817 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) crates/burn-flex/src/ops/pool.rs:796 — crates/burn-flex/src/ops/pool.rs:796-805 | crates/burn-flex/src/ops/pool.rs:1066-1075 — both copies are in the same file, so extract the block into 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: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.
  • 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-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.
  • 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.
  • 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:96-105 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs:137 — crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs:137-146 | crates/burn-train/src/learner/supervised/strategies/single/epoch.rs:157-167 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) crates/burn-train/src/metric/processor/full.rs:286 — crates/burn-train/src/metric/processor/full.rs:286-295 | crates/burn-train/src/metric/processor/minimal.rs:83-92 — before extracting anything, compare `crates/burn-train/src/metric/processor/full.rs` and `crates/burn-train/src/metric/processor/minimal.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) crates/burn-train/src/metric/processor/full.rs:356 — crates/burn-train/src/metric/processor/full.rs:356-365 | crates/burn-train/src/metric/processor/minimal.rs:142-151 — before extracting anything, compare `crates/burn-train/src/metric/processor/full.rs` and `crates/burn-train/src/metric/processor/minimal.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) 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:120-129 — 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-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.
  • Duplicated block (10 lines × 2) crates/burn-tensor/src/tensor/module.rs:437 — crates/burn-tensor/src/tensor/module.rs:437-446 | crates/burn-tensor/src/tensor/module.rs:962-971 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (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-autodiff/src/ops/tensor.rs:3341 — crates/burn-autodiff/src/ops/tensor.rs:3341-3346 | crates/burn-flex/src/ops/float.rs:1254-1259 — 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-cubecl-fusion/src/optim/matmul/tune.rs:71 — crates/burn-cubecl-fusion/src/optim/matmul/tune.rs:71-76 | crates/burn-cubecl/src/kernel/matmul/tune/base.rs:96-101 — 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-cubecl-fusion/src/optim/reduce/optimization.rs:356 — crates/burn-cubecl-fusion/src/optim/reduce/optimization.rs:356-361 | crates/burn-cubecl-fusion/src/optim/reduce_broadcasted/launch.rs:59-64 — 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-cubecl/src/kernel/binary.rs:228 — crates/burn-cubecl/src/kernel/binary.rs:228-233 | crates/burn-cubecl/src/kernel/binary_float.rs:148-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.
  • Duplicated block (6 lines × 2) crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:64 — crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:64-69 | crates/burn-cubecl/src/kernel/pool/max_pool3d.rs:72-77 — 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 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) crates/burn-cubecl/src/kernel/unary_float.rs:52 — crates/burn-cubecl/src/kernel/unary_float.rs:52-58 | crates/burn-cubecl/src/kernel/unary_numeric.rs:52-57 — 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 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) crates/burn-cubecl/src/kernel/unary_float.rs:200 — crates/burn-cubecl/src/kernel/unary_float.rs:200-205 | crates/burn-cubecl/src/kernel/unary_float.rs:215-220 — both copies are in the same file, so extract the block into 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/bool.rs:150 — crates/burn-flex/src/ops/bool.rs:150-156 | 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.
  • Duplicated block (6 lines × 2) crates/burn-flex/src/ops/interpolate.rs:555 — crates/burn-flex/src/ops/interpolate.rs:555-560 | crates/burn-flex/src/ops/interpolate.rs:767-772 — both copies are in the same file, so extract the block into 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/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.
  • 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.
  • 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.
  • Duplicated block (6 lines × 2) crates/burn-linalg/src/functions/det.rs:98 — crates/burn-linalg/src/functions/det.rs:98-103 | crates/burn-linalg/src/functions/det.rs:108-113 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (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-vision/src/backends/cpu/morphology/filter.rs:276 — crates/burn-vision/src/backends/cpu/morphology/filter.rs:276-281 | crates/burn-vision/src/backends/cpu/morphology/filter.rs:375-380 — both copies are in the same file, so extract the block into 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/processor/metrics.rs:75 — crates/burn-train/src/metric/processor/metrics.rs:75-80 | 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.
  • 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.
  • 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.
  • 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-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:167 — crates/burn-nn/src/modules/conv/conv2d.rs:167-172 | crates/burn-nn/src/modules/conv/conv3d.rs:164-169 — 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.
D1 · Cyclomatic Complexity · burn_flex · ×21
  • 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:1434 — 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 20) crates/burn-flex/src/ops/attention.rs:533 — burn_flex::ops::attention::flash_attention_head has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • burn_flex::tensor::copy_2d_tiled (cyclomatic 20) crates/burn-flex/src/tensor.rs:803 — 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:442 — 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:651 — 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::gather_scatter::gather_2d (cyclomatic 16) crates/burn-flex/src/ops/gather_scatter.rs:281 — 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.
D2 · Cognitive Complexity · burn_cubecl · ×17
  • burn_cubecl::kernel::pool::avg_pool3d::avg_pool3d_backward_kernel (cognitive 74) crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:133 — burn_cubecl::kernel::pool::avg_pool3d::avg_pool3d_backward_kernel has cognitive complexity 74 (threshold 15). Drivers by points: if/else 20 (62 pts), loops 3 (9 pts), boolean chains 3 (nesting depth added 48). 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::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::matmul::tune::base::matmul_autotune (cognitive 58) crates/burn-cubecl/src/kernel/matmul/tune/base.rs:76 — burn_cubecl::kernel::matmul::tune::base::matmul_autotune has cognitive complexity 58 (threshold 15). Drivers by points: if/else 27 (35 pts), match/switch 9 (13 pts), boolean chains 5, loops 4 (5 pts) (nesting depth added 13). Of this number, 56 points are the body's own statements and 2 belong to one function item inside it that branches. 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_cubecl::kernel::pool::avg_pool3d::avg_pool3d_forward_kernel (cognitive 51) crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:28 — 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::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:340 — 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:129 — 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::ops::base::expand (cognitive 22) crates/burn-cubecl/src/ops/base.rs:253 — burn_cubecl::ops::base::expand has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 2, loops 1 (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.
  • burn_cubecl::kernel::reduce::tune::with_routine_tunables (cognitive 21) crates/burn-cubecl/src/kernel/reduce/tune.rs:55 — 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:517 — 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 · Duplicated block (11 lines × 2) · ×16
  • Duplicated block (11 lines × 2) crates/burn-autodiff/src/ops/tensor.rs:4417 — crates/burn-autodiff/src/ops/tensor.rs:4417-4427 | crates/burn-autodiff/src/ops/tensor.rs:4491-4501 — both copies are in the same file, so extract the block into 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.
  • 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.
  • Duplicated block (11 lines × 2) crates/burn-cubecl/src/kernel/comparison.rs:210 — crates/burn-cubecl/src/kernel/comparison.rs:210-220 | crates/burn-cubecl/src/kernel/comparison.rs:277-287 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) crates/burn-cubecl/src/kernel/conv/backward_weight/tune.rs:131 — crates/burn-cubecl/src/kernel/conv/backward_weight/tune.rs:131-141 | crates/burn-cubecl/src/kernel/conv/forward/tune.rs:174-184 — `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 4 separate duplicated blocks between them, totalling at least 45 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so 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-dispatch/src/backend.rs:490 — crates/burn-dispatch/src/backend.rs:490-500 | crates/burn-dispatch/src/backend.rs:619-629 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) crates/burn-flex/src/ops/activation.rs:658 — crates/burn-flex/src/ops/activation.rs:658-668 | crates/burn-flex/src/ops/activation.rs:787-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.
  • 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:752-762 — both copies are in the same file, so extract the block into 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/gather_scatter.rs:720 — crates/burn-flex/src/ops/gather_scatter.rs:720-730 | crates/burn-flex/src/ops/gather_scatter.rs:738-748 — both copies are in the same file, so extract the block into 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/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.
  • 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.
  • Duplicated block (11 lines × 2) crates/burn-ir/src/builder.rs:1650 — crates/burn-ir/src/builder.rs:1650-1660 | crates/burn-ir/src/builder.rs:1687-1697 — both copies are in the same file, so extract the block into 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:87 — crates/burn-train/src/metric/vision/fid/inception.rs:87-97 | crates/burn-train/src/metric/vision/fid/inception.rs:212-222 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) crates/burn-train/src/renderer/tui/full_history.rs:126 — crates/burn-train/src/renderer/tui/full_history.rs:126-136 | crates/burn-train/src/renderer/tui/recent_history.rs:95-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.
  • 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.
  • Duplicated block (11 lines × 2) xtask/src/commands/test.rs:507 — xtask/src/commands/test.rs:507-517 | xtask/src/commands/test.rs:534-544 — both copies are in the same file, so extract the 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 · Repeated repair · ×15
  • Repeated repair: crates/burn-autodiff/src/ops/tensor.rs crates/burn-autodiff/src/ops/tensor.rs:1153 — 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 1153), 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04: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-tensor/src/tensor/api/check.rs crates/burn-tensor/src/tensor/api/check.rs:938 — crates/burn-tensor/src/tensor/api/check.rs changed 13 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 10 (its worst body is TensorCheck::scatter_nd at line 938), 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): validate Shape rank in expand (#6211)”; “fix(tensor): use a Shape reshape target as given (#6112)”; “test: remove redundant tests and fix tests that did not exercise their names (#6066)”; “fix(tensor): return off-value rows for out-of-range one_hot_fill indices (#6065)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04:00' --full-history --no-merges -- crates/burn-tensor/src/tensor/api/check.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 10 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is burn_tensor::tensor::api::orderable::one_hot_classes at line 1223), 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04: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-core/src/module/lora.rs crates/burn-core/src/module/lora.rs:94 — crates/burn-core/src/module/lora.rs changed 11 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is Lora::reparameterize at line 94), 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: reject zero LoRA rank (#6110)”; “fix(tensor): make TensorData fields private and validate construction (#5838)”; “fix(module): preserve reparameterizations during validation (#5821)”; “fix(module): preserve LoRA factor dtype when composing weights (#5365)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04:00' --full-history --no-merges -- crates/burn-core/src/module/lora.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), 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04: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), 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04: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), 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04: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_broadcasted/optimization.rs crates/burn-cubecl-fusion/src/optim/reduce_broadcasted/optimization.rs:164 — 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 164), 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04: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-autodiff/src/tensor.rs crates/burn-autodiff/src/tensor.rs:188 — crates/burn-autodiff/src/tensor.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 3 (its worst body is AutodiffTensor::require_grad at line 188), 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(autodiff): explicitly reject consumed graph reuse and preserve reusable leaves (#5645)”; “fix(autodiff)!: retain input nodes until child registration (#5647)”; “fix(no-std): use shared sync primitives across crates (#5543)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04:00' --full-history --no-merges -- crates/burn-autodiff/src/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-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), 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04: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), 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04: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-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), 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04: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-core/src/module/param/lora.rs crates/burn-core/src/module/param/lora.rs:27 — crates/burn-core/src/module/param/lora.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 3 (its worst body is LoraAdapter::apply at line 27), 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(module): preserve reparameterizations during validation (#5821)”; “fix(module): preserve LoRA factor dtype when composing weights (#5365)”; “fix(module): build LoRA factors at an explicit dtype over a packed base (#5364)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04:00' --full-history --no-merges -- crates/burn-core/src/module/param/lora.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/stream/queue/execution.rs crates/burn-fusion/src/stream/queue/execution.rs:174 — crates/burn-fusion/src/stream/queue/execution.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 5 (its worst body is OperationQueue::drain_queue at line 174), 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): a panicking operation must not poison its stream (#5535)”; “fix!: address fusion and autodiff edge cases (#5400)”; “Fix/fusion read composition (#5282)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04:00' --full-history --no-merges -- crates/burn-fusion/src/stream/queue/execution.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), 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 17:36:51 -04:00' --until='2026-10-26 17:36:51 -04: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.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×14
  • 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.
  • 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/conv/forward/depthwise.rs:66 — crates/burn-cubecl/src/kernel/conv/forward/depthwise.rs:66-77 | crates/burn-cubecl/src/kernel/conv/forward/implicit_gemm/launch.rs:123-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.
  • Duplicated block (12 lines × 2) crates/burn-cubecl/src/kernel/reduce/base.rs:439 — crates/burn-cubecl/src/kernel/reduce/base.rs:439-450 | crates/burn-cubecl/src/kernel/reduce/base.rs:551-562 — both copies are in the same file, so extract the block into 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-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.
  • 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.
  • Duplicated block (12 lines × 2) crates/burn-flex/src/ops/bool.rs:463 — crates/burn-flex/src/ops/bool.rs:463-474 | crates/burn-flex/src/ops/bool.rs:481-492 — both copies are in the same file, so extract the block into 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-flex/src/ops/pool.rs:1463 — crates/burn-flex/src/ops/pool.rs:1463-1474 | crates/burn-flex/src/ops/pool.rs:1649-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 (12 lines × 2) crates/burn-flex/src/ops/pool.rs:1534 — crates/burn-flex/src/ops/pool.rs:1534-1545 | crates/burn-flex/src/ops/pool.rs:1684-1695 — both copies are in the same file, so extract the block into 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-flex/src/simd/kernels.rs:209 — crates/burn-flex/src/simd/kernels.rs:209-220 | crates/burn-flex/src/simd/kernels.rs:249-260 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • 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.
  • Duplicated block (12 lines × 2) crates/burn-train/src/metric/processor/full.rs:317 — crates/burn-train/src/metric/processor/full.rs:317-328 | crates/burn-train/src/metric/processor/minimal.rs:109-120 — before extracting anything, compare `crates/burn-train/src/metric/processor/full.rs` and `crates/burn-train/src/metric/processor/minimal.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) crates/burn-train/src/metric/processor/metrics.rs:224 — crates/burn-train/src/metric/processor/metrics.rs:224-235 | crates/burn-train/src/metric/processor/metrics.rs:256-267 — both copies are in the same file, so extract the 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 (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.
  • 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.
  • Duplicated block (16 lines × 2) crates/burn-cubecl-fusion/src/optim/matmul/tune.rs:36 — crates/burn-cubecl-fusion/src/optim/matmul/tune.rs:36-51 | crates/burn-cubecl/src/kernel/matmul/tune/base.rs:54-69 — 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 (16 lines × 2) crates/burn-cubecl/src/kernel/binary.rs:282 — crates/burn-cubecl/src/kernel/binary.rs:282-297 | crates/burn-cubecl/src/kernel/binary_float.rs:202-217 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (16 lines × 2) crates/burn-cubecl/src/kernel/pool/max_pool3d.rs:301 — crates/burn-cubecl/src/kernel/pool/max_pool3d.rs:301-316 | crates/burn-cubecl/src/kernel/pool/max_pool3d.rs:362-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.
  • 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 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (16 lines × 2) crates/burn-dispatch/src/backend.rs:388 — crates/burn-dispatch/src/backend.rs:388-403 | crates/burn-dispatch/src/backend.rs:430-445 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) crates/burn-flex/src/ops/activation.rs:329 — crates/burn-flex/src/ops/activation.rs:329-344 | crates/burn-flex/src/ops/activation.rs:483-498 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) 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.
  • 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.
  • Duplicated block (16 lines × 2) crates/burn-flex/src/simd/kernels.rs:230 — crates/burn-flex/src/simd/kernels.rs:230-245 | crates/burn-flex/src/simd/kernels.rs:270-285 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) 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:83-98 — 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.
  • 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.
D2 · Cognitive Complexity · burn_cubecl_fusion · ×12
  • burn_cubecl_fusion::optim::matmul::tune::fused_matmul_autotune (cognitive 48) crates/burn-cubecl-fusion/src/optim/matmul/tune.rs:63 — burn_cubecl_fusion::optim::matmul::tune::fused_matmul_autotune has cognitive complexity 48 (threshold 15). Drivers by points: if/else 21 (29 pts), match/switch 7 (12 pts), loops 4 (5 pts), boolean chains 2 (nesting depth added 14). Of this number, 46 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • 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:758 — 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:602 — 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.
D3 · God Classes · ClassTooLong · ×11
  • ClassTooLong: TensorInterpreter crates/burn-router/src/interpreter.rs:59 — ClassTooLong — 1667 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 24 methods, 4 blocks, lines 59-2383. The bar is 400 significant lines; this is 1267 over it, 4.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: TensorCheck crates/burn-tensor/src/tensor/api/check.rs:35 — ClassTooLong — 857 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 48 methods, 2 blocks, lines 35-1434. The bar is 400 significant lines; this is 457 over it, 2.14× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ModuleOperationIr crates/burn-ir/src/operation.rs:223 — ClassTooLong — 833 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 223-4856. The bar is 400 significant lines; this is 433 over it, 2.08× 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 — 745 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-3785. The bar is 400 significant lines; this is 345 over it, 1.86× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ModuleOps crates/burn-backend/src/backend/ops/modules/base.rs:144 — ClassTooLong — 609 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 65 methods. The bar is 400 significant lines; this is 209 over it, 1.52× 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: 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: NumericOperationIr crates/burn-ir/src/operation.rs:532 — 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), 4 methods, 2 blocks, lines 532-3208. 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: FloatTensorOps crates/burn-backend/src/backend/ops/tensor.rs:14 — ClassTooLong — 427 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 27 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.
  • ClassTooLong: Dispatch crates/burn-dispatch/src/backend.rs:157 — ClassTooLong — 418 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 23 methods, 6 blocks, lines 160-1178. The bar is 400 significant lines; this is 18 over it, 1.05× 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:78 — ClassTooLong — 401 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 34 methods, 5 blocks, lines 78-853. The bar is 400 significant lines; this is 1 over it, 1.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D30 · Dependency Vulnerabilities · Medium advisory (unsound) · ×11
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×11
  • Duplicated block (9 lines × 3) crates/burn-autodiff/src/ops/tensor.rs:462 — crates/burn-autodiff/src/ops/tensor.rs:462-470 | crates/burn-autodiff/src/ops/tensor.rs:560-568 | crates/burn-autodiff/src/ops/tensor.rs:741-749 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (9 lines × 3) crates/burn-autodiff/src/ops/tensor.rs:1018 — crates/burn-autodiff/src/ops/tensor.rs:1018-1026 | crates/burn-autodiff/src/ops/tensor.rs:2815-2823 | crates/burn-autodiff/src/ops/tensor.rs:4777-4785 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (9 lines × 3) crates/burn-fusion/src/stream/context.rs:441 — crates/burn-fusion/src/stream/context.rs:441-449 | crates/burn-fusion/src/stream/context.rs:453-461 | crates/burn-fusion/src/stream/context.rs:474-482 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (9 lines × 3) crates/burn-fusion/src/stream/context.rs:537 — crates/burn-fusion/src/stream/context.rs:537-545 | crates/burn-fusion/src/stream/context.rs:571-579 | crates/burn-fusion/src/stream/context.rs:605-613 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (9 lines × 3) crates/burn-fusion/src/stream/context.rs:550 — crates/burn-fusion/src/stream/context.rs:550-558 | crates/burn-fusion/src/stream/context.rs:584-592 | crates/burn-fusion/src/stream/context.rs:618-626 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (9 lines × 3) 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.
  • Duplicated block (9 lines × 3) crates/burn-train/src/metric/vision/lpips/metric.rs:301 — crates/burn-train/src/metric/vision/lpips/metric.rs:301-309 | crates/burn-train/src/metric/vision/lpips/metric.rs:326-334 | crates/burn-train/src/metric/vision/lpips/metric.rs:351-359 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (9 lines × 3) 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.
  • 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.
  • Duplicated block (9 lines × 3) crates/burn-nn/src/modules/conv/conv1d.rs:172 — crates/burn-nn/src/modules/conv/conv1d.rs:172-180 | crates/burn-nn/src/modules/conv/conv2d.rs:196-204 | crates/burn-nn/src/modules/conv/conv3d.rs:180-188 — 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.
  • Duplicated block (9 lines × 3) crates/burn-flex/src/tensor.rs:164 — crates/burn-flex/src/tensor.rs:164-172 | crates/burn-flex/src/tensor.rs:188-196 | crates/burn-flex/src/tensor.rs:210-218 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×11
  • Duplicated block (6 lines × 3) crates/burn-backend/src/backend/ops/bool_tensor.rs:208 — crates/burn-backend/src/backend/ops/bool_tensor.rs:208-213 | crates/burn-backend/src/backend/ops/int_tensor.rs:170-175 | crates/burn-backend/src/backend/ops/tensor.rs:624-629 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (6 lines × 3) crates/burn-flex/src/ops/conv_common.rs:70 — crates/burn-flex/src/ops/conv_common.rs:70-75 | crates/burn-flex/src/ops/interpolate.rs:1127-1132 | crates/burn-flex/src/ops/pool.rs:1759-1764 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (6 lines × 3) crates/burn-flex/src/ops/conv_common.rs:80 — crates/burn-flex/src/ops/conv_common.rs:80-85 | crates/burn-flex/src/ops/interpolate.rs:1138-1143 | crates/burn-flex/src/ops/pool.rs:1769-1774 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (6 lines × 3) crates/burn-flex/src/ops/int.rs:1104 — crates/burn-flex/src/ops/int.rs:1104-1109 | crates/burn-flex/src/ops/int.rs:1119-1124 | crates/burn-flex/src/ops/int.rs:1134-1139 — all 3 copies are in the same file, so extract the block into one function there and call it from 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-flex/src/ops/pool.rs:357 — crates/burn-flex/src/ops/pool.rs:357-362 | crates/burn-flex/src/ops/pool.rs:803-808 | crates/burn-flex/src/ops/pool.rs:1073-1078 — all 3 copies are in the same file, so extract the block into one function there and call it from 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-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.
  • 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.
  • 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.
  • 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:1625-1630 — 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 (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.
  • 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.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×10
  • 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.
  • Duplicated block (8 lines × 3) crates/burn-flex/src/ops/fft.rs:855 — crates/burn-flex/src/ops/fft.rs:855-863 | crates/burn-flex/src/ops/fft.rs:1052-1059 | crates/burn-flex/src/ops/fft.rs:1435-1444 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 3) crates/burn-flex/src/ops/int.rs:1032 — crates/burn-flex/src/ops/int.rs:1032-1039 | crates/burn-flex/src/ops/int.rs:1047-1054 | crates/burn-flex/src/ops/int.rs:1062-1069 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 3) crates/burn-flex/src/ops/pool.rs:1239 — crates/burn-flex/src/ops/pool.rs:1239-1246 | crates/burn-flex/src/ops/pool.rs:1449-1456 | crates/burn-flex/src/ops/pool.rs:1639-1646 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 3) crates/burn-fusion/src/stream/context.rs:688 — crates/burn-fusion/src/stream/context.rs:688-695 | crates/burn-fusion/src/stream/context.rs:707-714 | crates/burn-fusion/src/stream/context.rs:726-733 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 3) crates/burn-train/src/metric/vision/fid/inception.rs:57 — crates/burn-train/src/metric/vision/fid/inception.rs:57-64 | crates/burn-train/src/metric/vision/fid/inception.rs:113-120 | crates/burn-train/src/metric/vision/fid/inception.rs:307-314 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 3) 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.
  • 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.
  • 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.
  • 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.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×10
  • Duplicated block (5 lines × 3) crates/burn-autodiff/src/ops/module.rs:708 — crates/burn-autodiff/src/ops/module.rs:708-712 | crates/burn-autodiff/src/ops/module.rs:749-754 | crates/burn-autodiff/src/ops/module.rs:785-790 — all 3 copies are in the same file, so extract the block into one function there and call it from 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-autodiff/src/ops/module.rs:2347 — crates/burn-autodiff/src/ops/module.rs:2347-2351 | crates/burn-autodiff/src/ops/module.rs:2389-2393 | crates/burn-autodiff/src/ops/module.rs:2431-2435 — all 3 copies are in the same file, so extract the block into one function there and call it from 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-cubecl/src/kernel/binary.rs:303 — crates/burn-cubecl/src/kernel/binary.rs:303-308 | 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 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 3) crates/burn-flex/src/ops/fft.rs:287 — crates/burn-flex/src/ops/fft.rs:287-291 | crates/burn-flex/src/ops/fft.rs:304-308 | crates/burn-flex/src/ops/fft.rs:322-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 (5 lines × 3) crates/burn-flex/src/ops/int.rs:1031 — crates/burn-flex/src/ops/int.rs:1031-1035 | crates/burn-flex/src/ops/int.rs:1046-1050 | crates/burn-flex/src/ops/int.rs:1137-1141 — all 3 copies are in the same file, so extract the block into one function there and call it from 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:1030 — crates/burn-flex/src/ops/int.rs:1030-1034 | crates/burn-flex/src/ops/int.rs:1121-1125 | crates/burn-flex/src/ops/int.rs:1136-1140 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • 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.
  • Duplicated block (5 lines × 3) crates/burn-router/src/interpreter.rs:1585 — crates/burn-router/src/interpreter.rs:1585-1589 | crates/burn-router/src/interpreter.rs:1626-1630 | crates/burn-router/src/interpreter.rs:1667-1671 — all 3 copies are in the same file, so extract the block into one function there and call it from 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-train/src/metric/processor/minimal.rs:123 — crates/burn-train/src/metric/processor/minimal.rs:123-127 | 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:59 — crates/burn-backend-extension/src/lib.rs:59-63 | crates/burn-backend-extension/src/lib.rs:191-195 | 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.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×9
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/burn-autodiff/src/ops/tensor.rs:236 — crates/burn-autodiff/src/ops/tensor.rs:236-261 | crates/burn-autodiff/src/ops/tensor.rs:305-330 | crates/burn-autodiff/src/ops/tensor.rs:592-617 | crates/burn-autodiff/src/ops/tensor.rs:683-708 — 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:3165 — crates/burn-autodiff/src/ops/tensor.rs:3165-3180 | crates/burn-autodiff/src/ops/tensor.rs:4318-4333 | crates/burn-autodiff/src/ops/tensor.rs:4362-4377 | crates/burn-autodiff/src/ops/tensor.rs:4644-4665 — 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:35 — crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:35-130 | crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:140-270 | crates/burn-cubecl/src/kernel/pool/max_pool3d.rs:38-126 | crates/burn-cubecl/src/kernel/pool/max_pool3d.rs:136-235 — 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:454 — crates/burn-flex/src/ops/pool.rs:454-465 | crates/burn-flex/src/ops/pool.rs:475-486 | crates/burn-flex/src/ops/pool.rs:496-507 | crates/burn-flex/src/ops/pool.rs:517-528 — 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:480 — crates/burn-flex/src/simd/portable.rs:480-500 | crates/burn-flex/src/simd/portable.rs:525-545 | crates/burn-flex/src/simd/portable.rs:807-832 | crates/burn-flex/src/simd/portable.rs:851-874 — 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:323 — crates/burn-fusion/src/client.rs:323-356 | crates/burn-fusion/src/client.rs:367-400 | crates/burn-fusion/src/client.rs:411-444 | crates/burn-fusion/src/client.rs:455-488 — 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 · Duplicated block (14 lines × 2) · ×9
  • Duplicated block (14 lines × 2) crates/burn-autodiff/src/ops/module.rs:319 — crates/burn-autodiff/src/ops/module.rs:319-332 | crates/burn-autodiff/src/ops/module.rs:356-369 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • 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.
  • Duplicated block (14 lines × 2) crates/burn-cubecl/src/kernel/pool/base.rs:51 — crates/burn-cubecl/src/kernel/pool/base.rs:51-64 | crates/burn-cubecl/src/kernel/pool/base.rs:213-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.
  • Duplicated block (14 lines × 2) crates/burn-cubecl/src/kernel/reduce/tune.rs:230 — crates/burn-cubecl/src/kernel/reduce/tune.rs:230-243 | crates/burn-cubecl/src/kernel/reduce/tune.rs:320-333 — both copies are in the same file, so extract the block into 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-flex/src/ops/attention.rs:385 — crates/burn-flex/src/ops/attention.rs:385-398 | crates/burn-flex/src/ops/attention.rs:882-895 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) crates/burn-flex/src/ops/attention.rs:400 — crates/burn-flex/src/ops/attention.rs:400-413 | 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.
  • Duplicated block (14 lines × 2) crates/burn-flex/src/ops/interpolate.rs:280 — crates/burn-flex/src/ops/interpolate.rs:280-293 | crates/burn-flex/src/ops/interpolate.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.
  • Duplicated block (14 lines × 2) crates/burn-flex/src/ops/pool.rs:1239 — crates/burn-flex/src/ops/pool.rs:1239-1252 | crates/burn-flex/src/ops/pool.rs:1639-1652 — both copies are in the same file, so extract the block into 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-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:191-204 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D2 · Cognitive Complexity · burn_vision · ×8
  • 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::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.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×8
  • Duplicated block (18 lines × 2) crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:281 — crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:281-298 | crates/burn-cubecl/src/kernel/pool/base.rs:188-205 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (18 lines × 2) 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.
  • 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/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.
  • 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.
  • 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.
  • 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.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×8
  • Duplicated block (13 lines × 2) crates/burn-autodiff/src/ops/module.rs:180 — crates/burn-autodiff/src/ops/module.rs:180-192 | crates/burn-autodiff/src/ops/module.rs:213-225 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • 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/pool.rs:1078 — crates/burn-flex/src/ops/pool.rs:1078-1090 | crates/burn-flex/src/ops/pool.rs:1663-1675 — both copies are in the same file, so extract the block into 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.
  • 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.
  • 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.
  • 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.
  • 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.
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.
  • 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.
  • 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.
  • Duplicated block (11 lines × 3) crates/burn-router/src/interpreter.rs:1928 — crates/burn-router/src/interpreter.rs:1928-1938 | crates/burn-router/src/interpreter.rs:1973-1983 | crates/burn-router/src/interpreter.rs:2018-2028 — all 3 copies are in the same file, so extract the block into one function there and call it from 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-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.
  • Duplicated block (11 lines × 3) crates/burn-backend/src/backend/ops/bool_tensor.rs:317 — crates/burn-backend/src/backend/ops/bool_tensor.rs:317-327 | crates/burn-backend/src/backend/ops/int_tensor.rs:250-260 | crates/burn-backend/src/backend/ops/tensor.rs:161-171 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (11 lines × 3) crates/burn-cubecl/src/kernel/pool/base.rs:58 — crates/burn-cubecl/src/kernel/pool/base.rs:58-68 | crates/burn-cubecl/src/kernel/pool/base.rs:220-230 | crates/burn-cubecl/src/kernel/pool/base.rs:344-354 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×8
  • Duplicated block (7 lines × 3) crates/burn-autodiff/src/ops/module.rs:1687 — crates/burn-autodiff/src/ops/module.rs:1687-1693 | crates/burn-autodiff/src/ops/module.rs:1817-1823 | crates/burn-autodiff/src/ops/module.rs:1938-1944 — all 3 copies are in the same file, so extract the block into one function there and call it from 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-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:46-52 | crates/burn-cubecl/src/kernel/index/scatter_nd.rs:60-66 — 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 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (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:1248 — crates/burn-flex/src/ops/pool.rs:1248-1254 | crates/burn-flex/src/ops/pool.rs:1462-1468 | crates/burn-flex/src/ops/pool.rs:1648-1654 — all 3 copies are in the same file, so extract the block into one function there and call it from 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/reduce.rs:1238 — crates/burn-flex/src/ops/reduce.rs:1238-1244 | crates/burn-flex/src/ops/reduce.rs:1320-1326 | crates/burn-flex/src/ops/reduce.rs:1389-1395 — all 3 copies are in the same file, so extract the block into one function there and call it from 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-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.
  • Duplicated block (7 lines × 3) crates/burn-flex/src/ops/bool.rs:387 — crates/burn-flex/src/ops/bool.rs:387-393 | crates/burn-flex/src/ops/float.rs:1200-1206 | crates/burn-flex/src/ops/int.rs:1339-1345 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (7 lines × 3) 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:263-269 | crates/burn-cubecl/src/kernel/pool/base.rs:374-380 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (19 lines × 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.
  • 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.
  • 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 4 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.
  • Duplicated block (19 lines × 2) crates/burn-derive/src/config/analyzer_struct.rs:277 — crates/burn-derive/src/config/analyzer_struct.rs:277-295 | crates/burn-derive/src/config/analyzer_struct.rs:302-320 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (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.
  • Duplicated block (19 lines × 2) crates/burn-flex/src/ops/gather_scatter.rs:1101 — crates/burn-flex/src/ops/gather_scatter.rs:1101-1119 | crates/burn-flex/src/ops/gather_scatter.rs:1147-1165 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (19 lines × 2) crates/burn-flex/src/ops/interpolate.rs:215 — crates/burn-flex/src/ops/interpolate.rs:215-233 | crates/burn-flex/src/ops/interpolate.rs:837-855 — both copies are in the same file, so extract the 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 × 2) · ×7
  • Duplicated block (15 lines × 2) crates/burn-autodiff/src/ops/tensor.rs:201 — crates/burn-autodiff/src/ops/tensor.rs:201-215 | crates/burn-autodiff/src/ops/tensor.rs:270-284 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) crates/burn-autodiff/src/ops/tensor.rs:543 — crates/burn-autodiff/src/ops/tensor.rs:543-557 | crates/burn-autodiff/src/ops/tensor.rs:636-650 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • 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.
  • Duplicated block (15 lines × 2) crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:353 — crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:353-367 | crates/burn-cubecl/src/kernel/pool/max_pool3d.rs:333-347 — 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 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) crates/burn-flex/src/ops/bool.rs:65 — crates/burn-flex/src/ops/bool.rs:65-79 | crates/burn-flex/src/ops/float.rs:137-151 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (15 lines × 2) 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.
  • 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.
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.
D2 · Cognitive Complexity · burn_linalg · ×6
  • 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::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::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::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.
D3 · God Classes · TooManyMethods · ×6
  • 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: TensorCheck crates/burn-tensor/src/tensor/api/check.rs:35 — TooManyMethods — 48 methods. The bar is 30 methods; this is 18 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Device crates/burn-tensor/src/device.rs:97 — TooManyMethods — 43 methods, declared across 4 files: src/device.rs (40), src/group.rs (1), src/remote.rs (1), src/wgpu.rs (1). The bar is 30 methods; this is 13 over it, 1.43× 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. Most of these members implement device.Device (43 of 43 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
  • TooManyMethods: RemoteService crates/burn-remote/src/client/service.rs:78 — 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: 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.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×6
  • Duplicated block (12 lines × 3) crates/burn-autodiff/src/ops/tensor.rs:203 — crates/burn-autodiff/src/ops/tensor.rs:203-214 | crates/burn-autodiff/src/ops/tensor.rs:272-283 | crates/burn-autodiff/src/ops/tensor.rs:1911-1922 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (12 lines × 3) 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.
  • Duplicated block (12 lines × 3) crates/burn-flex/src/ops/attention.rs:580 — crates/burn-flex/src/ops/attention.rs:580-591 | crates/burn-flex/src/ops/attention.rs:939-950 | crates/burn-flex/src/ops/attention.rs:1011-1022 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (12 lines × 3) crates/burn-flex/src/ops/gather_scatter.rs:756 — crates/burn-flex/src/ops/gather_scatter.rs:756-767 | crates/burn-flex/src/ops/gather_scatter.rs:1106-1117 | crates/burn-flex/src/ops/gather_scatter.rs:1152-1163 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (12 lines × 3) crates/burn-tensor/src/tensor/module.rs:559 — crates/burn-tensor/src/tensor/module.rs:559-570 | crates/burn-tensor/src/tensor/module.rs:603-614 | crates/burn-tensor/src/tensor/module.rs:1002-1013 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (12 lines × 3) 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 3 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×6
  • 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:473 — crates/burn-cubecl-fusion/src/optim/reduce/optimization.rs:473-483 | 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.
  • 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.
  • Duplicated block (10–11 lines × 2) crates/burn-flex/src/ops/gather_scatter.rs:568 — crates/burn-flex/src/ops/gather_scatter.rs:568-577 | crates/burn-flex/src/ops/gather_scatter.rs:1121-1131 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • 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.
  • Duplicated block (10–11 lines × 2) crates/burn-train/src/learner/supervised/strategies/ddp/epoch.rs:159 — crates/burn-train/src/learner/supervised/strategies/ddp/epoch.rs:159-168 | crates/burn-train/src/learner/supervised/strategies/single/epoch.rs:163-173 — `crates/burn-train/src/learner/supervised/strategies/ddp/epoch.rs` and `crates/burn-train/src/learner/supervised/strategies/single/epoch.rs` are one unit implemented 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 61 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×6
  • Duplicated block (10 lines × 3) crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs:208 — crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs:208-217 | crates/burn-cubecl/src/kernel/conv/backward_weight/tune.rs:184-193 | crates/burn-cubecl/src/kernel/conv/forward/tune.rs:224-233 — `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 5 separate duplicated blocks between them, totalling at least 77 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (10 lines × 3) 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:242-251 | crates/burn-cubecl/src/kernel/pool/base.rs:359-368 — all 3 copies are in the same file, so extract the block into one function there and call it from 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/interpolate.rs:389 — crates/burn-flex/src/ops/interpolate.rs:389-398 | crates/burn-flex/src/ops/interpolate.rs:598-607 | crates/burn-flex/src/ops/interpolate.rs:789-798 — all 3 copies are in the same file, so extract the block into one function there and call it from 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/pool.rs:258 — crates/burn-flex/src/ops/pool.rs:258-267 | crates/burn-flex/src/ops/pool.rs:704-713 | crates/burn-flex/src/ops/pool.rs:1004-1013 — all 3 copies are in the same file, so extract the block into one function there and call it from 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-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_numeric.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • 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.
D2 · Cognitive Complexity · burn_backend_extension · ×5
  • burn_backend_extension::fusion::expand_method (cognitive 88) crates/burn-backend-extension/src/fusion.rs:60 — burn_backend_extension::fusion::expand_method has cognitive complexity 88 (threshold 15). Drivers by points: if/else 41 (71 pts), match/switch 5 (7 pts), boolean chains 6, loops 3 (4 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • 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:142 — 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:120 — 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::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.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×5
  • Duplicated block (13–14 lines × 2) crates/burn-autodiff/src/ops/module.rs:442 — crates/burn-autodiff/src/ops/module.rs:442-455 | crates/burn-autodiff/src/ops/module.rs:483-495 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13–14 lines × 2) crates/burn-autodiff/src/ops/module.rs:1030 — crates/burn-autodiff/src/ops/module.rs:1030-1043 | crates/burn-autodiff/src/ops/module.rs:1071-1083 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13–14 lines × 2) crates/burn-autodiff/src/ops/module.rs:1293 — crates/burn-autodiff/src/ops/module.rs:1293-1306 | crates/burn-autodiff/src/ops/module.rs:1334-1346 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13–14 lines × 2) crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:681 — crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:681-693 | crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:808-821 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13–14 lines × 2) 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.
D1 · Cyclomatic Complexity · burn_linalg · ×4
  • 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::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::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::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.
D1 · Cyclomatic Complexity · burn_cubecl · ×4
  • burn_cubecl::kernel::matmul::tune::base::matmul_autotune (cyclomatic 39) crates/burn-cubecl/src/kernel/matmul/tune/base.rs:76 — burn_cubecl::kernel::matmul::tune::base::matmul_autotune has cyclomatic complexity 39 (threshold 15). Of this number, 38 points are the body's own statements and 1 belongs to one function item inside it that branches. 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_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:340 — 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.
  • burn_cubecl::kernel::pool::avg_pool3d::avg_pool3d_backward_kernel (cyclomatic 20) crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:133 — burn_cubecl::kernel::pool::avg_pool3d::avg_pool3d_backward_kernel has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · burn_cubecl_fusion · ×4
  • burn_cubecl_fusion::optim::matmul::tune::fused_matmul_autotune (cyclomatic 29) crates/burn-cubecl-fusion/src/optim/matmul/tune.rs:63 — burn_cubecl_fusion::optim::matmul::tune::fused_matmul_autotune has cyclomatic complexity 29 (threshold 15). Of this number, 28 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • 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.
D36 · Supply-chain Provenance & Signing REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×4
  • Duplicated block (17 lines × 2) crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:326 — crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:326-342 | crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:377-393 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (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.
  • 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:166-182 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2) crates/burn-vision/src/backends/cpu/connected_components/spaghetti/mod.rs:148 — crates/burn-vision/src/backends/cpu/connected_components/spaghetti/mod.rs:148-164 | crates/burn-vision/src/backends/cpu/connected_components/spaghetti/mod.rs:228-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.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×4
  • Duplicated block (14–15 lines × 2) crates/burn-autodiff/src/ops/module.rs:577 — crates/burn-autodiff/src/ops/module.rs:577-591 | crates/burn-autodiff/src/ops/module.rs:615-628 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14–15 lines × 2) crates/burn-autodiff/src/ops/module.rs:1167 — crates/burn-autodiff/src/ops/module.rs:1167-1181 | crates/burn-autodiff/src/ops/module.rs:1205-1218 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14–15 lines × 2) 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:154-167 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (14–15 lines × 2) crates/burn-flex/src/ops/gather_scatter.rs:319 — crates/burn-flex/src/ops/gather_scatter.rs:319-332 | crates/burn-flex/src/ops/gather_scatter.rs:336-350 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×4
  • Duplicated block (13 lines × 3) crates/burn-autodiff/src/ops/module.rs:1434 — crates/burn-autodiff/src/ops/module.rs:1434-1446 | crates/burn-autodiff/src/ops/module.rs:1512-1524 | crates/burn-autodiff/src/ops/module.rs:1602-1614 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (13 lines × 3) crates/burn-autodiff/src/ops/module.rs:2054 — crates/burn-autodiff/src/ops/module.rs:2054-2066 | crates/burn-autodiff/src/ops/module.rs:2093-2105 | crates/burn-autodiff/src/ops/module.rs:2139-2151 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (13 lines × 3) 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.
  • 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:91-103 | 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 (8–9 lines × 2) · ×4
  • Duplicated block (8–9 lines × 2) crates/burn-autodiff/src/ops/module.rs:238 — crates/burn-autodiff/src/ops/module.rs:238-246 | crates/burn-autodiff/src/ops/module.rs:258-265 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8–9 lines × 2) 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-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.
  • Duplicated block (8–9 lines × 2) crates/burn-store/src/adapter.rs:639 — crates/burn-store/src/adapter.rs:639-646 | crates/pytorch-reader/src/pickle_reader.rs:969-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.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×4
  • Duplicated block (5 lines × 4) crates/burn-autodiff/src/ops/tensor.rs:375 — crates/burn-autodiff/src/ops/tensor.rs:375-379 | crates/burn-autodiff/src/ops/tensor.rs:476-480 | crates/burn-autodiff/src/ops/tensor.rs:574-578 | crates/burn-autodiff/src/ops/tensor.rs:666-671 — 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-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-flex/src/ops/int.rs:1089 — crates/burn-flex/src/ops/int.rs:1089-1093 | crates/burn-flex/src/ops/int.rs:1104-1108 | crates/burn-flex/src/ops/int.rs:1119-1123 | crates/burn-flex/src/ops/int.rs:1134-1138 — 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-train/src/metric/processor/minimal.rs:64 — crates/burn-train/src/metric/processor/minimal.rs:64-68 | 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 · ×4
  • 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.17, distance 0.81 — zone of pain — concrete and depended on by 10 project(s), so it's rigid to change.
  • Off the main sequence: burn-std — burn-std: abstractness 0.22, instability 0.00, distance 0.78 — zone of pain — concrete and depended on by 21 project(s), so it's rigid to change.
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 76) crates/burn-ir/src/operation.rs:4485 — ModuleOperationIr::visit_mut has cyclomatic complexity 76 (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 75) crates/burn-ir/src/operation.rs:3822 — ModuleOperationIr::inputs has cyclomatic complexity 75 (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 73) crates/burn-ir/src/operation.rs:4173 — ModuleOperationIr::mark_read_only has cyclomatic complexity 73 (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_extension · ×3
  • burn_backend_extension::fusion::expand_method (cyclomatic 51) crates/burn-backend-extension/src/fusion.rs:60 — burn_backend_extension::fusion::expand_method has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • 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:142 — 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.
D2 · Cognitive Complexity · ModuleOperationIr · ×3
  • ModuleOperationIr::visit_mut (cognitive 37) crates/burn-ir/src/operation.rs:4485 — ModuleOperationIr::visit_mut has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18 (36 pts), match/switch 1 (nesting depth added 18). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • ModuleOperationIr::inputs (cognitive 35) crates/burn-ir/src/operation.rs:3822 — ModuleOperationIr::inputs has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19 (29 pts), match/switch 4 (6 pts) (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • ModuleOperationIr::mark_read_only (cognitive 27) crates/burn-ir/src/operation.rs:4173 — ModuleOperationIr::mark_read_only has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (24 pts), match/switch 2 (3 pts) (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · 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 — 32 free functions. The bar is 30 free functions; 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.
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-autodiff/src/ops/module.rs:1427 — crates/burn-autodiff/src/ops/module.rs:1427-1496 | crates/burn-autodiff/src/ops/module.rs:1505-1574 | crates/burn-autodiff/src/ops/module.rs:1595-1664 | crates/burn-autodiff/src/ops/module.rs:2184-2223 | crates/burn-autodiff/src/ops/module.rs:2251-2331 — 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/conv/backward_data/tune.rs:26 — crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs:26-129 | crates/burn-cubecl/src/kernel/conv/backward_weight/tune.rs:26-105 | 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:55-148 — 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 · Duplicated block (26 lines × 2) · ×3
  • Duplicated block (26 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-120 | crates/burn-cubecl/src/kernel/conv/backward_weight/implicit_gemm/launch.rs:95-120 — 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 3 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (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.
  • 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.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×3
  • Duplicated block (25 lines × 2) crates/burn-flex/src/ops/mask.rs:272 — crates/burn-flex/src/ops/mask.rs:272-296 | crates/burn-flex/src/ops/mask.rs:323-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 (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.
  • 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.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×3
  • Duplicated block (23 lines × 2) crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs:178 — crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs:178-200 | crates/burn-cubecl/src/kernel/conv/backward_weight/tune.rs:154-176 — `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 5 separate duplicated blocks between them, totalling at least 77 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (23 lines × 2) 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.
  • Duplicated block (23 lines × 2) crates/burn-flex/src/ops/attention.rs:297 — crates/burn-flex/src/ops/attention.rs:297-319 | crates/burn-flex/src/ops/attention.rs:793-815 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×3
  • Duplicated block (20 lines × 2) crates/burn-cubecl-fusion/src/engine/trace/block.rs:273 — crates/burn-cubecl-fusion/src/engine/trace/block.rs:273-292 | crates/burn-cubecl-fusion/src/engine/trace/block.rs:343-362 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (20 lines × 2) crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs:156 — crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs:156-175 | crates/burn-cubecl/src/kernel/conv/backward_weight/tune.rs:132-151 — `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 5 separate duplicated blocks between them, totalling at least 77 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (20 lines × 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.
D4 · Code Duplication · Duplicated block (16 lines × 6) · ×3
  • Duplicated block (16 lines × 6) crates/burn-autodiff/src/ops/module.rs:308 — crates/burn-autodiff/src/ops/module.rs:308-323 | crates/burn-autodiff/src/ops/module.rs:431-446 | crates/burn-autodiff/src/ops/module.rs:566-581 | crates/burn-autodiff/src/ops/module.rs:1019-1034 | crates/burn-autodiff/src/ops/module.rs:1156-1171 | crates/burn-autodiff/src/ops/module.rs:1282-1297 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (16 lines × 6) crates/burn-cubecl-fusion/src/optim/matmul/optimization.rs:604 — crates/burn-cubecl-fusion/src/optim/matmul/optimization.rs:604-619 | crates/burn-cubecl-fusion/src/optim/matmul/optimization.rs:625-640 | crates/burn-cubecl-fusion/src/optim/matmul/optimization.rs:646-661 | crates/burn-cubecl-fusion/src/optim/matmul/optimization.rs:667-682 | crates/burn-cubecl-fusion/src/optim/matmul/optimization.rs:688-703 | crates/burn-cubecl-fusion/src/optim/matmul/optimization.rs:709-724 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (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 3 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×3
  • Duplicated block (15–16 lines × 2) crates/burn-cubecl/src/kernel/matmul/base.rs:141 — crates/burn-cubecl/src/kernel/matmul/base.rs:141-155 | crates/burn-cubecl/src/kernel/matmul/base.rs:179-194 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15–16 lines × 2) 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.
  • 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:371-386 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×3
  • Duplicated block (15 lines × 3) crates/burn-autodiff/src/ops/module.rs:713 — crates/burn-autodiff/src/ops/module.rs:713-727 | crates/burn-autodiff/src/ops/module.rs:752-766 | crates/burn-autodiff/src/ops/module.rs:788-802 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (15 lines × 3) crates/burn-autodiff/src/ops/module.rs:1462 — crates/burn-autodiff/src/ops/module.rs:1462-1476 | crates/burn-autodiff/src/ops/module.rs:1540-1554 | crates/burn-autodiff/src/ops/module.rs:1630-1644 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (15 lines × 3) crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs:178 — crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs:178-192 | crates/burn-cubecl/src/kernel/conv/backward_weight/tune.rs:154-168 | crates/burn-cubecl/src/kernel/conv/forward/tune.rs:194-208 — `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 5 separate duplicated blocks between them, totalling at least 77 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×3
  • 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 4 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.
  • Duplicated block (14 lines × 3) crates/burn-flex/src/ops/pool.rs:1285 — crates/burn-flex/src/ops/pool.rs:1285-1298 | crates/burn-flex/src/ops/pool.rs:1558-1571 | crates/burn-flex/src/ops/pool.rs:1708-1721 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (14 lines × 3) 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.
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.
  • 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.
  • 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 (9–10 lines × 2) · ×3
  • 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:1017-1025 — 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–10 lines × 2) crates/burn-flex/src/ops/gather_scatter.rs:298 — crates/burn-flex/src/ops/gather_scatter.rs:298-306 | crates/burn-flex/src/ops/gather_scatter.rs:308-317 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9–10 lines × 2) 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.
D4 · Code Duplication · Duplicated block (8–9 lines × 3) · ×3
  • Duplicated block (8–9 lines × 3) crates/burn-autodiff/src/ops/module.rs:848 — crates/burn-autodiff/src/ops/module.rs:848-856 | crates/burn-autodiff/src/ops/module.rs:888-895 | crates/burn-autodiff/src/ops/module.rs:925-932 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8–9 lines × 3) crates/burn-autodiff/src/ops/tensor.rs:375 — crates/burn-autodiff/src/ops/tensor.rs:375-382 | crates/burn-autodiff/src/ops/tensor.rs:666-674 | crates/burn-autodiff/src/ops/tensor.rs:2134-2141 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8–9 lines × 3) crates/burn-autodiff/src/ops/tensor.rs:1225 — crates/burn-autodiff/src/ops/tensor.rs:1225-1233 | crates/burn-autodiff/src/ops/tensor.rs:1997-2005 | crates/burn-autodiff/src/ops/tensor.rs:2405-2412 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×3
  • Duplicated block (7 lines × 4) crates/burn-autodiff/src/ops/module.rs:238 — crates/burn-autodiff/src/ops/module.rs:238-245 | crates/burn-autodiff/src/ops/module.rs:258-264 | crates/burn-autodiff/src/ops/tensor.rs:753-759 | crates/burn-autodiff/src/ops/tensor.rs:804-810 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (7 lines × 4) crates/burn-flex/src/ops/mask.rs:432 — crates/burn-flex/src/ops/mask.rs:432-438 | crates/burn-flex/src/ops/mask.rs:472-478 | crates/burn-flex/src/ops/mask.rs:522-528 | crates/burn-flex/src/ops/mask.rs:564-570 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 4) 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–7 lines × 2) · ×3
  • Duplicated block (6–7 lines × 2) crates/burn-flex/src/ops/fft.rs:287 — crates/burn-flex/src/ops/fft.rs:287-293 | crates/burn-flex/src/ops/fft.rs:304-309 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • 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.
  • 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.
D1 · Cyclomatic Complexity · Flex · ×2
  • Flex::int_cast (cyclomatic 67) crates/burn-flex/src/ops/int.rs:1000 — 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:916 — 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 · 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 · FusedMatmulLaunch · ×2
  • FusedMatmulLaunch::matmul_fused (cognitive 35) crates/burn-cubecl-fusion/src/optim/matmul/optimization.rs:427 — FusedMatmulLaunch::matmul_fused has cognitive complexity 35 (threshold 15). Drivers by points: match/switch 16 (28 pts), if/else 5, boolean chains 2 (nesting depth added 12). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • FusedMatmulLaunch::axis (cognitive 19) crates/burn-cubecl-fusion/src/optim/matmul/optimization.rs:334 — FusedMatmulLaunch::axis has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 2, 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 · 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:136 — 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:197 — 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:158 — 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.
D35 · Change Coupling · Change-coupling hub · ×2
  • Change-coupling hub: interpreter.rs → tensor.rs, module.rs, context.rs, task.rs, module.rs, int.rs crates/burn-router/src/interpreter.rs — `crates/burn-router/src/interpreter.rs` changes together with 6 other files — `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/shared/task.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 6 separate couplings, not 6 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 6.
  • 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.
D36 · Supply-chain Provenance & Signing REDACTED · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×2
  • 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:368 — crates/burn-flex/src/simd/portable.rs:368-454 | crates/burn-flex/src/simd/portable.rs:417-454 — 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 · Members sharing a duplicated core (9 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (9 members, 50+ identical tokens) crates/burn-autodiff/src/ops/module.rs:24 — crates/burn-autodiff/src/ops/module.rs:24-105 | crates/burn-autodiff/src/ops/module.rs:164-274 | crates/burn-autodiff/src/ops/module.rs:299-415 | crates/burn-autodiff/src/ops/module.rs:422-550 | crates/burn-autodiff/src/ops/module.rs:557-676 | crates/burn-autodiff/src/ops/module.rs:685-991 | crates/burn-autodiff/src/ops/module.rs:1010-1140 | crates/burn-autodiff/src/ops/module.rs:1147-1266 | crates/burn-autodiff/src/ops/module.rs:1273-1403 — These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
  • Members sharing a duplicated core (9 members, 50+ identical tokens) 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 · 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:938 — crates/burn-flex/src/ops/interpolate.rs:938-1018 | crates/burn-flex/src/ops/interpolate.rs:1029-1117 | 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:1236-1298 | crates/burn-flex/src/ops/pool.rs:1447-1571 | crates/burn-flex/src/ops/pool.rs:1637-1721 — 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:89 — crates/burn-flex/src/simd/kernels.rs:89-114 | crates/burn-flex/src/simd/kernels.rs:127-156 | crates/burn-flex/src/simd/portable.rs:44-81 | crates/burn-flex/src/simd/portable.rs:44-87 | crates/burn-flex/src/simd/portable.rs:44-93 | crates/burn-flex/src/simd/portable.rs:44-99 | crates/burn-flex/src/simd/portable.rs:44-110 | crates/burn-flex/src/simd/portable.rs:44-116 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication · Duplicated block (31–32 lines × 2) · ×2
  • 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.
  • Duplicated block (31–32 lines × 2) crates/burn-train/src/learner/supervised/strategies/ddp/epoch.rs:122 — crates/burn-train/src/learner/supervised/strategies/ddp/epoch.rs:122-153 | crates/burn-train/src/learner/supervised/strategies/single/epoch.rs:123-153 — `crates/burn-train/src/learner/supervised/strategies/ddp/epoch.rs` and `crates/burn-train/src/learner/supervised/strategies/single/epoch.rs` are one unit implemented 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 61 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (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.
  • Duplicated block (29–30 lines × 2) crates/burn-train/src/metric/bleu.rs:236 — crates/burn-train/src/metric/bleu.rs:236-265 | crates/burn-train/src/metric/rouge.rs:87-115 — before extracting anything, compare `crates/burn-train/src/metric/bleu.rs` and `crates/burn-train/src/metric/rouge.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (29 lines × 2) · ×2
  • 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.
  • Duplicated block (29 lines × 2) crates/burn-flex/src/ops/attention.rs:608 — crates/burn-flex/src/ops/attention.rs:608-636 | crates/burn-flex/src/ops/attention.rs:964-992 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (26–27 lines × 2) · ×2
  • Duplicated block (26–27 lines × 2) crates/burn-flex/src/ops/conv.rs:484 — crates/burn-flex/src/ops/conv.rs:484-510 | 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.
  • Duplicated block (26–27 lines × 2) crates/burn-flex/src/ops/gather_scatter.rs:541 — crates/burn-flex/src/ops/gather_scatter.rs:541-567 | crates/burn-flex/src/ops/gather_scatter.rs:580-605 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (17–23 lines × 2) · ×2
  • Duplicated block (17–23 lines × 2) crates/burn-flex/src/ops/activation.rs:248 — crates/burn-flex/src/ops/activation.rs:248-270 | crates/burn-flex/src/ops/activation.rs:775-791 — both copies are in the same file, so extract the block into 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–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.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×2
  • Duplicated block (21 lines × 2) crates/burn-autodiff/src/ops/module.rs:737 — crates/burn-autodiff/src/ops/module.rs:737-757 | crates/burn-autodiff/src/ops/module.rs:773-793 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (21 lines × 2) crates/burn-autodiff/src/ops/module.rs:887 — crates/burn-autodiff/src/ops/module.rs:887-907 | crates/burn-autodiff/src/ops/module.rs:924-944 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (16–18 lines × 2) · ×2
  • Duplicated block (16–18 lines × 2) crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:549 — crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:549-564 | crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:735-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.
  • 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 — `crates/burn-train/src/learner/supervised/strategies/ddp/epoch.rs` and `crates/burn-train/src/learner/supervised/strategies/single/epoch.rs` are one unit implemented 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 61 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (16 lines × 3) · ×2
  • Duplicated block (16 lines × 3) crates/burn-cubecl-fusion/src/optim/matmul/optimization.rs:515 — crates/burn-cubecl-fusion/src/optim/matmul/optimization.rs:515-530 | crates/burn-cubecl-fusion/src/optim/matmul/optimization.rs:547-562 | crates/burn-cubecl-fusion/src/optim/matmul/optimization.rs:583-598 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (16 lines × 3) crates/burn-cubecl/src/kernel/pool/base.rs:28 — 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/max_pool3d.rs:248-263 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (12–15 lines × 2) · ×2
  • Duplicated block (12–15 lines × 2) crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:104 — crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:104-115 | crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:207-221 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12–15 lines × 2) 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.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×2
  • Duplicated block (12 lines × 4) crates/burn-autodiff/src/ops/module.rs:715 — crates/burn-autodiff/src/ops/module.rs:715-726 | crates/burn-autodiff/src/ops/module.rs:754-765 | crates/burn-autodiff/src/ops/module.rs:790-801 | crates/burn-autodiff/src/ops/module.rs:825-836 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (12 lines × 4) crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:36 — crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:36-47 | crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:141-152 | crates/burn-cubecl/src/kernel/pool/max_pool3d.rs:39-50 | crates/burn-cubecl/src/kernel/pool/max_pool3d.rs:137-148 — 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 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
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.
  • 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–11 lines × 2) · ×2
  • Duplicated block (9–11 lines × 2) crates/burn-flex/src/ops/fft.rs:295 — crates/burn-flex/src/ops/fft.rs:295-303 | crates/burn-flex/src/ops/fft.rs:311-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.
  • Duplicated block (9–11 lines × 2) crates/burn-flex/src/ops/gather_scatter.rs:844 — crates/burn-flex/src/ops/gather_scatter.rs:844-854 | crates/burn-flex/src/ops/gather_scatter.rs:890-898 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (9–10 lines × 7) · ×2
  • Duplicated block (9–10 lines × 7) crates/burn-autodiff/src/ops/module.rs:378 — crates/burn-autodiff/src/ops/module.rs:378-386 | crates/burn-autodiff/src/ops/module.rs:505-513 | crates/burn-autodiff/src/ops/module.rs:638-646 | crates/burn-autodiff/src/ops/module.rs:962-970 | crates/burn-autodiff/src/ops/module.rs:1093-1102 | crates/burn-autodiff/src/ops/module.rs:1228-1236 | crates/burn-autodiff/src/ops/module.rs:1356-1365 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (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.
  • 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.
D4 · Code Duplication · Duplicated block (8–10 lines × 2) · ×2
  • Duplicated block (8–10 lines × 2) crates/burn-autodiff/src/ops/module.rs:37 — crates/burn-autodiff/src/ops/module.rs:37-46 | crates/burn-autodiff/src/ops/module.rs:811-818 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8–10 lines × 2) crates/burn-flex/src/ops/pool.rs:325 — crates/burn-flex/src/ops/pool.rs:325-334 | crates/burn-flex/src/ops/pool.rs:769-776 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×2
  • Duplicated block (9 lines × 4) crates/burn-autodiff/src/ops/tensor.rs:1116 — crates/burn-autodiff/src/ops/tensor.rs:1116-1124 | crates/burn-autodiff/src/ops/tensor.rs:1216-1224 | crates/burn-autodiff/src/ops/tensor.rs:1834-1842 | crates/burn-autodiff/src/ops/tensor.rs:1988-1996 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (9 lines × 4) 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.
D4 · Code Duplication · Duplicated block (8 lines × 7) · ×2
  • Duplicated block (8 lines × 7) crates/burn-autodiff/src/ops/module.rs:173 — crates/burn-autodiff/src/ops/module.rs:173-180 | crates/burn-autodiff/src/ops/module.rs:308-315 | crates/burn-autodiff/src/ops/module.rs:431-438 | crates/burn-autodiff/src/ops/module.rs:566-573 | crates/burn-autodiff/src/ops/module.rs:1019-1026 | crates/burn-autodiff/src/ops/module.rs:1156-1163 | crates/burn-autodiff/src/ops/module.rs:1282-1289 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 7) crates/burn-autodiff/src/ops/module.rs:206 — crates/burn-autodiff/src/ops/module.rs:206-213 | crates/burn-autodiff/src/ops/module.rs:346-353 | crates/burn-autodiff/src/ops/module.rs:473-480 | crates/burn-autodiff/src/ops/module.rs:605-612 | crates/burn-autodiff/src/ops/module.rs:1061-1068 | crates/burn-autodiff/src/ops/module.rs:1195-1202 | crates/burn-autodiff/src/ops/module.rs:1324-1331 — 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 (8 lines × 4) · ×2
  • Duplicated block (8 lines × 4) crates/burn-flex/src/ops/pool.rs:458 — crates/burn-flex/src/ops/pool.rs:458-465 | crates/burn-flex/src/ops/pool.rs:479-486 | crates/burn-flex/src/ops/pool.rs:500-507 | crates/burn-flex/src/ops/pool.rs:521-528 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 4) crates/burn-flex/src/ops/reduce.rs:2130 — crates/burn-flex/src/ops/reduce.rs:2130-2137 | crates/burn-flex/src/ops/reduce.rs:2185-2192 | crates/burn-flex/src/ops/reduce.rs:2251-2258 | crates/burn-flex/src/ops/reduce.rs:2308-2315 — 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 lines × 5) · ×2
  • Duplicated block (7 lines × 5) crates/burn-autodiff/src/ops/tensor.rs:1225 — crates/burn-autodiff/src/ops/tensor.rs:1225-1232 | crates/burn-autodiff/src/ops/tensor.rs:1535-1543 | crates/burn-autodiff/src/ops/tensor.rs:1997-2004 | crates/burn-autodiff/src/ops/tensor.rs:2405-2411 | crates/burn-autodiff/src/ops/tensor.rs:2465-2471 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (7 lines × 5) 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 lines × 5) · ×2
  • Duplicated block (6 lines × 5) crates/burn-autodiff/src/ops/tensor.rs:376 — crates/burn-autodiff/src/ops/tensor.rs:376-382 | crates/burn-autodiff/src/ops/tensor.rs:667-674 | crates/burn-autodiff/src/ops/tensor.rs:754-759 | crates/burn-autodiff/src/ops/tensor.rs:805-810 | crates/burn-autodiff/src/ops/tensor.rs:2136-2141 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (6 lines × 5) crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs:27 — crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs:27-35 | crates/burn-cubecl/src/kernel/conv/backward_weight/tune.rs:27-32 | 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:56-61 — `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 5 separate duplicated blocks between them, totalling at least 77 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D1 · Cyclomatic Complexity · TensorInterpreter · ×1
  • TensorInterpreter::register_op (cyclomatic 338) crates/burn-router/src/interpreter.rs:239 — TensorInterpreter::register_op has cyclomatic complexity 338 (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 · 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 · FusedMatmulLaunch · ×1
  • FusedMatmulLaunch::matmul_fused (cyclomatic 32) crates/burn-cubecl-fusion/src/optim/matmul/optimization.rs:427 — FusedMatmulLaunch::matmul_fused has cyclomatic complexity 32 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Autodiff · ×1
  • Autodiff::deform_conv2d (cyclomatic 24) crates/burn-autodiff/src/ops/module.rs:678 — 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:75 — 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:328 — 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 · CaptureScopeGuard · ×1
  • CaptureScopeGuard::complete (cyclomatic 16) crates/burn-capture/src/capture.rs:272 — 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:328 — 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::register_op (cognitive 30) crates/burn-router/src/interpreter.rs:239 — TensorInterpreter::register_op has cognitive complexity 30 (threshold 15). Drivers by points: match/switch 12 (23 pts), if/else 2 (6 pts), boolean chains 1 (nesting depth added 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · 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:678 — 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 · 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:272 — 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:94 — 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:1000 — 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 · NumericEntry · ×1
  • NumericEntry::deserialize (cognitive 18) crates/burn-train/src/metric/base.rs:281 — 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 · 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:332 — crates/burn-autodiff/src/ops/tensor.rs:332-389 | crates/burn-autodiff/src/ops/tensor.rs:619-681 | crates/burn-autodiff/src/ops/tensor.rs:710-766 | crates/burn-autodiff/src/ops/tensor.rs:772-819 — 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, 14 shared lines) · ×1
  • Near-duplicate member family (4 members, 14 shared lines) crates/burn-autodiff/src/ops/tensor.rs:332 — crates/burn-autodiff/src/ops/tensor.rs:332-389 | crates/burn-autodiff/src/ops/tensor.rs:424-490 | crates/burn-autodiff/src/ops/tensor.rs:526-590 | crates/burn-autodiff/src/ops/tensor.rs:619-681 — 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, 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:124-145 — 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 (115 shared lines) · ×1
  • Near-duplicate member pair (115 shared lines) crates/burn-flex/src/ops/attention.rs:258 — crates/burn-flex/src/ops/attention.rs:258-413 | crates/burn-flex/src/ops/attention.rs:751-910 — These two members are variants of one another: 115 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (89 shared lines) · ×1
  • Near-duplicate member pair (89 shared lines) 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: 89 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (62 shared lines) · ×1
  • Near-duplicate member pair (62 shared lines) crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs:68 — crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs:68-156 | crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs:165-248 — These two members are variants of one another: 62 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (55 shared lines) · ×1
  • Near-duplicate member pair (55 shared lines) crates/burn-flex/src/ops/attention.rs:542 — crates/burn-flex/src/ops/attention.rs:542-714 | crates/burn-flex/src/ops/attention.rs:925-1030 — These two members are variants of one another: 55 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (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 (32 shared lines) · ×1
  • Near-duplicate member pair (32 shared lines) crates/burn-flex/src/ops/pool.rs:257 — crates/burn-flex/src/ops/pool.rs:257-392 | crates/burn-flex/src/ops/pool.rs:703-836 — These two members are variants of one another: 32 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 · Edited copy of a member (21 corresponding lines) · ×1
  • 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:324-344 — 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 (25 corresponding lines) · ×1
  • 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.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×1
  • 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.
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:847 — crates/burn-autodiff/src/ops/tensor.rs:847-885 | crates/burn-autodiff/src/ops/tensor.rs:3224-3260 | crates/burn-autodiff/src/ops/tensor.rs:3262-3300 | crates/burn-autodiff/src/ops/tensor.rs:3403-3443 | crates/burn-autodiff/src/ops/tensor.rs:3483-3520 | crates/burn-autodiff/src/ops/tensor.rs:3522-3558 | crates/burn-autodiff/src/ops/tensor.rs:3602-3637 | crates/burn-autodiff/src/ops/tensor.rs:3639-3674 | crates/burn-autodiff/src/ops/tensor.rs:3716-3754 | crates/burn-autodiff/src/ops/tensor.rs:3756-3795 | crates/burn-autodiff/src/ops/tensor.rs:3797-3835 | crates/burn-autodiff/src/ops/tensor.rs:3837-3876 | crates/burn-autodiff/src/ops/tensor.rs:3878-3917 | crates/burn-autodiff/src/ops/tensor.rs:3919-3958 — 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:118 — crates/burn-autodiff/src/ops/module.rs:118-150 | crates/burn-autodiff/src/ops/tensor.rs:887-939 | crates/burn-autodiff/src/ops/tensor.rs:2732-2769 | crates/burn-autodiff/src/ops/tensor.rs:2771-2806 | crates/burn-autodiff/src/ops/tensor.rs:2842-2874 | crates/burn-autodiff/src/ops/tensor.rs:2876-2911 | crates/burn-autodiff/src/ops/tensor.rs:2913-3016 | crates/burn-autodiff/src/ops/tensor.rs:4038-4072 | crates/burn-autodiff/src/ops/tensor.rs:4074-4108 | crates/burn-autodiff/src/ops/tensor.rs:4110-4144 | crates/burn-autodiff/src/ops/tensor.rs:4146-4180 | crates/burn-autodiff/src/ops/tensor.rs:4705-4768 — 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 (7 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (7 members, 50+ identical tokens) crates/burn-flex/src/ops/interpolate.rs:210 — crates/burn-flex/src/ops/interpolate.rs:210-312 | crates/burn-flex/src/ops/interpolate.rs:323-437 | crates/burn-flex/src/ops/interpolate.rs:496-626 | crates/burn-flex/src/ops/interpolate.rs:706-817 | crates/burn-flex/src/ops/interpolate.rs:832-927 | crates/burn-flex/src/ops/interpolate.rs:938-1018 | crates/burn-flex/src/ops/interpolate.rs:1029-1117 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication · Duplicated block (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.
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.
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.
D4 · Code Duplication · Duplicated block (37–38 lines × 2) · ×1
  • Duplicated block (37–38 lines × 2) crates/burn-flex/src/ops/attention.rs:322 — crates/burn-flex/src/ops/attention.rs:322-359 | crates/burn-flex/src/ops/attention.rs:818-854 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (38 lines × 2) · ×1
  • 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.
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.
D4 · Code Duplication · Duplicated block (32 lines × 2) · ×1
  • Duplicated block (32 lines × 2) crates/burn-tensor/src/tensor/api/check.rs:944 — crates/burn-tensor/src/tensor/api/check.rs:944-975 | crates/burn-tensor/src/tensor/api/check.rs:1016-1047 — both copies are in the same file, so extract the 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 (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.
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.
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.
D4 · Code Duplication · Duplicated block (27–28 lines × 2) · ×1
  • Duplicated block (27–28 lines × 2) crates/burn-cubecl/src/kernel/index/gather_nd.rs:25 — crates/burn-cubecl/src/kernel/index/gather_nd.rs:25-51 | crates/burn-cubecl/src/kernel/index/scatter_nd.rs:30-57 — 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 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×1
  • 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.
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.
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.
D4 · Code Duplication · Duplicated block (22–25 lines × 2) · ×1
  • Duplicated block (22–25 lines × 2) 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 — both copies are in the same file, so extract the 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 (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.
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.
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:782 — crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:782-805 | crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:831-852 — both copies are in the same file, so extract the 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 (23 lines × 3) · ×1
  • Duplicated block (23 lines × 3) crates/burn-autodiff/src/ops/tensor.rs:1387 — crates/burn-autodiff/src/ops/tensor.rs:1387-1409 | crates/burn-autodiff/src/ops/tensor.rs:1692-1714 | crates/burn-autodiff/src/ops/tensor.rs:2222-2244 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (20–23 lines × 2) · ×1
  • Duplicated block (20–23 lines × 2) 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.
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.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×1
  • Duplicated block (22 lines × 2) crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs:120 — crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs:120-141 | crates/burn-train/src/learner/supervised/strategies/multi/epoch.rs:214-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.
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.
D4 · Code Duplication · Duplicated block (21 lines × 3) · ×1
  • Duplicated block (21 lines × 3) crates/burn-autodiff/src/ops/module.rs:1695 — crates/burn-autodiff/src/ops/module.rs:1695-1715 | crates/burn-autodiff/src/ops/module.rs:1825-1845 | crates/burn-autodiff/src/ops/module.rs:1946-1966 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (20–21 lines × 2) · ×1
  • Duplicated block (20–21 lines × 2) crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs:171 — crates/burn-cubecl/src/kernel/conv/backward_data/tune.rs:171-191 | crates/burn-cubecl/src/kernel/conv/forward/tune.rs:188-207 — `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 4 separate duplicated blocks between them, totalling at least 55 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (13–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.
D4 · Code Duplication · Duplicated block (1–21 lines × 8) · ×1
  • Duplicated block (1–21 lines × 8) crates/burn-flex/src/simd/kernels.rs:94 — crates/burn-flex/src/simd/kernels.rs:94-114 | crates/burn-flex/src/simd/kernels.rs:137-155 | crates/burn-flex/src/simd/portable.rs:81-81 | 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:110-110 | crates/burn-flex/src/simd/portable.rs:116-116 — 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.
D4 · Code Duplication · Duplicated block (19 lines × 3) · ×1
  • Duplicated block (19 lines × 3) crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:501 — crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:501-519 | crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:640-658 | crates/burn-cubecl-fusion/src/engine/codegen/kernel.rs:700-718 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (17–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.
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.
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 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (17 lines × 4) · ×1
  • Duplicated block (17 lines × 4) crates/burn-fusion/src/client.rs:340 — crates/burn-fusion/src/client.rs:340-356 | crates/burn-fusion/src/client.rs:384-400 | crates/burn-fusion/src/client.rs:428-444 | crates/burn-fusion/src/client.rs:472-488 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
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.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×1
  • Duplicated block (16–17 lines × 2) crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:146 — crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:146-162 | crates/burn-cubecl/src/kernel/pool/max_pool3d.rs:142-157 — 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 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
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.
D4 · Code Duplication · Duplicated block (14–16 lines × 4) · ×1
  • Duplicated block (14–16 lines × 4) crates/burn-autodiff/src/ops/tensor.rs:1218 — crates/burn-autodiff/src/ops/tensor.rs:1218-1231 | crates/burn-autodiff/src/ops/tensor.rs:1288-1303 | crates/burn-autodiff/src/ops/tensor.rs:1990-2003 | crates/burn-autodiff/src/ops/tensor.rs:2458-2471 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (15–16 lines × 4) · ×1
  • Duplicated block (15–16 lines × 4) crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:45 — crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:45-59 | crates/burn-cubecl/src/kernel/pool/avg_pool3d.rs:154-168 | crates/burn-cubecl/src/kernel/pool/max_pool3d.rs:48-62 | crates/burn-cubecl/src/kernel/pool/max_pool3d.rs:148-163 — 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 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (14–16 lines × 3) · ×1
  • Duplicated block (14–16 lines × 3) crates/burn-autodiff/src/ops/tensor.rs:1528 — crates/burn-autodiff/src/ops/tensor.rs:1528-1543 | crates/burn-autodiff/src/ops/tensor.rs:1594-1607 | crates/burn-autodiff/src/ops/tensor.rs:2398-2411 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (12–16 lines × 2) · ×1
  • Duplicated block (12–16 lines × 2) 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.
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:346 — crates/burn-autodiff/src/ops/module.rs:346-360 | crates/burn-autodiff/src/ops/module.rs:473-487 | crates/burn-autodiff/src/ops/module.rs:605-619 | crates/burn-autodiff/src/ops/module.rs:1061-1075 | crates/burn-autodiff/src/ops/module.rs:1195-1209 | crates/burn-autodiff/src/ops/module.rs:1324-1338 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (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.
D4 · Code Duplication · Duplicated block (13–15 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (14 lines × 5) · ×1
  • Duplicated block (14 lines × 5) crates/burn-flex/src/ops/interpolate.rs:328 — crates/burn-flex/src/ops/interpolate.rs:328-341 | crates/burn-flex/src/ops/interpolate.rs:501-514 | crates/burn-flex/src/ops/interpolate.rs:711-724 | crates/burn-flex/src/ops/interpolate.rs:943-956 | crates/burn-flex/src/ops/interpolate.rs:1034-1047 — 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 (14 lines × 4) · ×1
  • Duplicated block (14 lines × 4) crates/burn-autodiff/src/ops/tensor.rs:4044 — crates/burn-autodiff/src/ops/tensor.rs:4044-4057 | crates/burn-autodiff/src/ops/tensor.rs:4080-4093 | crates/burn-autodiff/src/ops/tensor.rs:4116-4129 | crates/burn-autodiff/src/ops/tensor.rs:4152-4165 — 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 (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:132-145 — 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–14 lines × 2) · ×1
  • Duplicated block (12–14 lines × 2) crates/burn-flex/src/ops/attention.rs:593 — crates/burn-flex/src/ops/attention.rs:593-606 | crates/burn-flex/src/ops/attention.rs:952-963 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (11–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.
D4 · Code Duplication · Duplicated block (12–13 lines × 8) · ×1
  • Duplicated block (12–13 lines × 8) crates/burn-flex/src/ops/interpolate.rs:995 — crates/burn-flex/src/ops/interpolate.rs:995-1007 | crates/burn-flex/src/ops/interpolate.rs:1094-1106 | 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:1274-1285 | crates/burn-flex/src/ops/pool.rs:1547-1558 | crates/burn-flex/src/ops/pool.rs:1697-1708 — 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.
D4 · Code Duplication · Duplicated block (13 lines × 7) · ×1
  • Duplicated block (13 lines × 7) crates/burn-flex/src/ops/interpolate.rs:211 — crates/burn-flex/src/ops/interpolate.rs:211-223 | crates/burn-flex/src/ops/interpolate.rs:324-336 | crates/burn-flex/src/ops/interpolate.rs:497-509 | crates/burn-flex/src/ops/interpolate.rs:707-719 | crates/burn-flex/src/ops/interpolate.rs:833-845 | crates/burn-flex/src/ops/interpolate.rs:939-951 | crates/burn-flex/src/ops/interpolate.rs:1030-1042 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (12–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.
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.
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.
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.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×1
  • Duplicated block (11 lines × 4) crates/burn-autodiff/src/ops/tensor.rs:243 — crates/burn-autodiff/src/ops/tensor.rs:243-253 | crates/burn-autodiff/src/ops/tensor.rs:312-322 | crates/burn-autodiff/src/ops/tensor.rs:599-609 | crates/burn-autodiff/src/ops/tensor.rs:690-700 — 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 (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.
D4 · Code Duplication · Duplicated block (10–11 lines × 3) · ×1
  • Duplicated block (10–11 lines × 3) crates/burn-flex/src/simd/portable.rs:481 — crates/burn-flex/src/simd/portable.rs:481-490 | crates/burn-flex/src/simd/portable.rs:526-535 | crates/burn-flex/src/simd/portable.rs:808-818 — all 3 copies are in the same file, so extract the block into one function there and call 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 (10 lines × 14) · ×1
  • Duplicated block (10 lines × 14) crates/burn-autodiff/src/ops/tensor.rs:854 — crates/burn-autodiff/src/ops/tensor.rs:854-863 | crates/burn-autodiff/src/ops/tensor.rs:3231-3240 | crates/burn-autodiff/src/ops/tensor.rs:3269-3278 | crates/burn-autodiff/src/ops/tensor.rs:3410-3419 | crates/burn-autodiff/src/ops/tensor.rs:3490-3499 | crates/burn-autodiff/src/ops/tensor.rs:3529-3538 | crates/burn-autodiff/src/ops/tensor.rs:3609-3618 | crates/burn-autodiff/src/ops/tensor.rs:3646-3655 | crates/burn-autodiff/src/ops/tensor.rs:3723-3732 | crates/burn-autodiff/src/ops/tensor.rs:3763-3772 | crates/burn-autodiff/src/ops/tensor.rs:3804-3813 | crates/burn-autodiff/src/ops/tensor.rs:3844-3853 | crates/burn-autodiff/src/ops/tensor.rs:3885-3894 | crates/burn-autodiff/src/ops/tensor.rs:3926-3935 — 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.
D4 · Code Duplication · Duplicated block (9–10 lines × 6) · ×1
  • Duplicated block (9–10 lines × 6) crates/burn-autodiff/src/ops/module.rs:398 — crates/burn-autodiff/src/ops/module.rs:398-406 | crates/burn-autodiff/src/ops/module.rs:530-538 | crates/burn-autodiff/src/ops/module.rs:658-666 | crates/burn-autodiff/src/ops/module.rs:1119-1128 | crates/burn-autodiff/src/ops/module.rs:1248-1256 | crates/burn-autodiff/src/ops/module.rs:1382-1391 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (10 lines × 5) · ×1
  • Duplicated block (10 lines × 5) crates/burn-autodiff/src/ops/tensor.rs:345 — crates/burn-autodiff/src/ops/tensor.rs:345-354 | crates/burn-autodiff/src/ops/tensor.rs:539-548 | crates/burn-autodiff/src/ops/tensor.rs:632-641 | crates/burn-autodiff/src/ops/tensor.rs:721-730 | crates/burn-autodiff/src/ops/tensor.rs:783-792 — 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 (9–10 lines × 3) · ×1
  • Duplicated block (9–10 lines × 3) crates/burn-flex/src/ops/binary.rs:204 — crates/burn-flex/src/ops/binary.rs:204-213 | crates/burn-flex/src/ops/bool.rs:154-162 | 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.
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.
D4 · Code Duplication · Duplicated block (2–10 lines × 10) · ×1
  • Duplicated block (2–10 lines × 10) crates/burn-router/src/interpreter.rs:1543 — crates/burn-router/src/interpreter.rs:1543-1547 | crates/burn-router/src/interpreter.rs:1574-1578 | crates/burn-router/src/interpreter.rs:1615-1619 | crates/burn-router/src/interpreter.rs:1656-1660 | crates/burn-router/src/interpreter.rs:1698-1707 | crates/burn-router/src/interpreter.rs:1721-1730 | crates/burn-router/src/interpreter.rs:1756-1760 | crates/burn-router/src/interpreter.rs:1767-1771 | crates/burn-router/src/interpreter.rs:1778-1782 | crates/burn-router/src/interpreter.rs:2120-2121 — all 10 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (8–9 lines × 12) · ×1
  • Duplicated block (8–9 lines × 12) crates/burn-autodiff/src/ops/module.rs:125 — crates/burn-autodiff/src/ops/module.rs:125-133 | crates/burn-autodiff/src/ops/tensor.rs:910-918 | crates/burn-autodiff/src/ops/tensor.rs:2739-2747 | crates/burn-autodiff/src/ops/tensor.rs:2778-2786 | crates/burn-autodiff/src/ops/tensor.rs:2849-2857 | crates/burn-autodiff/src/ops/tensor.rs:2883-2891 | crates/burn-autodiff/src/ops/tensor.rs:2920-2928 | crates/burn-autodiff/src/ops/tensor.rs:4046-4053 | crates/burn-autodiff/src/ops/tensor.rs:4082-4089 | crates/burn-autodiff/src/ops/tensor.rs:4118-4125 | crates/burn-autodiff/src/ops/tensor.rs:4154-4161 | crates/burn-autodiff/src/ops/tensor.rs:4728-4736 — 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.
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.
D4 · Code Duplication · Duplicated block (4–9 lines × 8) · ×1
  • Duplicated block (4–9 lines × 8) crates/burn-autodiff/src/ops/tensor.rs:341 — crates/burn-autodiff/src/ops/tensor.rs:341-349 | crates/burn-autodiff/src/ops/tensor.rs:433-441 | crates/burn-autodiff/src/ops/tensor.rs:535-543 | crates/burn-autodiff/src/ops/tensor.rs:628-636 | crates/burn-autodiff/src/ops/tensor.rs:717-725 | crates/burn-autodiff/src/ops/tensor.rs:779-787 | crates/burn-autodiff/src/ops/tensor.rs:2094-2097 | crates/burn-autodiff/src/ops/tensor.rs:3969-3977 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (4–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.
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:1434 — crates/burn-autodiff/src/ops/module.rs:1434-1441 | crates/burn-autodiff/src/ops/module.rs:1512-1519 | crates/burn-autodiff/src/ops/module.rs:1602-1609 | crates/burn-autodiff/src/ops/module.rs:2190-2197 | crates/burn-autodiff/src/ops/module.rs:2271-2278 — 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 (7–8 lines × 4) · ×1
  • Duplicated block (7–8 lines × 4) crates/burn-autodiff/src/ops/tensor.rs:3167 — crates/burn-autodiff/src/ops/tensor.rs:3167-3174 | crates/burn-autodiff/src/ops/tensor.rs:4320-4327 | crates/burn-autodiff/src/ops/tensor.rs:4364-4371 | crates/burn-autodiff/src/ops/tensor.rs:4646-4652 — 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:1257 — crates/burn-flex/src/ops/pool.rs:1257-1263 | crates/burn-flex/src/ops/pool.rs:1470-1477 | crates/burn-flex/src/ops/pool.rs:1656-1663 — all 3 copies are in the same file, so extract the block into one function there and call 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–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.
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.
D4 · Code Duplication · Duplicated block (2–8 lines × 3) · ×1
  • Duplicated block (2–8 lines × 3) crates/burn-train/src/metric/vision/lpips/metric.rs:312 — crates/burn-train/src/metric/vision/lpips/metric.rs:312-319 | crates/burn-train/src/metric/vision/lpips/metric.rs:337-344 | crates/burn-train/src/metric/vision/lpips/metric.rs:361-362 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (6–7 lines × 10) · ×1
  • Duplicated block (6–7 lines × 10) crates/burn-autodiff/src/ops/module.rs:69 — crates/burn-autodiff/src/ops/module.rs:69-75 | crates/burn-autodiff/src/ops/module.rs:378-383 | crates/burn-autodiff/src/ops/module.rs:505-510 | crates/burn-autodiff/src/ops/module.rs:638-643 | crates/burn-autodiff/src/ops/module.rs:888-893 | crates/burn-autodiff/src/ops/module.rs:925-930 | crates/burn-autodiff/src/ops/module.rs:962-967 | crates/burn-autodiff/src/ops/module.rs:1093-1098 | crates/burn-autodiff/src/ops/module.rs:1228-1233 | crates/burn-autodiff/src/ops/module.rs:1356-1361 — all 10 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (7 lines × 9) · ×1
  • Duplicated block (7 lines × 9) crates/burn-autodiff/src/ops/module.rs:40 — crates/burn-autodiff/src/ops/module.rs:40-46 | crates/burn-autodiff/src/ops/module.rs:174-180 | crates/burn-autodiff/src/ops/module.rs:309-315 | crates/burn-autodiff/src/ops/module.rs:432-438 | crates/burn-autodiff/src/ops/module.rs:567-573 | crates/burn-autodiff/src/ops/module.rs:812-818 | crates/burn-autodiff/src/ops/module.rs:1020-1026 | crates/burn-autodiff/src/ops/module.rs:1157-1163 | crates/burn-autodiff/src/ops/module.rs:1283-1289 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (7 lines × 7) · ×1
  • Duplicated block (7 lines × 7) crates/burn-ir/src/operation.rs:4508 — crates/burn-ir/src/operation.rs:4508-4514 | crates/burn-ir/src/operation.rs:4530-4536 | crates/burn-ir/src/operation.rs:4556-4562 | crates/burn-ir/src/operation.rs:4582-4588 | crates/burn-ir/src/operation.rs:4641-4647 | crates/burn-ir/src/operation.rs:4649-4655 | crates/burn-ir/src/operation.rs:4657-4663 — 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 (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.
D4 · Code Duplication · Duplicated block (3–7 lines × 5) · ×1
  • Duplicated block (3–7 lines × 5) crates/burn-autodiff/src/ops/tensor.rs:1895 — crates/burn-autodiff/src/ops/tensor.rs:1895-1901 | crates/burn-autodiff/src/ops/tensor.rs:1974-1980 | crates/burn-autodiff/src/ops/tensor.rs:2071-2077 | crates/burn-autodiff/src/ops/tensor.rs:2187-2193 | crates/burn-autodiff/src/ops/tensor.rs:2387-2389 — 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 (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 (6 lines × 7) · ×1
  • Duplicated block (6 lines × 7) crates/burn-ir/src/operation.rs:3834 — crates/burn-ir/src/operation.rs:3834-3839 | crates/burn-ir/src/operation.rs:3850-3855 | crates/burn-ir/src/operation.rs:3866-3871 | crates/burn-ir/src/operation.rs:3882-3887 | crates/burn-ir/src/operation.rs:3932-3937 | crates/burn-ir/src/operation.rs:3939-3944 | crates/burn-ir/src/operation.rs:3946-3951 — 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 (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.
D4 · Code Duplication · Duplicated block (5 lines × 6) · ×1
  • Duplicated block (5 lines × 6) crates/burn-flex/src/ops/reduce.rs:1824 — crates/burn-flex/src/ops/reduce.rs:1824-1828 | crates/burn-flex/src/ops/reduce.rs:1875-1879 | crates/burn-flex/src/ops/reduce.rs:1932-1936 | crates/burn-flex/src/ops/reduce.rs:1990-1994 | crates/burn-flex/src/ops/reduce.rs:2032-2036 | crates/burn-flex/src/ops/reduce.rs:2089-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.
D4 · Code Duplication · Duplicated block (3–5 lines × 4) · ×1
  • Duplicated block (3–5 lines × 4) crates/burn-flex/src/ops/interpolate.rs:403 — crates/burn-flex/src/ops/interpolate.rs:403-407 | crates/burn-flex/src/ops/interpolate.rs:408-410 | crates/burn-flex/src/ops/interpolate.rs:969-973 | crates/burn-flex/src/ops/interpolate.rs:974-976 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (8 lines × 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.
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:61-68 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 8 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (5 lines × 10) · ×1
  • Duplicated block (5 lines × 10) crates/burn-train/src/metric/acc.rs:85 — crates/burn-train/src/metric/acc.rs:85-89 | crates/burn-train/src/metric/bleu.rs:301-305 | 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:150-154 | 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/bleu.rs` and `crates/burn-train/src/metric/rouge.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (6 lines × 9) · ×1
  • Duplicated block (6 lines × 9) crates/burn-backend/src/backend/ops/int_tensor.rs:1046 — crates/burn-backend/src/backend/ops/int_tensor.rs:1046-1051 | crates/burn-backend/src/backend/ops/int_tensor.rs:1094-1099 | crates/burn-backend/src/backend/ops/int_tensor.rs:1124-1129 | 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:1586-1591 | crates/burn-backend/src/backend/ops/tensor.rs:1641-1646 | crates/burn-backend/src/backend/ops/tensor.rs:1696-1701 — 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.
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.
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 — 47 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×14
  • 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-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-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-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.
X10 · Duplicated predicate · Duplicated predicate · ×13
  • 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:159 — `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:194 — `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:532 — `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.
D16 · Bus Factor · Off-boarding risk · ×4
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 26 significant file(s) lose their only recent owner: crates/burn-backend-extension/src/routing.rs, 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-core/src/module/param/reparameterization_dyn.rs, crates/burn-backend-extension/src/derive.rs (+18 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 7 significant file(s) lose their only recent owner: crates/burn-cubecl-fusion/src/engine/launch/vectorization/axis.rs, crates/burn-fusion/src/stream/execution/ordering.rs, 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, crates/burn-std/src/runtime_kind.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-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 #4 — If anonymized user #4 becomes unavailable, 3 significant file(s) lose their only recent owner: 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.
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) — 4 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 (45 single-owned of 808 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; 808 of the 1175 production source files in this repository met that bar). They are anonymized user #5 (2 file(s)), anonymized user #6 (1 file(s)), anonymized user #7 (1 file(s)), anonymized user #8 (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-pack/src/atomic.rs, crates/pytorch-reader/src/lib.rs, crates/burn-cubecl/src/kernel/memory_order.rs, crates/burn-cubecl/src/kernel/interpolate/tune.rs, crates/burn-dataset/src/dataset/base.rs.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 7 of 40 project(s) overshoot their size bounds, lowering Project Cohesion to 6.6/10. The most over is `crates/burn-train` (27991 LoC, 264 module-visible types across 25 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D34 · Knowledge Freshness · Orphaned files with no living knowledge · ×1
  • Orphaned files with no living knowledge — 14 of 808 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 808 of the 1175 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: crates/burn-communication/src/external_comm.rs, crates/burn-optim/src/lr_scheduler/step.rs, crates/burn-optim/src/lr_scheduler/sequential.rs, crates/burn-train/src/metric/vision/dists/vgg16_l2pool.rs, crates/burn-train/src/metric/vision/lpips/squeezenet.rs, crates/burn-train/src/metric/vision/dists/l2pool.rs, crates/burn-train/src/metric/vision/dists/weights.rs, crates/burn-train/src/metric/vision/afine/clip_attention.rs (and 6 more). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 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 — 11 finding(s)
D12 · Dependency Hygiene · Outdated · ×11
  • 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.3 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: 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: 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: 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: 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: uuid — `uuid` is locked at 1.26.1 but 1.29.0 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: zip — `zip` is locked at 9.0.4 but 9.1.2 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/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-c758bf6d38a04d7d9081e0138421ba2b/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-c758bf6d38a04d7d9081e0138421ba2b/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .86artifacts/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 .11artifacts/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 01a17afe-dbf4-72db-98ab-42378aa22304 · 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