Public report of huggingface/lerobot, published 16 November 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 16 November 2026, 11:58 UTC · Survey ID cd_a9662bf2f1174abbae4724dde258f423
huggingface/lerobot
Measured 16 November 2026, 11:57 UTC, at code version fe1c545
Test reliability is not measured: The suite could not be re-run, but the repository declares tests of its own unreliable.
CAI scoreAdequate
CriticalWeakAdequateStrongExemplary
Down 4 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: 198,164 lines of product code in 1 project, tests not counted · Estimated rebuild effort: about 2.3 person-years · Weakest lens: Production Readiness, 57
Findings by how serious they are
14 critical1336 serious130 minor
13 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
16 November 2026, 11:57 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
54of 54 dimensions measured by tools.
1467of 1480 findings point to an exact file and line, so you can open each one in the code. The other 13 concern the repository as a whole, such as missing documentation.
54dimensions across 6 lenses, read from 198,164 lines of product code in 1 project.
huggingface/lerobot falls short of our standard for a preview release, held back most by its Production Readiness lens, the way the code is tested, built, released and run. It scores 63 out of 100 and is rated Adequate, and ten of its 14 critical findings are security problems.
Production Readiness, at 57, is the weakest lens and counts most in the score. The best first step is recording design decisions, worth about 3 points. Documenting the recovery plan would lift Production Readiness itself, also worth about 3. Raising Production Readiness to 62 would lift the score to about 65.
Eight settings leave the servers or containers unsafe. One known security hole in a package the code depends on can be used by attackers, and three parts of the code are no longer understood by anyone working on it. Correcting the unsafe settings, updating the vulnerable packages and having someone learn the forgotten files would close these risks. The pipeline step that installs packages without pinning their versions needs the packages it installs pinned to exact versions. The test the project itself marks as unreliable needs fixing or deleting.
The product code is 198,164 lines, about €340,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 forThe 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.
If Production Readiness rose from 57 to 62, the lowest score rated Strong, the score would rise from 63 to about 65.
Code composition: what the lines of code are
Product code 67%Tests 33%
New since the last survey: 275 findings
These 275 critical or serious findings weren't in the previous survey, on 4 November 2026. The first 100 are listed here, and the findings file in the download package lists them all.
God Classes · FileTooLong: sarm_annotations/subtask_annotation.py src/lerobot/data_processing/sarm_annotations/subtask_annotation.py
God Classes · FileTooLong: praxis/modeling_praxis.py src/lerobot/policies/praxis/modeling_praxis.py
God Classes · FileTooLong: praxis_core/checkpoint.py src/lerobot/policies/praxis/praxis_core/checkpoint.py
God Classes · FileTooLong: praxis_core/layers.py src/lerobot/policies/praxis/praxis_core/layers.py
God Classes · FileTooLong: praxis_core/vae.py src/lerobot/policies/praxis/praxis_core/vae.py
God Classes · FileTooLong: praxis_core/action_expert.py src/lerobot/policies/praxis/praxis_core/action_expert.py
God Classes · FileTooLong: praxis_core/backbone.py src/lerobot/policies/praxis/praxis_core/backbone.py
Code Duplication · Near-duplicate member pair (22 shared lines) src/lerobot/policies/praxis/praxis_core/bimanual.py
Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) src/lerobot/robots/hope_jr/hope_jr_arm.py
Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) src/lerobot/policies/lawam/modeling_lawam.py
Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) src/lerobot/rl/actor.py
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) src/lerobot/policies/eo1/modeling_eo1.py
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) src/lerobot/robots/bi_openarm_follower/bi_openarm_follower.py
Code Duplication · Edited copy of a member (94 corresponding lines) src/lerobot/policies/pi0/modeling_pi0.py
Code Duplication · Edited copy of a member (61 corresponding lines) src/lerobot/robots/bi_openarm_follower/bi_openarm_follower.py
Code Duplication · Edited copy of a member (52 corresponding lines) src/lerobot/rewards/sarm/modeling_sarm.py
Code Duplication · Edited copy of a member (51 corresponding lines) src/lerobot/robots/so_follower/robot_kinematic_processor.py
Code Duplication · Edited copy of a member (47 corresponding lines) src/lerobot/policies/pi0/modeling_pi0.py
Code Duplication · Edited copy of a member (50 corresponding lines) src/lerobot/policies/evo1/modeling_evo1.py
Code Duplication · Edited copy of a member (51 corresponding lines) src/lerobot/motors/damiao/damiao.py
Code Duplication · Edited copy of a member (63 corresponding lines) src/lerobot/policies/pi0/modeling_pi0.py
Code Duplication · Edited copy of a member (46 corresponding lines) src/lerobot/policies/diffusion/modeling_diffusion.py
Code Duplication · Edited copy of a member (73 corresponding lines) src/lerobot/robots/utils.py
Code Duplication · Edited copy of a member (50 corresponding lines) src/lerobot/configs/policies.py
Code Duplication · Edited copy of a member (35 corresponding lines) src/lerobot/policies/cosmos3/modeling_cosmos3.py
Code Duplication · Edited copy of a member (46 corresponding lines) src/lerobot/policies/lingbot_vla_v2/model_core/qwen2_action_expert.py
Code Duplication · Edited copy of a member (27 corresponding lines) src/lerobot/policies/smolvla/modeling_smolvla.py
Code Duplication · Edited copy of a member (37 corresponding lines) src/lerobot/policies/pi0/modeling_pi0.py
Code Duplication · Edited copy of a member (41 corresponding lines) src/lerobot/policies/groot/configuration_groot.py
Code Duplication · Edited copy of a member (32 corresponding lines) src/lerobot/policies/pi05/processor_pi05.py
Code Duplication · Edited copy of a member (34 corresponding lines) src/lerobot/robots/unitree_g1/controllers/holosoma_locomotion.py
Code Duplication · Edited copy of a member (40 corresponding lines) src/lerobot/policies/pi0/modeling_pi0.py
Code Duplication · Edited copy of a member (27 corresponding lines) src/lerobot/motors/motors_bus.py
Code Duplication · Edited copy of a member (33 corresponding lines) src/lerobot/policies/pi0/modeling_pi0.py
Code Duplication · Edited copy of a member (21 corresponding lines) src/lerobot/motors/damiao/damiao.py
Code Duplication · Edited copy of a member (23 corresponding lines) src/lerobot/policies/praxis/praxis_core/bimanual.py
Code Duplication · Edited copy of a member (32 corresponding lines) src/lerobot/rollout/strategies/dagger.py
Code Duplication · Edited copy of a member (54 corresponding lines) src/lerobot/policies/pi0/modeling_pi0.py
Code Duplication · Edited copy of a member (30 corresponding lines) src/lerobot/policies/molmoact2/molmoact2_hf_model/image_processing_molmoact2.py
Code Duplication · Edited copy of a member (22 corresponding lines) src/lerobot/policies/praxis/praxis_core/bimanual.py
Code Duplication · Edited copy of a member (21 corresponding lines) src/lerobot/policies/xvla/action_hub.py
Code Duplication · Edited copy of a member (33 corresponding lines) src/lerobot/scripts/lerobot_edit_dataset.py
Code Duplication · Edited copy of a member (27 corresponding lines) src/lerobot/rewards/robometer/processor_robometer.py
Code Duplication · Edited copy of a member (22 corresponding lines) src/lerobot/policies/lawam/lam_core/core/utils/pos_embs.py
Code Duplication · Edited copy of a member (36 corresponding lines) src/lerobot/policies/groot/action_head/cross_attention_dit.py
Code Duplication · Edited copy of a member (36 corresponding lines) src/lerobot/motors/damiao/damiao.py
Code Duplication · Edited copy of a member (51 corresponding lines) src/lerobot/policies/fastwam/wan/modular.py
Code Duplication · Edited copy of a member (35 corresponding lines) src/lerobot/robots/rebot_b601_follower/rebot_b601_follower.py
Code Duplication · Edited copy of a member (16 corresponding lines) src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py
Code Duplication · Edited copy of a member (21 corresponding lines) src/lerobot/robots/omx_follower/omx_follower.py
Code Duplication · Edited copy of a member (23 corresponding lines) src/lerobot/motors/damiao/damiao.py
Code Duplication · Edited copy of a member (44 corresponding lines) src/lerobot/policies/groot/action_head/cross_attention_dit.py
Code Duplication · Edited copy of a member (38 corresponding lines) src/lerobot/cameras/opencv/camera_opencv.py
Code Duplication · Edited copy of a member (15 corresponding lines) src/lerobot/policies/pretrained.py
Code Duplication · Edited copy of a member (19 corresponding lines) src/lerobot/policies/diffusion/configuration_diffusion.py
Code Duplication · Edited copy of a member (39 corresponding lines) src/lerobot/rewards/pretrained.py
Code Duplication · Edited copy of a member (38 corresponding lines) src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py
We compare every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 74 findings
These 74 critical or serious findings were in the previous survey, on 4 November 2026, and are gone from this one.
Dependency Vulnerabilities · High CVE: [GHSA redacted] REDACTED
IaC & Container Security · Medium IaC: CKV_DOCKER_2 docker/Dockerfile.benchmark.libero
IaC & Container Security · Medium IaC: CKV_DOCKER_3 docker/Dockerfile.benchmark.libero
IaC & Container Security · Medium IaC: REDACTED docker/Dockerfile.benchmark.libero
IaC & Container Security · Medium IaC: CKV_DOCKER_2 docker/Dockerfile.benchmark.libero_plus
IaC & Container Security · Medium IaC: REDACTED docker/Dockerfile.benchmark.libero_plus
IaC & Container Security · Medium IaC: CKV_DOCKER_2 docker/Dockerfile.benchmark.metaworld
IaC & Container Security · Medium IaC: CKV_DOCKER_3 docker/Dockerfile.benchmark.metaworld
IaC & Container Security · Medium IaC: REDACTED docker/Dockerfile.benchmark.metaworld
IaC & Container Security · Medium IaC: CKV_DOCKER_2 docker/Dockerfile.benchmark.robocasa
IaC & Container Security · Medium IaC: CKV_DOCKER_3 docker/Dockerfile.benchmark.robocasa
IaC & Container Security · Medium IaC: REDACTED docker/Dockerfile.benchmark.robocasa
IaC & Container Security · Medium IaC: CKV_DOCKER_2 docker/Dockerfile.benchmark.robocerebra
IaC & Container Security · Medium IaC: CKV_DOCKER_3 docker/Dockerfile.benchmark.robocerebra
IaC & Container Security · Medium IaC: REDACTED docker/Dockerfile.benchmark.robocerebra
IaC & Container Security · Medium IaC: CKV_DOCKER_2 docker/Dockerfile.benchmark.robomme
IaC & Container Security · Medium IaC: REDACTED docker/Dockerfile.benchmark.robomme
IaC & Container Security · Medium IaC: CKV_DOCKER_2 docker/Dockerfile.benchmark.robotwin
IaC & Container Security · Medium IaC: REDACTED docker/Dockerfile.benchmark.robotwin
IaC & Container Security · Medium IaC: CKV_DOCKER_2 docker/Dockerfile.benchmark.vlabench
IaC & Container Security · Medium IaC: CKV_DOCKER_3 docker/Dockerfile.benchmark.vlabench
IaC & Container Security · Medium IaC: REDACTED docker/Dockerfile.benchmark.vlabench
Rebuild cost: about €340,000 · Estimate
Cost to rebuild
€110,000 to €570,000, for 1,878 to 5,956 hours of work, about 2.3 person-years for 1 to 5 engineers
Difficulty of the problem
Standard, 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 63. 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.
Size
Large: 198,164 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with pyproject.toml.
Raises the score by about 3 points · Low effort · ADR Quality
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
Raises the score by about 3 points · Medium effort · DR & Backup
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 €340,000 to build again, about 2.3 person-years of work. Its weakest lens is Production Readiness, at 57 (Adequate). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
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 6.5 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 4% to 8% on every change. The history of the code shows how much it changes: about 219,859 lines over the last 90 days, which is about 891,650 lines a year. At that pace, the extra work comes to an estimated 81.1 to 486.9 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture: 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.
535 modules, with 811 dependencies between them. Every module uses only modules listed above it, so there are no loops.
The table shows the 40 modules with the most connections; 495 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.
annotations.steerable_pipeline.config uses configs.default, so a change to configs.default can break annotations.steerable_pipeline.config, while a change to annotations.steerable_pipeline.config can't break configs.default.
Position
Below the diagonal: annotations.steerable_pipeline.config uses a module listed above it, which is the healthy direction.
configs.policies uses optim.optimizers, so a change to optim.optimizers can break configs.policies, while a change to configs.policies can't break optim.optimizers.
Position
Below the diagonal: configs.policies uses a module listed above it, which is the healthy direction.
configs.train uses configs.default, so a change to configs.default can break configs.train, while a change to configs.train can't break configs.default.
Position
Below the diagonal: configs.train uses a module listed above it, which is the healthy direction.
processor.pipeline uses lerobot_types, so a change to lerobot_types can break processor.pipeline, while a change to processor.pipeline can't break lerobot_types.
Position
Below the diagonal: processor.pipeline uses a module listed above it, which is the healthy direction.
remote_inference.client uses transport.protocol.envelope, so a change to transport.protocol.envelope can break remote_inference.client, while a change to remote_inference.client can't break transport.protocol.envelope.
Position
Below the diagonal: remote_inference.client uses a module listed above it, which is the healthy direction.
remote_inference.client uses utils.feature_spec, so a change to utils.feature_spec can break remote_inference.client, while a change to remote_inference.client can't break utils.feature_spec.
Position
Below the diagonal: remote_inference.client uses a module listed above it, which is the healthy direction.
robots.robot uses motors.motors_bus, so a change to motors.motors_bus can break robots.robot, while a change to robots.robot can't break motors.motors_bus.
Position
Below the diagonal: robots.robot uses a module listed above it, which is the healthy direction.
rollout.context uses inference.base, so a change to inference.base can break rollout.context, while a change to rollout.context can't break inference.base.
Position
Below the diagonal: rollout.context uses a module listed above it, which is the healthy direction.
rollout.context uses rollout.configs, so a change to rollout.configs can break rollout.context, while a change to rollout.context can't break rollout.configs.
Position
Below the diagonal: rollout.context uses a module listed above it, which is the healthy direction.
teleoperators.teleoperator uses motors.motors_bus, so a change to motors.motors_bus can break teleoperators.teleoperator, while a change to teleoperators.teleoperator can't break motors.motors_bus.
Position
Below the diagonal: teleoperators.teleoperator uses a module listed above it, which is the healthy direction.
teleoperators.teleoperator uses teleoperators.config, so a change to teleoperators.config can break teleoperators.teleoperator, while a change to teleoperators.teleoperator can't break teleoperators.config.
Position
Below the diagonal: teleoperators.teleoperator uses a module listed above it, which is the healthy direction.
datasets uses datasets.lerobot_dataset, so a change to datasets.lerobot_dataset can break datasets, while a change to datasets can't break datasets.lerobot_dataset.
Position
Below the diagonal: datasets uses a module listed above it, which is the healthy direction.
policies.pretrained uses policies.checkpoint, so a change to policies.checkpoint can break policies.pretrained, while a change to policies.pretrained can't break policies.checkpoint.
Position
Below the diagonal: policies.pretrained uses a module listed above it, which is the healthy direction.
policies.pretrained uses policies.chunk, so a change to policies.chunk can break policies.pretrained, while a change to policies.pretrained can't break policies.chunk.
Position
Below the diagonal: policies.pretrained uses a module listed above it, which is the healthy direction.
policies.pretrained uses utils.hub, so a change to utils.hub can break policies.pretrained, while a change to policies.pretrained can't break utils.hub.
Position
Below the diagonal: policies.pretrained uses a module listed above it, which is the healthy direction.
policies.pretrained uses configs.policies, so a change to configs.policies can break policies.pretrained, while a change to policies.pretrained can't break configs.policies.
Position
Below the diagonal: policies.pretrained uses a module listed above it, which is the healthy direction.
policies.pretrained uses configs.train, so a change to configs.train can break policies.pretrained, while a change to policies.pretrained can't break configs.train.
Position
Below the diagonal: policies.pretrained uses a module listed above it, which is the healthy direction.
policies.vla_jepa.configuration_vla_jepa uses optim.optimizers, so a change to optim.optimizers can break policies.vla_jepa.configuration_vla_jepa, while a change to policies.vla_jepa.configuration_vla_jepa can't break optim.optimizers.
Position
Below the diagonal: policies.vla_jepa.configuration_vla_jepa uses a module listed above it, which is the healthy direction.
policies.vla_jepa.configuration_vla_jepa uses optim.schedulers, so a change to optim.schedulers can break policies.vla_jepa.configuration_vla_jepa, while a change to policies.vla_jepa.configuration_vla_jepa can't break optim.schedulers.
Position
Below the diagonal: policies.vla_jepa.configuration_vla_jepa uses a module listed above it, which is the healthy direction.
policies.vla_jepa.configuration_vla_jepa uses configs.policies, so a change to configs.policies can break policies.vla_jepa.configuration_vla_jepa, while a change to policies.vla_jepa.configuration_vla_jepa can't break configs.policies.
Position
Below the diagonal: policies.vla_jepa.configuration_vla_jepa uses a module listed above it, which is the healthy direction.
processor.normalize_processor uses datasets.lerobot_dataset, so a change to datasets.lerobot_dataset can break processor.normalize_processor, while a change to processor.normalize_processor can't break datasets.lerobot_dataset.
Position
Below the diagonal: processor.normalize_processor uses a module listed above it, which is the healthy direction.
processor.normalize_processor uses lerobot_types, so a change to lerobot_types can break processor.normalize_processor, while a change to processor.normalize_processor can't break lerobot_types.
Position
Below the diagonal: processor.normalize_processor uses a module listed above it, which is the healthy direction.
processor.normalize_processor uses processor.pipeline, so a change to processor.pipeline can break processor.normalize_processor, while a change to processor.normalize_processor can't break processor.pipeline.
Position
Below the diagonal: processor.normalize_processor uses a module listed above it, which is the healthy direction.
remote_inference uses transport.protocol.envelope, so a change to transport.protocol.envelope can break remote_inference, while a change to remote_inference can't break transport.protocol.envelope.
Position
Below the diagonal: remote_inference uses a module listed above it, which is the healthy direction.
remote_inference uses utils.feature_spec, so a change to utils.feature_spec can break remote_inference, while a change to remote_inference can't break utils.feature_spec.
Position
Below the diagonal: remote_inference uses a module listed above it, which is the healthy direction.
remote_inference uses configs.policies, so a change to configs.policies can break remote_inference, while a change to remote_inference can't break configs.policies.
Position
Below the diagonal: remote_inference uses a module listed above it, which is the healthy direction.
rewards.pretrained uses configs.rewards, so a change to configs.rewards can break rewards.pretrained, while a change to rewards.pretrained can't break configs.rewards.
Position
Below the diagonal: rewards.pretrained uses a module listed above it, which is the healthy direction.
rl uses teleoperators.teleoperator, so a change to teleoperators.teleoperator can break rl, while a change to rl can't break teleoperators.teleoperator.
Position
Below the diagonal: rl uses a module listed above it, which is the healthy direction.
rollout.strategies.core uses datasets.lerobot_dataset, so a change to datasets.lerobot_dataset can break rollout.strategies.core, while a change to rollout.strategies.core can't break datasets.lerobot_dataset.
Position
Below the diagonal: rollout.strategies.core uses a module listed above it, which is the healthy direction.
rollout.strategies.core uses inference.base, so a change to inference.base can break rollout.strategies.core, while a change to rollout.strategies.core can't break inference.base.
Position
Below the diagonal: rollout.strategies.core uses a module listed above it, which is the healthy direction.
rollout.strategies.core uses rollout.configs, so a change to rollout.configs can break rollout.strategies.core, while a change to rollout.strategies.core can't break rollout.configs.
Position
Below the diagonal: rollout.strategies.core uses a module listed above it, which is the healthy direction.
rollout.strategies.core uses rollout.context, so a change to rollout.context can break rollout.strategies.core, while a change to rollout.strategies.core can't break rollout.context.
Position
Below the diagonal: rollout.strategies.core uses a module listed above it, which is the healthy direction.
rollout.strategies.core uses teleoperators.teleoperator, so a change to teleoperators.teleoperator can break rollout.strategies.core, while a change to rollout.strategies.core can't break teleoperators.teleoperator.
Position
Below the diagonal: rollout.strategies.core uses a module listed above it, which is the healthy direction.
common uses datasets.lerobot_dataset, so a change to datasets.lerobot_dataset can break common, while a change to common can't break datasets.lerobot_dataset.
Position
Below the diagonal: common uses a module listed above it, which is the healthy direction.
common uses teleoperators.teleoperator, so a change to teleoperators.teleoperator can break common, while a change to common can't break teleoperators.teleoperator.
Position
Below the diagonal: common uses a module listed above it, which is the healthy direction.
rollout.strategies.dagger uses inference.base, so a change to inference.base can break rollout.strategies.dagger, while a change to rollout.strategies.dagger can't break inference.base.
Position
Below the diagonal: rollout.strategies.dagger uses a module listed above it, which is the healthy direction.
rollout.strategies.dagger uses rollout.configs, so a change to rollout.configs can break rollout.strategies.dagger, while a change to rollout.strategies.dagger can't break rollout.configs.
Position
Below the diagonal: rollout.strategies.dagger uses a module listed above it, which is the healthy direction.
rollout.strategies.dagger uses rollout.context, so a change to rollout.context can break rollout.strategies.dagger, while a change to rollout.strategies.dagger can't break rollout.context.
Position
Below the diagonal: rollout.strategies.dagger uses a module listed above it, which is the healthy direction.
rollout.strategies.dagger uses teleoperators.teleoperator, so a change to teleoperators.teleoperator can break rollout.strategies.dagger, while a change to rollout.strategies.dagger can't break teleoperators.teleoperator.
Position
Below the diagonal: rollout.strategies.dagger uses a module listed above it, which is the healthy direction.
rollout.strategies.dagger uses rollout.strategies.core, so a change to rollout.strategies.core can break rollout.strategies.dagger, while a change to rollout.strategies.dagger can't break rollout.strategies.core.
Position
Below the diagonal: rollout.strategies.dagger uses a module listed above it, which is the healthy direction.
scripts uses datasets.lerobot_dataset, so a change to datasets.lerobot_dataset can break scripts, while a change to scripts can't break datasets.lerobot_dataset.
Position
Below the diagonal: scripts uses a module listed above it, which is the healthy direction.
scripts uses annotations.steerable_pipeline.config, so a change to annotations.steerable_pipeline.config can break scripts, while a change to scripts can't break annotations.steerable_pipeline.config.
Position
Below the diagonal: scripts uses a module listed above it, which is the healthy direction.
scripts uses teleoperators.teleoperator, so a change to teleoperators.teleoperator can break scripts, while a change to scripts can't break teleoperators.teleoperator.
Position
Below the diagonal: scripts uses a module listed above it, which is the healthy direction.
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 category
Findings
Severity
A02:2025 — Security Misconfiguration
32
High / Critical
A05:2025 — Injection
9
High / Critical
A03:2025 — Software Supply Chain Failures
3
High / Critical
Roadmap
Top priorities: Interpolated log message defeats structured logging; Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery); Resolve the 1 No ADRs found finding(s) in ADR Quality — start with pyproject.toml.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with pyproject.toml.
Add a SAST step to CI running what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — so a security regression fails the build instead of landing.
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.
Per-file score 0–10 — a quality signature. Of 334 files carrying findings, judged against the Preview bar: 0% slop · 20% mixed · 80% near-clean.
File
Score
Band
Worst signal
REDACTED
0.9
Slop
IaC & Container Security: High IaC: REDACTED
REDACTED
3.5
Mixed
IaC & Container Security: High IaC: REDACTED
REDACTED
4.1
Mixed
IaC & Container Security: High IaC: REDACTED
REDACTED
4.1
Mixed
IaC & Container Security: High IaC: REDACTED
REDACTED
4.9
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
5.1
Mixed
IaC & Container Security: High IaC: REDACTED
REDACTED
5.7
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
5.7
Mixed
Static Analysis (SAST): Medium: REDACTED
src/lerobot/scripts/lerobot_train.py
6.0
Mixed
Explicit Debt: TodoComment
src/lerobot/policies/wall_x/modeling_wall_x.py
6.0
Mixed
Explicit Debt: TodoComment
src/lerobot/scripts/lerobot_eval.py
6.0
Mixed
Explicit Debt: FixmeComment
src/lerobot/policies/factory.py
6.0
Mixed
Explicit Debt: TodoComment
src/lerobot/rollout/context.py
6.0
Mixed
Explicit Debt: TodoComment
src/lerobot/rollout/configs.py
6.0
Mixed
Explicit Debt: TodoComment
src/lerobot/scripts/lerobot_dataset_viz.py
6.0
Mixed
Explicit Debt: TodoComment
src/lerobot/scripts/lerobot_record.py
6.0
Mixed
Explicit Debt: TodoComment
src/lerobot/teleoperators/unitree_g1/exo_calib.py
6.0
Mixed
Explicit Debt: TodoComment
src/lerobot/datasets/dataset_tools.py
6.0
Mixed
Explicit Debt: TodoComment
src/lerobot/datasets/video_utils.py
6.0
Mixed
Explicit Debt: TodoComment
src/lerobot/envs/utils.py
6.0
Mixed
Explicit 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 — 14
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 — 1336
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 — 130
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 13
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 54 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.
Every figure here is one of two kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.
What we checked — 54 dimensions across the health lenses
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
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, 1467 of 1480 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.)
Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
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.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: test source is present (.py) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This repository declares 1 of its own test(s) unreliable. The built-in reliability runner does not support this repository's ecosystem (.py), so the suite was not re-run and no reliability score is given — these are the repository's own declarations, not our measurement.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is an ADMISSION gap, not an environment fault: it declares a published package (setup.py), but no published-package marker D22 reads admitted any project here. D22 DOES collect the public API of every language in this tree, and admits a project only when its manifest makes that ecosystem's publication act in a form the marker recognises — so what is missing is not a collector but an admission rule for the publication act this repository makes, if it makes one. The remedy is a better discriminator for that marker — not a collector, and no change to the scan image can close it. The marker's rules are measured to refuse applications, so one refused repository is the rule working as calibrated; several are the evidence that it is too strict.
D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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.
D26 Project Cohesion — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `(repository root)` (188135 LoC, 1737 module-visible types across 149 directories) is over its size bounds, and whether one unit is a coherent whole or a grab-bag is read from its type references: the parts of it that reach the rest only through its shared core. Those are read over the C#/VB code model, which this unit's source did not supply. Its size alone is no verdict on its cohesion, so none is published.
D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `src/lerobot/datasets/aggregate.py`, `src/lerobot/datasets/lance_backend.py`, `src/lerobot/motors/motors_bus.py`, `src/lerobot/policies/wall_oss_05/modeling_wall_oss_05.py`, `src/lerobot/processor/pipeline.py`, … (+6 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DockerCompose (REDACTED). compose up failed (exit 15 — the compose project is invalid) — error while interpolating services.sim.image: required variable SIM is missing a value: Select a backend; runtime evidence skipped.
C1 Data Protection — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby, Scala and Rust source only, and no C#, F#, JavaScript/TypeScript, Dart, Ruby, Scala or Rust was found, and this repository's Python is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby, Scala and Rust source only, and no C#, JavaScript/TypeScript, Java, Dart, Ruby, Scala or Rust was found, and this repository's Python is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
S1 Web-Security Posture — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
X10 Duplicated predicate — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 55 further occurrence(s) are not listed individually; the score already reflects all 95.
X16 Unfloored truncation loop — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala, Kotlin and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala, Kotlin or Rust was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X18 Disposal-pattern correctness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala, PHP and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala, PHP or Rust 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.
X29 Per-element action decided by a fixed element — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript (Vue and Svelte components included), Java, Rust, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, Rust, 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.
X4 Structured logging — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 553 further occurrence(s) are not listed individually; the score already reflects all 593.
X5 Nullable reference types — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax and MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, Kotlin source, and Rust source only, and no C# was loaded, no TypeScript was found, and this repository's Python is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
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.
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.
166 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was lerobot_train.train at 93. A further 2 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 utils.make_teleoperator_from_config at 21 — they are counted neither in the figure above nor in this dimension's score. 2 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: src/lerobot/teleoperators/utils.py (utils.make_teleoperator_from_config at 21), src/lerobot/robots/utils.py (utils.make_robot_from_config at 19). 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.
+ 161 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 1 body over 60 down to 60 or less in Cyclomatic Complexity — start with lerobot_train.train (cyclomatic 93). — Refactoring it lifts Cyclomatic Complexity from 6.1 to about 6.5/10.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
+ 337 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 1 body over 120 down to 120 or less in Cognitive Complexity — start with lerobot_train.train (cognitive 165). — Refactoring it lifts Cognitive Complexity from 2.9 to about 3.6/10.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.6 / 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.
Resolve the 56 FileTooLong finding(s) in God Classes — start with modeling_molmoact2.py (2), processor_groot.py, modular.py. — One of this dimension's main actionable groups (56 warning-level).
Resolve the 8 TooManyMethods finding(s) in God Classes — start with modeling_molmoact2.py (2), motors_bus.py, base.py. — One of this dimension's main actionable groups (8 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.
314 duplicated block group(s) detected. 6.8 % of the production lines (13,507 of 198,164) are in a reported copy. A further 205 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 31 of the 519 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.
+ 205 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 17 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with subtask_annotation.py, factory.py, modeling_cosmos3.py. — One of this dimension's main actionable groups (17 warning-level).
Resolve the 17 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with dataset_tools.py (2), modeling_pi0.py (2), homunculus_arm.py (2). — One of this dimension's main actionable groups (17 warning-level).
Resolve the 16 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with modeling_molmoact2.py (3), bimanual.py (2), modeling_act.py. — One of this dimension's main actionable groups (16 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
Resolve the 2 Low cohesion finding(s) in Cohesion (LCOM4) — start with pretrained.py, core.py. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.
4 outdated, 0 yanked pinned Python distributions. 9 of 21 shipped distributions were graded against pypi.org (0 not published there, 12 declared without an exact pin, which installs the newest release the declaration admits and so cannot be behind one). Only EXACT pins are graded for currency: a floor or a range already installs the newest release it admits, so reporting one would report this repository for being current. Whether a deliberate upper cap has itself gone stale is a different and weaker question, and is not asked. Whether any distribution is UNMAINTAINED is not graded — PyPI publishes no maintenance status, and release age does not stand in for one. Lockfiles are not read (poetry.lock, REDACTED, Pipfile.lock, pdm.lock), so a lock-resolved install is outside this verdict. Known CVEs in this dependency graph are D30's question.
Outdated: eclipse-zenoh · ×4
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
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.
0 of 63 shipped Python distribution(s) use a banned license. Licences were resolved from PyPI over the distributions a consumer installs — this repository's 21 declared runtime requirement(s) closed transitively over each distribution's published `requires_dist` (42 reached that way). Requirements it states ONLY under an extra, a PEP 735 dependency group, a Poetry dev group or a dev-named requirements file are excluded: pip does not install any of them for a consumer. ★ This repository commits no dependency lockfile that this pass reads, so each licence is the one PyPI publishes for the distribution's CURRENT release rather than for a pinned version. 7 of them publish no licence on PyPI this pass can read; that is missing data, not a violation, and none of them is charged. This repository publishes itself under Apache-2.0, which is its own choice and is not judged here.
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.
Top hotspots: src/lerobot/scripts/lerobot_train.py (15×93=1395); src/lerobot/rollout/context.py (15×39=585); src/lerobot/scripts/lerobot_eval.py (11×45=495) Repeated repair below the complexity floor: src/lerobot/datasets/compute_stats.py (4 of 6 changes were fixes); src/lerobot/cameras/opencv/camera_opencv.py (3 of 4 changes were fixes); src/lerobot/utils/random_utils.py (3 of 4 changes were fixes)
Resolve the 40 Hotspot finding(s) in Churn × Complexity Hotspots — start with factory.py (2), lerobot_train.py, context.py. — One of this dimension's main actionable groups (40 warning-level).
Resolve the 3 Repeated repair finding(s) in Churn × Complexity Hotspots — start with compute_stats.py, camera_opencv.py, random_utils.py. — One of this dimension's main actionable groups (3 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
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.
29 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is src/lerobot/annotations/steerable_pipeline/modules/plan_subtasks_memory.py. Counted over 482 of the 661 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 · ×3
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.
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.
137 deducted task-comment markers across 198164 LoC (0.1/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.
Resolve the 130 TodoComment finding(s) in Explicit Debt — start with REDACTED (13), test_datasets.py (10), test_policies.py (5). — One of this dimension's main actionable groups (130 warning-level).
Resolve the 5 HackComment finding(s) in Explicit Debt — start with test_visual_validation.py, test_policies.py, hope_jr_arm.py. — One of this dimension's main actionable groups (5 warning-level).
Resolve the 2 FixmeComment finding(s) in Explicit Debt — start with lerobot_eval.py, modeling_wall_x.py. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
1 of 1 documentation facets pass in full. 165 document(s) read across 1 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with pyproject.toml. — 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.
What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.
Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.
Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.
64 % of calls cross a namespace and 2 % go through an interface, but 100 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated.
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.
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).
9 finding(s): 0 critical, 1 high, 7 medium, 1 low. semgrep hit a parse error in 11 file(s) — `src/lerobot/datasets/aggregate.py` (line 56, line 57, line 76), `src/lerobot/datasets/lance_backend.py` (line 170, lines 174–177, line 947), `src/lerobot/motors/motors_bus.py` (line 44, line 45), `src/lerobot/policies/wall_oss_05/modeling_wall_oss_05.py` (line 69), `src/lerobot/processor/pipeline.py` (line 78, line 266, lines 270–273, …), … (+6 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 2 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
Resolve the 5 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (5 warning-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2). — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
Resolve the 1 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 24 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (12), REDACTED (4), REDACTED (3). — One of this dimension's main actionable groups (24 warning-level).
Resolve the 8 High IaC finding(s) in IaC & Container Security — start with REDACTED (3), REDACTED, REDACTED. — One of this dimension's main actionable groups (8 issue-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
30 of 482 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is src/lerobot/policies/tdmpc/modeling_tdmpc.py. Counted over 482 of the 661 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Resolve the 3 Orphaned knowledge finding(s) in Knowledge Freshness — start with modeling_tdmpc.py, tokenizer_processor.py, action_hub.py. — One of this dimension's main actionable groups (3 issue-level).
Resolve the 27 Orphaned file finding(s) in Knowledge Freshness — start with REDACTED (2), gamepad_utils.py, calibration_gui.py. — One of this dimension's main actionable groups (27 recommendation-level).
Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
Resolve the 5 Change coupling finding(s) in Change Coupling — start with lerobot_calibrate.py (2), lerobot_replay.py, so_follower.py. — One of this dimension's main actionable groups (5 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.
Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 1 platform declaration(s) and 21 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
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.
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.
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.
Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').
Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
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.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.
Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.
docs/source/envhub_isaaclab_arena.mdx names Python 3.11, but pyproject.toml:32 requires `requires-python = ">=3.12"`: the package does not install on Python 3.11. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/source/envhub_isaaclab_arena.mdx:5
docs/source/envhub_leisaac.mdx names Python 3.11, but pyproject.toml:32 requires `requires-python = ">=3.12"`: the package does not install on Python 3.11. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/source/envhub_leisaac.mdx:5
docs/source/robocolosseum.mdx names Python 3.10 or later, but pyproject.toml:32 requires `requires-python = ">=3.12"`: the package does not install on Python 3.10. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/source/robocolosseum.mdx:113
docs/source/vlabench.mdx names Python 3.10 or later, but pyproject.toml:32 requires `requires-python = ">=3.12"`: the package does not install on Python 3.10. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/source/vlabench.mdx:60
src/lerobot/policies/dm05/README.md links to `./dm05.mdx`, but `src/lerobot/policies/dm05/dm05.mdx` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — src/lerobot/policies/dm05/README.md:6
What to do
Reconcile the README with reality: docs/source/envhub_isaaclab_arena.mdx names Python 3.11, but pyproject.toml:32 requires `requires-python = ">=3.12"`: the package does not install on Python 3.11; docs/source/envhub_leisaac.mdx names Python 3.11, but pyproject.toml:32 requires `requires-python = ">=3.12"`: the package does not install on Python 3.11; docs/source/robocolosseum.mdx names Python 3.10 or later, but pyproject.toml:32 requires `requires-python = ">=3.12"`: the package does not install on Python 3.10; docs/source/vlabench.mdx names Python 3.10 or later, but pyproject.toml:32 requires `requires-python = ">=3.12"`: the package does not install on Python 3.10; src/lerobot/policies/dm05/README.md links to `./dm05.mdx`, but `src/lerobot/policies/dm05/dm05.mdx` does not exist.
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.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
Do you agree with this assessment?
P2 · Observability7.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
No static application security testing detected. For this repository's stack, add bandit, `semgrep --config=p/python`, or CodeQL's python pack as a CI step. What was searched, so you can tell an absence from a miss: the 15 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner. — .github/workflows/benchmark_tests.yml:40
`.github/dependabot.yml` schedules updates, but no `package-ecosystem` entry covers `uv`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entry to the `updates:` list. — .github/dependabot.yml:2
What to do
Add a SAST step to CI running what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — so a security regression fails the build instead of landing.
Dependabot is configured but does not watch `uv` — add that `package-ecosystem` entry to .github/dependabot.yml so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
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.
Do you agree with this assessment?
P5 · DR & Backup4.0 / 10Weak✓ Tool-verified
Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
What to do
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
Enable purge protection / soft-delete (and prevent_destroy on critical resources) so data stores can't be lost to an accidental or malicious delete.
Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
What to do
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
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.
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.
Do you agree with this assessment?
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.
Do you agree with this assessment?
X15 · Unvalidated length from an untrusted reader3.5 / 10Weak✓ Tool-verified
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.
`sample_count` is read from the bytes being parsed at line 707 (`struct.unpack_from(">II")`), then used to size a `np.empty` at line 711 — and nowhere in its function is `sample_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: the call reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and the reservation either raises `MemoryError` out of a parser whose failure path was written for malformed input, not for hostile input, or succeeds and holds gigabytes for a few bytes on the wire. Bound `sample_count` against the bytes actually remaining and a maximum the format allows before reading. — src/lerobot/streaming/mp4.py:711
What to do
Each finding names the read that takes the length from the input and the site that spends it, and states that the value is never compared in between. Confirm from the two, then bound the length against the remaining stream before using it.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document1.6 / 10Critical✓ Tool-verified
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.
`unwrap_scalar` is public and takes `value: Any` from its caller, and it calls itself at line 186 (`unwrap_scalar`) with a piece of `value` — and nowhere in `unwrap_scalar` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `unwrap_scalar` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/lerobot/utils/utils.py:186
`flatten_dict` is public and takes `d: dict[str, Any]` from its caller, and it calls itself at line 251 (`flatten_dict`) with a piece of `d` — and nowhere in `flatten_dict` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `flatten_dict` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/lerobot/utils/utils.py:251
`slice_params` is public, takes a document from its caller (line 533) and hands it to `_slice`, which calls itself at line 552 (`_slice`) with a piece of `value` (and at line 554) — and nowhere in `_slice` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_slice` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/lerobot/transforms/transforms.py:552
`as_float_list` is public and takes `values: Any` from its caller, and it calls itself at line 83 (`as_float_list`) with a piece of `values` — and nowhere in `as_float_list` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `as_float_list` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/lerobot/policies/groot/utils.py:83
`format_speed_value` is public and takes `speed: Any` from its caller, and it calls itself at line 107 (`format_speed_value`) with a piece of `speed` — and nowhere in `format_speed_value` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `format_speed_value` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/lerobot/policies/dm05/core/tokenization.py:107
`check_served` is public, takes a document from its caller (line 241) and hands it to `plain`, which calls itself at line 247 (`plain`) with a piece of `value` (and at line 249) — and nowhere in `plain` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `plain` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/lerobot/envs/factory.py:247
`from_dict` is public and takes `data: dict[str, Any]` from its caller, and it calls itself at line 148 (`self.from_dict`) with a piece of `data` — and nowhere in `from_dict` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `from_dict` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/lerobot/datasets/recipe.py:148
What to do
Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
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.
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.
`debug` at line 273 is called with an argument built by `sum(p.numel() for p in self.parameters() if p.requires_grad)` (line 275), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on. — src/lerobot/policies/groot/action_head/cross_attention_dit.py:273
`debug` at line 434 is called with an argument built by `sum(p.numel() for p in self.parameters() if p.requires_grad)` (line 436), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on. — src/lerobot/policies/groot/action_head/cross_attention_dit.py:434
What to do
In Python, put the construction behind the logger's own check (`if logger.isEnabledFor(logging.DEBUG):`), or pass the collection itself with a `%s` placeholder (`logger.debug("Items %s", items)`) so the logging module renders it only when the record is emitted. The placeholder alone is not the fix when the argument is still built first: it defers the formatting, not a `json.dumps`, a `join` or a comprehension in the argument, and an f-string defers nothing at all.
Do you agree with this assessment?
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.
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.
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.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — 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.
Do you agree with this assessment?
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.
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.
An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `__del__()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: narrow the catch to the exception this release can actually raise, and record it through whatever this codebase already uses to report problems — or, if it truly cannot matter, say why in a comment on the catch. (×3) — src/lerobot/teleoperators/teleoperator.py:87, src/lerobot/robots/robot.py:96, src/lerobot/cameras/camera.py:75
`except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×12) — src/lerobot/teleoperators/unitree_g1/exo_ik.py:46, src/lerobot/rewards/topreward/compute_rabc_weights.py:68, src/lerobot/rewards/sarm/compute_rabc_weights.py:77, …
An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. — REDACTED:1351
What to do
Swallowed exception (empty catch)
Do you agree with this assessment?
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.
Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.
Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.
`warning` at line 407 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — src/lerobot/utils/cycle_timer.py:407
`warning` at line 68 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — src/lerobot/utils/device_utils.py:68
`warning` at line 101 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — src/lerobot/utils/device_utils.py:101
`warning` at line 104 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — src/lerobot/utils/device_utils.py:104
`debug` at line 84 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — src/lerobot/utils/import_utils.py:84
`warning` at line 102 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — src/lerobot/utils/import_utils.py:102
`info` at line 90 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — src/lerobot/utils/process.py:90
`info` at line 391 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — src/lerobot/utils/utils.py:391
`info` at line 393 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — src/lerobot/utils/utils.py:393
`info` at line 81 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — REDACTED:81
`debug` at line 83 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — REDACTED:83
`info` at line 85 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — REDACTED:85
`debug` at line 92 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — REDACTED:92
`debug` at line 97 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — REDACTED:97
`debug` at line 100 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — REDACTED:100
`debug` at line 111 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — REDACTED:111
`warning` at line 113 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — REDACTED:113
`info` at line 182 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — src/lerobot/teleoperators/teleoperator.py:182
`info` at line 187 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — src/lerobot/teleoperators/teleoperator.py:187
`info` at line 176 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — src/lerobot/teleoperators/unitree_g1/exo_calib.py:176
`info` at line 292 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — src/lerobot/teleoperators/unitree_g1/exo_calib.py:292
`info` at line 308 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — src/lerobot/teleoperators/unitree_g1/exo_calib.py:308
`info` at line 314 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — src/lerobot/teleoperators/unitree_g1/exo_calib.py:314
`info` at line 324 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — src/lerobot/teleoperators/unitree_g1/exo_calib.py:324
`info` at line 347 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — src/lerobot/teleoperators/unitree_g1/exo_calib.py:347
`info` at line 361 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — src/lerobot/teleoperators/unitree_g1/exo_calib.py:361
`info` at line 364 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — src/lerobot/teleoperators/unitree_g1/exo_calib.py:364
`info` at line 167 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — src/lerobot/teleoperators/unitree_g1/exo_ik.py:167
`warning` at line 187 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — src/lerobot/teleoperators/unitree_g1/exo_ik.py:187
`info` at line 194 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — src/lerobot/teleoperators/unitree_g1/exo_ik.py:194
`warning` at line 204 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — src/lerobot/teleoperators/unitree_g1/exo_ik.py:204
`info` at line 242 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — src/lerobot/teleoperators/unitree_g1/exo_ik.py:242
`warning` at line 70 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — src/lerobot/teleoperators/unitree_g1/exo_serial.py:70
`info` at line 114 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — src/lerobot/teleoperators/unitree_g1/exo_serial.py:114
`info` at line 132 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — src/lerobot/teleoperators/unitree_g1/exo_serial.py:132
`warning` at line 134 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — src/lerobot/teleoperators/unitree_g1/exo_serial.py:134
`info` at line 153 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — src/lerobot/teleoperators/unitree_g1/exo_serial.py:153
`info` at line 158 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — src/lerobot/teleoperators/unitree_g1/exo_serial.py:158
`info` at line 162 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — src/lerobot/teleoperators/unitree_g1/exo_serial.py:162
`info` at line 95 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — src/lerobot/teleoperators/so_leader/so_leader.py:95
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.
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 — 1 observation(s) recorded · This repository declares 1 of its own test(s) unreliable. The built-in reliability runner does not support this repository's ecosystem (.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 — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not included — 61 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
AX1 Captive dependencies — Not applicable: this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
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.
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
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — no test/production split to check
AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — compose up failed (exit 15 — the compose project is invalid) — error while interpolating services.sim.image: required variable SIM is missing a value: Select a backend; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) 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. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C2 Access Controls — No access-control surface detected in the analyzed source — this repository registers no route and starts no server another machine can reach (no Flask/FastAPI/Starlette route, Django urlpatterns or class-based view, Tornado handler). Access control is therefore N/A here — a library or command-line tool is authorized by the application that serves it, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or MongoEngine model, a migration or a SQL schema — and no database or data-store client (Django ORM, SQLAlchemy, psycopg, PyMongo, …) 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 on a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or mongoengine model, in a migration or in a SQL schema — and no database or data-store client (django.db, sqlalchemy, psycopg2, pymongo, sqlite3, …) imported 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 on a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or mongoengine model, in a migration or in a SQL schema — and no database or data-store client (django.db, sqlalchemy, psycopg2, pymongo, sqlite3, …) imported either, so this repository keeps no personal data for a data subject to erase, export or consent over.
D10 Test Quality — ~99551 lines of test source are present (.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 — D21 withholds its case and prefix conventions rows: 23 candidate(s) found and not reported.
D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only — this repository's production source is .py, 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
D26 Project Cohesion — D26 could not read how the parts of this repository's one build unit reference each other, so its cohesion was not measured. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D32 Data Compliance (PII/GDPR) — 11 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
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.
D5 Coupling — Not applicable — this Python build ships 1 production module(s), so there is no coupling BETWEEN modules to measure. (Its test and non-production modules are not part of the shipped graph.)
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 — not scored — this repository shows only 1 of the 3 signals this lens looks for (236 value object(s))
ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby, Scala and Rust, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the Python source, so there is no service whose uptime a failing dependency could take down
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
PF3 Async & latency hygiene — Not applicable: this repository declares no async functions, so there is no asynchronous code for a blocking call to stall.
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) 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. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
X1 Async correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X16 Unfloored truncation loop — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
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 was 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
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.
X21 Side-effecting pattern guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X29 Per-element action decided by a fixed element — 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
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
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.
Orphaned knowledge src/lerobot/policies/tdmpc/modeling_tdmpc.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge src/lerobot/processor/tokenizer_processor.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge src/lerobot/policies/xvla/action_hub.py:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
D11 · Test Reliability· Test declared unreliable · ×1
Test declared unreliable: test_async_read_timeout tests/cameras/test_opencv.py:262— This test is disabled or skipped with a reason naming unreliability — the repository's own words: "Skipping test: async_read 0 timeout behavior may be flaky/non-deterministic.". 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.)
TodoComment tests/utils/test_replay_buffer.py:394— # TODO: Check and fix it — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/training/test_visual_validation.py:144— # TODO: case 4: dataset has 2 cameras, policy expects 3, no rename_map, no empty_cameras, should raise for smolvla — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/policies/test_policies.py:173— # TODO(rcadene, aliberts): remove dataset download — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/policies/test_policies.py:257— # TODO(rcadene, aliberts): remove dataset download — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/datasets/test_datasets.py:615— # TODO(rcadene, aliberts): remove dataset download — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/datasets/test_datasets.py:721— # TODO(rcadene, aliberts): remove dataset download — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/policies/test_policies.py:250— # TODO(rcadene, aliberts): This test is quite end-to-end. Move this test in test_optimizer? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/policies/test_policies.py:594— # TODO(alexander-soare): `policy.use_mpc=false` was previously the default in the config yaml but it — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/policies/test_policies.py:597— # TODO(rcadene): the diffusion model was normalizing the image in mean=0.5 std=0.5 which is a hack supposed to — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/policies/pi0_pi05/openpi_pytorch/preprocessing_pytorch.py:40— # TODO: This is a hack to handle both [B, C, H, W] and [B, H, W, C] formats — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/mocks/mock_robot.py:49— # TODO with the cameras refactor — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/envs/test_envs.py:81— # TODO(rcadene): we assume for now that image normalization takes place in the model — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/datasets/test_datasets.py:655— # TODO(rcadene): we assume for now that image normalization takes place in the model — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/datasets/test_datasets.py:133— # TODO(rcadene, aliberts): do not run LeRobotDataset.create, instead refactor LeRobotDatasetMetadata.create — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/datasets/test_datasets.py:580— # TODO(aliberts): — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/datasets/test_datasets.py:587— # TODO(rcadene): — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/datasets/test_datasets.py:632— # TODO(rcadene): should we rename it agent_pos? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/datasets/test_datasets.py:672— # TODO(alexander-soare): If you're hunting for savings on testing time, this takes about 5 seconds. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/datasets/test_datasets.py:731— # TODO (michel-aractingi): transform language obs to language embeddings via tokenizer — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/datasets/test_datasets.py:738— # TODO(rcadene): remove when new features have been generated — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/cameras/test_realsense.py:163— # TODO(Steven): Fix this test for the latest version of pyrealsense2. — 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 src/lerobot/utils/constants.py:124— # TODO(pepijn): Modify this when extending support to fp8 models — 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 src/lerobot/utils/device_utils.py:39— # TODO(Steven): Remove log. log shouldn't be an argument, this should be handled by the logger 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.
TodoComment src/lerobot/utils/feature_utils.py:75— # TODO(CarolinePascal): we should not rely on the shape to determine if a feature is a camera ! — 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 src/lerobot/utils/feature_utils.py:156— # TODO(aliberts): Implement "type" in dataset features and simplify this — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FileTooLong: molmoact2_hf_model/modeling_molmoact2.py src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py— FileTooLong — 3809 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3309 over it, 7.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: groot/processor_groot.py src/lerobot/policies/groot/processor_groot.py— FileTooLong — 1921 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1421 over it, 3.84× 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: wan/modular.py src/lerobot/policies/fastwam/wan/modular.py— FileTooLong — 1754 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1254 over it, 3.51× 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: lingbot_vla_v2/modeling_lingbot_vla_v2.py src/lerobot/policies/lingbot_vla_v2/modeling_lingbot_vla_v2.py— FileTooLong — 1723 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1223 over it, 3.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: cosmos3/modeling_cosmos3.py src/lerobot/policies/cosmos3/modeling_cosmos3.py— FileTooLong — 1716 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1216 over it, 3.43× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: molmoact2/modeling_molmoact2.py src/lerobot/policies/molmoact2/modeling_molmoact2.py— FileTooLong — 1682 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1182 over it, 3.36× 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: core/modeling.py src/lerobot/policies/dm05/core/modeling.py— FileTooLong — 1418 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 918 over it, 2.84× 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: datasets/dataset_tools.py src/lerobot/datasets/dataset_tools.py— FileTooLong — 1272 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 772 over it, 2.54× 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: wall_x/modeling_wall_x.py src/lerobot/policies/wall_x/modeling_wall_x.py— FileTooLong — 1228 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 728 over it, 2.46× 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: REDACTED REDACTED— FileTooLong — 1201 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 701 over it, 2.40× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: pi05/modeling_pi05.py src/lerobot/policies/pi05/modeling_pi05.py— FileTooLong — 1170 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 670 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: molmoact2/processor_molmoact2.py src/lerobot/policies/molmoact2/processor_molmoact2.py— FileTooLong — 1094 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 594 over it, 2.19× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: transforms/transforms.py src/lerobot/transforms/transforms.py— FileTooLong — 942 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 442 over it, 1.88× 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: remote_inference/server.py src/lerobot/remote_inference/server.py— FileTooLong — 895 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 395 over it, 1.79× 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: vqbet/vqbet_utils.py src/lerobot/policies/vqbet/vqbet_utils.py— FileTooLong — 857 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 357 over it, 1.71× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: processor/pipeline.py src/lerobot/processor/pipeline.py— FileTooLong — 856 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 356 over it, 1.71× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: scripts/lerobot_eval.py src/lerobot/scripts/lerobot_eval.py— FileTooLong — 853 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 353 over it, 1.71× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: lingbot_va/utils.py src/lerobot/policies/lingbot_va/utils.py— FileTooLong — 844 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 344 over it, 1.69× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: pi0/modeling_pi0.py src/lerobot/policies/pi0/modeling_pi0.py— FileTooLong — 822 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 322 over it, 1.64× 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: wall_oss_05/modeling_wall_oss_05.py src/lerobot/policies/wall_oss_05/modeling_wall_oss_05.py— FileTooLong — 810 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 310 over it, 1.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: sarm_annotations/subtask_annotation.py src/lerobot/data_processing/sarm_annotations/subtask_annotation.py— FileTooLong — 804 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 304 over it, 1.61× 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: datasets/video_utils.py src/lerobot/datasets/video_utils.py— FileTooLong — 777 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 277 over it, 1.55× 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: pi0_fast/modeling_pi0_fast.py src/lerobot/policies/pi0_fast/modeling_pi0_fast.py— FileTooLong — 773 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 273 over it, 1.55× 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: praxis/modeling_praxis.py src/lerobot/policies/praxis/modeling_praxis.py— FileTooLong — 761 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 261 over it, 1.52× 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: groot/groot_n1_7.py src/lerobot/policies/groot/groot_n1_7.py— FileTooLong — 752 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 252 over it, 1.50× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
Hotspot: src/lerobot/scripts/lerobot_train.py src/lerobot/scripts/lerobot_train.py:529— src/lerobot/scripts/lerobot_train.py changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 93 in lerobot_train.train at line 529. 2 of those changes were fix/bug commits, and the other 13 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 13:00:08 +01:00' --until='2026-11-13 13:00:08 +01:00' --full-history --no-merges -- src/lerobot/scripts/lerobot_train.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/lerobot/rollout/context.py src/lerobot/rollout/context.py:478— src/lerobot/rollout/context.py changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in context.build_rollout_context at line 478. 5 of those changes were fix/bug commits, and the other 10 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 13:00:08 +01:00' --until='2026-11-13 13:00:08 +01:00' --full-history --no-merges -- src/lerobot/rollout/context.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/lerobot/scripts/lerobot_eval.py src/lerobot/scripts/lerobot_eval.py:174— src/lerobot/scripts/lerobot_eval.py changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 45 in lerobot_eval.rollout at line 174. 3 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 13:00:08 +01:00' --until='2026-11-13 13:00:08 +01:00' --full-history --no-merges -- src/lerobot/scripts/lerobot_eval.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/lerobot/policies/factory.py src/lerobot/policies/factory.py:256— src/lerobot/policies/factory.py changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in factory.make_policy at line 256. 6 of those changes were fix/bug commits, and the other 6 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 13:00:08 +01:00' --until='2026-11-13 13:00:08 +01:00' --full-history --no-merges -- src/lerobot/policies/factory.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: REDACTED REDACTED:85— REDACTED changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in DatasetConfig.__post_init__ at line 85. 2 of those changes were fix/bug commits, and the other 9 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 13:00:08 +01:00' --until='2026-11-13 13:00:08 +01:00' --full-history --no-merges -- REDACTED`: 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: src/lerobot/configs/train.py src/lerobot/configs/train.py:285— src/lerobot/configs/train.py changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in TrainPipelineConfig.validate at line 285. 3 of those changes were fix/bug commits, and the other 9 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 13:00:08 +01:00' --until='2026-11-13 13:00:08 +01:00' --full-history --no-merges -- src/lerobot/configs/train.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/lerobot/rollout/configs.py src/lerobot/rollout/configs.py:358— src/lerobot/rollout/configs.py changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in RolloutConfig.__post_init__ at line 358. 2 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 13:00:08 +01:00' --until='2026-11-13 13:00:08 +01:00' --full-history --no-merges -- src/lerobot/rollout/configs.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/lerobot/policies/wall_x/modeling_wall_x.py src/lerobot/policies/wall_x/modeling_wall_x.py:1053— src/lerobot/policies/wall_x/modeling_wall_x.py changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in Qwen2_5_VLMoEForAction.predict at line 1053. 1 of those changes was a fix/bug commit, and the other 6 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 13:00:08 +01:00' --until='2026-11-13 13:00:08 +01:00' --full-history --no-merges -- src/lerobot/policies/wall_x/modeling_wall_x.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/lerobot/datasets/lerobot_dataset.py src/lerobot/datasets/lerobot_dataset.py:53— src/lerobot/datasets/lerobot_dataset.py changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in LeRobotDataset.__init__ at line 53. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 13:00:08 +01:00' --until='2026-11-13 13:00:08 +01:00' --full-history --no-merges -- src/lerobot/datasets/lerobot_dataset.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/lerobot/policies/common/flow_matching.py src/lerobot/policies/common/flow_matching.py:256— src/lerobot/policies/common/flow_matching.py changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in flow_matching.euler_integrate at line 256. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 13:00:08 +01:00' --until='2026-11-13 13:00:08 +01:00' --full-history --no-merges -- src/lerobot/policies/common/flow_matching.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/lerobot/policies/pi05/modeling_pi05.py src/lerobot/policies/pi05/modeling_pi05.py:1102— src/lerobot/policies/pi05/modeling_pi05.py changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in PI05Policy.from_pretrained at line 1102. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 13:00:08 +01:00' --until='2026-11-13 13:00:08 +01:00' --full-history --no-merges -- src/lerobot/policies/pi05/modeling_pi05.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/lerobot/datasets/streaming_dataset.py src/lerobot/datasets/streaming_dataset.py:494— src/lerobot/datasets/streaming_dataset.py changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in StreamingLeRobotDataset._iter_once at line 494. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 13:00:08 +01:00' --until='2026-11-13 13:00:08 +01:00' --full-history --no-merges -- src/lerobot/datasets/streaming_dataset.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/lerobot/datasets/lance_backend.py src/lerobot/datasets/lance_backend.py:205— src/lerobot/datasets/lance_backend.py changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in LanceDatasetReader.__init__ at line 205. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 13:00:08 +01:00' --until='2026-11-13 13:00:08 +01:00' --full-history --no-merges -- src/lerobot/datasets/lance_backend.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/lerobot/datasets/dataset_tools.py src/lerobot/datasets/dataset_tools.py:1838— src/lerobot/datasets/dataset_tools.py changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in dataset_tools.convert_image_to_video_dataset at line 1838. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 13:00:08 +01:00' --until='2026-11-13 13:00:08 +01:00' --full-history --no-merges -- src/lerobot/datasets/dataset_tools.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/lerobot/datasets/factory.py src/lerobot/datasets/factory.py:108— src/lerobot/datasets/factory.py changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in factory.make_dataset at line 108. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 13:00:08 +01:00' --until='2026-11-13 13:00:08 +01:00' --full-history --no-merges -- src/lerobot/datasets/factory.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/lerobot/rollout/strategies/dagger.py src/lerobot/rollout/strategies/dagger.py:350— src/lerobot/rollout/strategies/dagger.py changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in DAggerStrategy._run_continuous at line 350. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 13:00:08 +01:00' --until='2026-11-13 13:00:08 +01:00' --full-history --no-merges -- src/lerobot/rollout/strategies/dagger.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/lerobot/rollout/strategies/episodic.py src/lerobot/rollout/strategies/episodic.py:109— src/lerobot/rollout/strategies/episodic.py changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in EpisodicStrategy.run at line 109. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 13:00:08 +01:00' --until='2026-11-13 13:00:08 +01:00' --full-history --no-merges -- src/lerobot/rollout/strategies/episodic.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/lerobot/scripts/lerobot_record.py src/lerobot/scripts/lerobot_record.py:394— src/lerobot/scripts/lerobot_record.py changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in lerobot_record.record 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-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 13:00:08 +01:00' --until='2026-11-13 13:00:08 +01:00' --full-history --no-merges -- src/lerobot/scripts/lerobot_record.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/lerobot/datasets/video_utils.py src/lerobot/datasets/video_utils.py:831— src/lerobot/datasets/video_utils.py changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in _CameraEncoderThread.run at line 831. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 13:00:08 +01:00' --until='2026-11-13 13:00:08 +01:00' --full-history --no-merges -- src/lerobot/datasets/video_utils.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/lerobot/policies/pi_gemma.py src/lerobot/policies/pi_gemma.py:228— src/lerobot/policies/pi_gemma.py changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in PiGemmaModel.forward at line 228. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 13:00:08 +01:00' --until='2026-11-13 13:00:08 +01:00' --full-history --no-merges -- src/lerobot/policies/pi_gemma.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/lerobot/inference/rtc.py src/lerobot/inference/rtc.py:114— src/lerobot/inference/rtc.py changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in RTCInferenceEngine.__init__ at line 114. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 13:00:08 +01:00' --until='2026-11-13 13:00:08 +01:00' --full-history --no-merges -- src/lerobot/inference/rtc.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/lerobot/policies/eo1/modeling_eo1.py src/lerobot/policies/eo1/modeling_eo1.py:443— src/lerobot/policies/eo1/modeling_eo1.py changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in EO1VisionFlowMatchingModel.forward at line 443. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 13:00:08 +01:00' --until='2026-11-13 13:00:08 +01:00' --full-history --no-merges -- src/lerobot/policies/eo1/modeling_eo1.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/lerobot/policies/eo1/processor_eo1.py src/lerobot/policies/eo1/processor_eo1.py:91— src/lerobot/policies/eo1/processor_eo1.py changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in EO1PrepareModelMessagesStep.complementary_data at line 91. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 13:00:08 +01:00' --until='2026-11-13 13:00:08 +01:00' --full-history --no-merges -- src/lerobot/policies/eo1/processor_eo1.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/lerobot/rollout/strategies/highlight.py src/lerobot/rollout/strategies/highlight.py:94— src/lerobot/rollout/strategies/highlight.py changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in HighlightStrategy.run at line 94. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 13:00:08 +01:00' --until='2026-11-13 13:00:08 +01:00' --full-history --no-merges -- src/lerobot/rollout/strategies/highlight.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:2526— src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in MolmoAct2TextModel.forward at line 2526. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 13:00:08 +01:00' --until='2026-11-13 13:00:08 +01:00' --full-history --no-merges -- src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Duplicated block (9 lines × 2) src/lerobot/data_processing/sarm_annotations/subtask_annotation.py:1147— src/lerobot/data_processing/sarm_annotations/subtask_annotation.py:1147-1155 | src/lerobot/data_processing/sarm_annotations/subtask_annotation.py:1157-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 (9 lines × 2) src/lerobot/datasets/factory.py:283— src/lerobot/datasets/factory.py:283-291 | src/lerobot/datasets/factory.py:299-307 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/datasets/factory.py:283` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) src/lerobot/policies/cosmos3/modeling_cosmos3.py:1902— src/lerobot/policies/cosmos3/modeling_cosmos3.py:1902-1910 | src/lerobot/policies/eo1/modeling_eo1.py:361-369 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/cosmos3/modeling_cosmos3.py:1902` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) src/lerobot/policies/fastwam/wan/modular.py:1385— src/lerobot/policies/fastwam/wan/modular.py:1385-1393 | src/lerobot/policies/fastwam/wan/modular.py:1397-1405 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/fastwam/wan/modular.py:1385` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) src/lerobot/policies/groot/configuration_groot.py:441— src/lerobot/policies/groot/configuration_groot.py:441-449 | src/lerobot/policies/groot/modeling_groot.py:275-283 — 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) src/lerobot/policies/groot/processor_groot.py:1611— src/lerobot/policies/groot/processor_groot.py:1611-1619 | src/lerobot/policies/groot/processor_groot.py:2298-2306 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:271— src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:271-279 | src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:344-352 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) src/lerobot/policies/multi_task_dit/modeling_multi_task_dit.py:717— src/lerobot/policies/multi_task_dit/modeling_multi_task_dit.py:717-725 | src/lerobot/policies/multi_task_dit/modeling_multi_task_dit.py:786-794 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) src/lerobot/policies/xvla/action_hub.py:150— src/lerobot/policies/xvla/action_hub.py:150-158 | src/lerobot/policies/xvla/action_hub.py:251-259 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/xvla/action_hub.py:150` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) src/lerobot/robots/so_follower/so_follower.py:135— src/lerobot/robots/so_follower/so_follower.py:135-143 | src/lerobot/teleoperators/so_leader/so_leader.py:102-110 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) src/lerobot/scripts/lerobot_eval.py:659— src/lerobot/scripts/lerobot_eval.py:659-668 | src/lerobot/scripts/lerobot_eval.py:691-699 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/scripts/lerobot_eval.py:659` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) src/lerobot/rewards/sarm/modeling_sarm.py:157— src/lerobot/rewards/sarm/modeling_sarm.py:157-165 | src/lerobot/rewards/sarm/modeling_sarm.py:308-316 — both copies are in the same file, so extract the block into 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) src/lerobot/robots/so_follower/robot_kinematic_processor.py:359— src/lerobot/robots/so_follower/robot_kinematic_processor.py:359-367 | src/lerobot/robots/so_follower/robot_kinematic_processor.py:639-647 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (9 lines × 2) src/lerobot/policies/molmoact2/molmoact2_hf_model/image_processing_molmoact2.py:260— src/lerobot/policies/molmoact2/molmoact2_hf_model/image_processing_molmoact2.py:260-268 | src/lerobot/policies/molmoact2/molmoact2_hf_model/video_processing_molmoact2.py:168-176 — before extracting anything, compare `src/lerobot/policies/molmoact2/molmoact2_hf_model/image_processing_molmoact2.py` and `src/lerobot/policies/molmoact2/molmoact2_hf_model/video_processing_molmoact2.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/molmoact2/molmoact2_hf_model/image_processing_molmoact2.py:260` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) src/lerobot/motors/damiao/damiao.py:817— src/lerobot/motors/damiao/damiao.py:817-825 | src/lerobot/motors/robstride/robstride.py:1033-1041 — `src/lerobot/motors/damiao/damiao.py` and `src/lerobot/motors/robstride/robstride.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 142 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) src/lerobot/robots/robot.py:164— src/lerobot/robots/robot.py:164-172 | src/lerobot/teleoperators/teleoperator.py:153-161 — 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) examples/omx/record_grab.py:355— examples/omx/record_grab.py:355-363 | examples/omx/record_grab.py:373-381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `examples/omx/record_grab.py:355` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) examples/isaac_teleop_to_so101/common.py:635— examples/isaac_teleop_to_so101/common.py:635-642 | src/lerobot/utils/keyboard_input.py:432-439 — 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) src/lerobot/datasets/dataset_tools.py:601— src/lerobot/datasets/dataset_tools.py:601-608 | src/lerobot/datasets/dataset_tools.py:616-623 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) src/lerobot/datasets/dataset_tools.py:921— src/lerobot/datasets/dataset_tools.py:921-928 | src/lerobot/datasets/dataset_tools.py:956-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.
Duplicated block (8 lines × 2) src/lerobot/policies/diffusion/modeling_diffusion.py:157— src/lerobot/policies/diffusion/modeling_diffusion.py:157-164 | src/lerobot/policies/multi_task_dit/modeling_multi_task_dit.py:192-199 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (8 lines × 2) src/lerobot/policies/lawam/vlas/flowmatching_expert.py:473— src/lerobot/policies/lawam/vlas/flowmatching_expert.py:473-480 | src/lerobot/policies/lawam/vlas/flowmatching_expert.py:614-621 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) src/lerobot/policies/molmoact2/modeling_molmoact2.py:1633— src/lerobot/policies/molmoact2/modeling_molmoact2.py:1633-1640 | src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:4039-4046 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) src/lerobot/policies/molmoact2/processor_molmoact2.py:647— src/lerobot/policies/molmoact2/processor_molmoact2.py:647-654 | src/lerobot/policies/molmoact2/processor_molmoact2.py:702-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) src/lerobot/policies/pi0/modeling_pi0.py:139— src/lerobot/policies/pi0/modeling_pi0.py:139-146 | src/lerobot/policies/pi05/modeling_pi05.py:315-324 — `src/lerobot/policies/pi0/modeling_pi0.py` and `src/lerobot/policies/pi05/modeling_pi05.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 547 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/pi05/modeling_pi05.py:315` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (8 lines × 2) src/lerobot/policies/pi0/modeling_pi0.py:272— src/lerobot/policies/pi0/modeling_pi0.py:272-279 | src/lerobot/policies/pi05/modeling_pi05.py:455-462 — `src/lerobot/policies/pi0/modeling_pi0.py` and `src/lerobot/policies/pi05/modeling_pi05.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 547 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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) src/lerobot/policies/xvla/modeling_xvla.py:219— src/lerobot/policies/xvla/modeling_xvla.py:219-227 | src/lerobot/policies/xvla/modeling_xvla.py:264-271 — both copies are in the same file, so extract the block into 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) src/lerobot/robots/openarm_follower/openarm_follower.py:94— src/lerobot/robots/openarm_follower/openarm_follower.py:94-101 | src/lerobot/teleoperators/openarm_leader/openarm_leader.py:69-76 — before extracting anything, compare `src/lerobot/robots/openarm_follower/openarm_follower.py` and `src/lerobot/teleoperators/openarm_leader/openarm_leader.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (8 lines × 2) src/lerobot/scripts/lerobot_train_tokenizer.py:169— src/lerobot/scripts/lerobot_train_tokenizer.py:169-176 | src/lerobot/scripts/lerobot_train_tokenizer.py:179-186 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) src/lerobot/teleoperators/homunculus/homunculus_arm.py:228— src/lerobot/teleoperators/homunculus/homunculus_arm.py:228-235 | src/lerobot/teleoperators/homunculus/homunculus_glove.py:259-266 — before extracting anything, compare `src/lerobot/teleoperators/homunculus/homunculus_arm.py` and `src/lerobot/teleoperators/homunculus/homunculus_glove.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `raw` to `Mapping[str, float]` in one and `dict[str, int]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8 lines × 2) src/lerobot/teleoperators/homunculus/homunculus_arm.py:82— src/lerobot/teleoperators/homunculus/homunculus_arm.py:82-89 | src/lerobot/teleoperators/homunculus/homunculus_glove.py:108-115 — before extracting anything, compare `src/lerobot/teleoperators/homunculus/homunculus_arm.py` and `src/lerobot/teleoperators/homunculus/homunculus_glove.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src/lerobot/motors/damiao/damiao.py:828— src/lerobot/motors/damiao/damiao.py:828-835 | src/lerobot/motors/robstride/robstride.py:1044-1051 — `src/lerobot/motors/damiao/damiao.py` and `src/lerobot/motors/robstride/robstride.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 142 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) src/lerobot/motors/damiao/damiao.py:838— src/lerobot/motors/damiao/damiao.py:838-845 | src/lerobot/motors/robstride/robstride.py:1054-1061 — `src/lerobot/motors/damiao/damiao.py` and `src/lerobot/motors/robstride/robstride.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 142 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) src/lerobot/policies/dm05/configuration_dm05.py:247— src/lerobot/policies/dm05/configuration_dm05.py:247-254 | src/lerobot/policies/lawam/configuration_lawam.py:244-251 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) src/lerobot/policies/act/modeling_act.py:549— src/lerobot/policies/act/modeling_act.py:549-554 | src/lerobot/policies/act/modeling_act.py:612-617 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) src/lerobot/policies/fastwam/wan/model.py:99— src/lerobot/policies/fastwam/wan/model.py:99-106 | src/lerobot/policies/fastwam/wan/video_dit.py:534-539 — 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) src/lerobot/policies/tdmpc/modeling_tdmpc.py:534— src/lerobot/policies/tdmpc/modeling_tdmpc.py:534-539 | src/lerobot/policies/tdmpc/modeling_tdmpc.py:545-550 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/lerobot/policies/tdmpc/modeling_tdmpc.py:551` calls `Linear`, `Sequential` and `src/lerobot/policies/tdmpc/modeling_tdmpc.py:540` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) src/lerobot/policies/vqbet/vqbet_utils.py:355— src/lerobot/policies/vqbet/vqbet_utils.py:355-360 | src/lerobot/policies/vqbet/vqbet_utils.py:585-590 — both copies are in the same file, so extract the block into 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) src/lerobot/policies/fastwam/wan/modular.py:1420— src/lerobot/policies/fastwam/wan/modular.py:1420-1425 | src/lerobot/policies/fastwam/wan/modular.py:1948-1953 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) src/lerobot/policies/lingbot_vla_v2/model_core/depth_teachers.py:363— src/lerobot/policies/lingbot_vla_v2/model_core/depth_teachers.py:363-368 | src/lerobot/policies/lingbot_vla_v2/model_core/video_teacher.py:161-166 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 2) src/lerobot/policies/praxis/praxis_core/bimanual.py:620— src/lerobot/policies/praxis/praxis_core/bimanual.py:620-625 | src/lerobot/policies/praxis/praxis_core/single_arm.py:656-661 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/lerobot/policies/praxis/praxis_core/single_arm.py:655` calls `asarray` and `src/lerobot/policies/praxis/praxis_core/bimanual.py:619` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) src/lerobot/policies/groot/action_head/cross_attention_dit.py:72— src/lerobot/policies/groot/action_head/cross_attention_dit.py:72-77 | src/lerobot/policies/lawam/vlas/cross_attention_dit.py:52-57 — before extracting anything, compare `src/lerobot/policies/groot/action_head/cross_attention_dit.py` and `src/lerobot/policies/lawam/vlas/cross_attention_dit.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 114 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/groot/action_head/cross_attention_dit.py:72` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:1232— src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:1232-1237 | src/lerobot/policies/molmoact2/processor_molmoact2.py:350-355 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `add_setup_tokens` to `bool = False` in one and `bool` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (6 lines × 2) src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:1241— src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:1241-1246 | src/lerobot/policies/molmoact2/processor_molmoact2.py:359-364 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `add_control_tokens` to `bool = False` in one and `bool` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (6 lines × 2) src/lerobot/scripts/lerobot_calibrate.py:87— src/lerobot/scripts/lerobot_calibrate.py:87-92 | src/lerobot/scripts/lerobot_setup_motors.py:70-75 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) src/lerobot/policies/groot/groot_n1_7.py:597— src/lerobot/policies/groot/groot_n1_7.py:597-602 | src/lerobot/policies/groot/groot_n1_7.py:696-701 — both copies are in the same file, so extract the block into 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) src/lerobot/policies/lawam/lam_core/core/utils/pos_embs.py:69— src/lerobot/policies/lawam/lam_core/core/utils/pos_embs.py:69-74 | src/lerobot/policies/lawam/lam_core/core/utils/pos_embs.py:111-116 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 2) src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:1130— src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:1130-1135 | src/lerobot/policies/molmoact2/processor_molmoact2.py:311-316 — 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) src/lerobot/policies/pi05/processor_pi05.py:78— src/lerobot/policies/pi05/processor_pi05.py:78-83 | src/lerobot/policies/pi0_fast/processor_pi0_fast.py:72-77 — `src/lerobot/policies/pi05/processor_pi05.py` and `src/lerobot/policies/pi0_fast/processor_pi0_fast.py` are one unit implemented 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 89 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 2) src/lerobot/policies/praxis/praxis_core/bimanual.py:628— src/lerobot/policies/praxis/praxis_core/bimanual.py:628-633 | src/lerobot/policies/praxis/praxis_core/single_arm.py:665-670 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/praxis/praxis_core/bimanual.py:628` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) src/lerobot/motors/damiao/damiao.py:629— src/lerobot/motors/damiao/damiao.py:629-633 | src/lerobot/motors/robstride/robstride.py:849-854 — `src/lerobot/motors/damiao/damiao.py` and `src/lerobot/motors/robstride/robstride.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 142 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (5 lines × 2) src/lerobot/policies/diffusion/configuration_diffusion.py:242— src/lerobot/policies/diffusion/configuration_diffusion.py:242-246 | src/lerobot/policies/multi_task_dit/configuration_multi_task_dit.py:238-242 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/diffusion/configuration_diffusion.py:242` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) src/lerobot/policies/lawam/vlas/flowmatching_expert.py:400— src/lerobot/policies/lawam/vlas/flowmatching_expert.py:400-406 | src/lerobot/policies/lawam/vlas/flowmatching_expert.py:659-663 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 2) src/lerobot/policies/molmoact2/molmoact2_hf_model/inference.py:740— src/lerobot/policies/molmoact2/molmoact2_hf_model/inference.py:740-744 | src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:2084-2088 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) src/lerobot/policies/praxis/praxis_core/kernels/layers_triton.py:73— src/lerobot/policies/praxis/praxis_core/kernels/layers_triton.py:73-77 | src/lerobot/policies/praxis/praxis_core/kernels/layers_triton.py:222-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 (5 lines × 2) src/lerobot/streaming/mp4.py:432— src/lerobot/streaming/mp4.py:432-436 | src/lerobot/streaming/mp4.py:466-470 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) examples/praxis/convert_checkpoint.py:75— examples/praxis/convert_checkpoint.py:75-79 | src/lerobot/policies/praxis/praxis_core/checkpoint.py:934-938 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (5 lines × 2) src/lerobot/motors/damiao/damiao.py:530— src/lerobot/motors/damiao/damiao.py:530-534 | src/lerobot/motors/robstride/robstride.py:741-745 — `src/lerobot/motors/damiao/damiao.py` and `src/lerobot/motors/robstride/robstride.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 142 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (5 lines × 2) src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:873— src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:873-877 | src/lerobot/policies/molmoact2/processor_molmoact2.py:300-304 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) src/lerobot/policies/pi0/modeling_pi0.py:282— src/lerobot/policies/pi0/modeling_pi0.py:282-286 | src/lerobot/policies/pi05/modeling_pi05.py:465-469 — `src/lerobot/policies/pi0/modeling_pi0.py` and `src/lerobot/policies/pi05/modeling_pi05.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 547 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (5 lines × 2) src/lerobot/policies/evo1/processor_evo1.py:97— src/lerobot/policies/evo1/processor_evo1.py:97-101 | src/lerobot/policies/wall_oss_05/processor_wall_oss_05.py:420-424 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (5 lines × 2) src/lerobot/policies/molmoact2/molmoact2_hf_model/image_processing_molmoact2.py:45— src/lerobot/policies/molmoact2/molmoact2_hf_model/image_processing_molmoact2.py:45-49 | src/lerobot/policies/molmoact2/molmoact2_hf_model/video_processing_molmoact2.py:69-73 — before extracting anything, compare `src/lerobot/policies/molmoact2/molmoact2_hf_model/image_processing_molmoact2.py` and `src/lerobot/policies/molmoact2/molmoact2_hf_model/video_processing_molmoact2.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) src/lerobot/policies/praxis/modeling_praxis.py:479— src/lerobot/policies/praxis/modeling_praxis.py:479-483 | src/lerobot/policies/praxis/praxis_core/train/objective.py:569-573 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/praxis/modeling_praxis.py:479` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) src/lerobot/policies/praxis/praxis_core/robot_io.py:189— src/lerobot/policies/praxis/praxis_core/robot_io.py:189-193 | src/lerobot/policies/praxis/praxis_core/robot_io.py:204-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 (5 lines × 2) src/lerobot/robots/so_follower/so_follower.py:165— src/lerobot/robots/so_follower/so_follower.py:165-169 | src/lerobot/teleoperators/so_leader/so_leader.py:128-132 — 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) examples/isaac_teleop_to_so101/record.py:183— examples/isaac_teleop_to_so101/record.py:183-194 | src/lerobot/scripts/lerobot_record.py:427-440 — 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) src/lerobot/cameras/opencv/camera_opencv.py:484— src/lerobot/cameras/opencv/camera_opencv.py:484-495 | src/lerobot/cameras/realsense/camera_realsense.py:709-720 — `src/lerobot/cameras/opencv/camera_opencv.py` and `src/lerobot/cameras/realsense/camera_realsense.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 68 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) src/lerobot/motors/damiao/damiao.py:775— src/lerobot/motors/damiao/damiao.py:775-786 | src/lerobot/motors/robstride/robstride.py:978-989 — `src/lerobot/motors/damiao/damiao.py` and `src/lerobot/motors/robstride/robstride.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 142 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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) src/lerobot/policies/lingbot_vla_v2/modeling_lingbot_vla_v2.py:1410— src/lerobot/policies/lingbot_vla_v2/modeling_lingbot_vla_v2.py:1410-1423 | src/lerobot/policies/lingbot_vla_v2/modeling_lingbot_vla_v2.py:1782-1793 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/lerobot/policies/lingbot_vla_v2/modeling_lingbot_vla_v2.py:1797` calls `getattr` and `src/lerobot/policies/lingbot_vla_v2/modeling_lingbot_vla_v2.py:1427` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 2) src/lerobot/policies/molmoact2/modeling_molmoact2.py:1821— src/lerobot/policies/molmoact2/modeling_molmoact2.py:1821-1833 | src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:3119-3130 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/molmoact2/modeling_molmoact2.py:1821` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) src/lerobot/policies/molmoact2/molmoact2_hf_model/image_processing_molmoact2.py:129— src/lerobot/policies/molmoact2/molmoact2_hf_model/image_processing_molmoact2.py:129-140 | src/lerobot/policies/molmoact2/molmoact2_hf_model/video_processing_molmoact2.py:129-140 — before extracting anything, compare `src/lerobot/policies/molmoact2/molmoact2_hf_model/image_processing_molmoact2.py` and `src/lerobot/policies/molmoact2/molmoact2_hf_model/video_processing_molmoact2.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (12 lines × 2) src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:462— src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:462-473 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:554-565 — both copies are in the same file, so extract the block into 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) src/lerobot/policies/wall_x/modeling_wall_x.py:1723— src/lerobot/policies/wall_x/modeling_wall_x.py:1723-1734 | src/lerobot/policies/wall_x/modeling_wall_x.py:1736-1747 — both copies are in the same file, so extract the block into 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) src/lerobot/policies/wall_x/utils.py:178— src/lerobot/policies/wall_x/utils.py:178-189 | src/lerobot/policies/wall_x/utils.py:198-209 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/wall_x/utils.py:178` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) src/lerobot/rollout/context.py:454— src/lerobot/rollout/context.py:454-465 | src/lerobot/scripts/lerobot_record.py:478-489 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/rollout/context.py:454` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) src/lerobot/rollout/strategies/dagger.py:834— src/lerobot/rollout/strategies/dagger.py:834-845 | src/lerobot/rollout/strategies/sentry.py:326-337 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 2) src/lerobot/teleoperators/homunculus/homunculus_arm.py:106— src/lerobot/teleoperators/homunculus/homunculus_arm.py:106-117 | src/lerobot/teleoperators/homunculus/homunculus_glove.py:132-143 — before extracting anything, compare `src/lerobot/teleoperators/homunculus/homunculus_arm.py` and `src/lerobot/teleoperators/homunculus/homunculus_glove.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src/lerobot/policies/lawam/lam_core/core/utils/lam_decoder.py:202— src/lerobot/policies/lawam/lam_core/core/utils/lam_decoder.py:202-213 | src/lerobot/policies/lawam/lam_core/core/utils/lam_encoder.py:129-140 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 2) src/lerobot/policies/evo1/processor_evo1.py:390— src/lerobot/policies/evo1/processor_evo1.py:390-401 | src/lerobot/policies/wall_oss_05/processor_wall_oss_05.py:586-600 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication· Edited copy of a member (6 corresponding lines) · ×12
Edited copy of a member (6 corresponding lines) src/lerobot/policies/lingbot_va/utils.py:122— src/lerobot/policies/lingbot_va/utils.py:122-132 | src/lerobot/policies/praxis/praxis_core/backbone.py:241-246 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/lerobot/robots/bi_rebot_b601_follower/bi_rebot_b601_follower.py:139— src/lerobot/robots/bi_rebot_b601_follower/bi_rebot_b601_follower.py:139-152 | src/lerobot/teleoperators/bi_openarm_mini/bi_openarm_mini.py:96-101 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/lerobot/streaming/manifest.py:412— src/lerobot/streaming/manifest.py:412-417 | src/lerobot/streaming/sidecar_utils.py:240-249 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/lerobot/policies/praxis/modeling_praxis.py:206— src/lerobot/policies/praxis/modeling_praxis.py:206-217 | src/lerobot/policies/praxis/modeling_praxis.py:338-343 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/lerobot/policies/lawam/lam_core/core/utils/pos_embs.py:77— src/lerobot/policies/lawam/lam_core/core/utils/pos_embs.py:77-82 | src/lerobot/policies/lawam/lam_core/core/utils/pos_embs.py:119-124 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/lerobot/policies/wall_oss_05/modeling_wall_oss_05.py:129— src/lerobot/policies/wall_oss_05/modeling_wall_oss_05.py:129-134 | src/lerobot/policies/wall_oss_05/modeling_wall_oss_05.py:239-244 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/lerobot/policies/molmoact2/processor_molmoact2.py:638— src/lerobot/policies/molmoact2/processor_molmoact2.py:638-643 | src/lerobot/policies/molmoact2/processor_molmoact2.py:693-698 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/lerobot/policies/cosmos3/modeling_cosmos3.py:297— src/lerobot/policies/cosmos3/modeling_cosmos3.py:297-304 | src/lerobot/policies/dm05/modeling_dm05.py:564-569 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/lerobot/policies/pi05/modeling_pi05.py:703— src/lerobot/policies/pi05/modeling_pi05.py:703-712 | src/lerobot/policies/pi0/modeling_pi0.py:467-472 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/lerobot/policies/vla_jepa/world_model.py:105— src/lerobot/policies/vla_jepa/world_model.py:105-110 | src/lerobot/policies/xvla/soft_transformer.py:80-86 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/lerobot/robots/lekiwi/lekiwi.py:387— src/lerobot/robots/lekiwi/lekiwi.py:387-392 | src/lerobot/robots/openarm_follower/openarm_follower.py:347-356 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) src/lerobot/policies/molmoact2/modeling_molmoact2.py:499— src/lerobot/policies/molmoact2/modeling_molmoact2.py:499-504 | src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:3022-3027 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Swallowed exception (caught, then discarded) src/lerobot/teleoperators/unitree_g1/exo_ik.py:46— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) src/lerobot/rewards/topreward/compute_rabc_weights.py:68— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) src/lerobot/rewards/sarm/compute_rabc_weights.py:77— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) src/lerobot/rewards/robometer/compute_rabc_weights.py:80— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) src/lerobot/policies/lawam/vlas/lawam.py:228— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) src/lerobot/policies/groot/modeling_groot.py:226— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) src/lerobot/policies/groot/processor_groot.py:967— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) src/lerobot/policies/groot/processor_groot.py:1168— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) src/lerobot/envs/utils.py:234— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) src/lerobot/datasets/pyav_utils.py:68— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) src/lerobot/cameras/realsense/camera_realsense.py:472— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) REDACTED:468— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Duplicated block (11 lines × 2) src/lerobot/motors/motors_bus.py:1011— src/lerobot/motors/motors_bus.py:1011-1021 | src/lerobot/motors/motors_bus.py:1040-1050 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `ids_values` to `dict[int, int]` in one and `dict[int, float]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11 lines × 2) src/lerobot/policies/diffusion/modeling_diffusion.py:569— src/lerobot/policies/diffusion/modeling_diffusion.py:569-579 | src/lerobot/policies/vqbet/modeling_vqbet.py:721-731 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/lerobot/policies/diffusion/modeling_diffusion.py:568` calls `resize` and `src/lerobot/policies/vqbet/modeling_vqbet.py:718` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) src/lerobot/policies/vqbet/vqbet_utils.py:764— src/lerobot/policies/vqbet/vqbet_utils.py:764-775 | src/lerobot/policies/vqbet/vqbet_utils.py:856-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 (11 lines × 2) src/lerobot/rollout/strategies/dagger.py:367— src/lerobot/rollout/strategies/dagger.py:367-377 | src/lerobot/rollout/strategies/dagger.py:559-569 — both copies are in the same file, so extract the block into 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) src/lerobot/scripts/convert_dataset_v21_to_v30.py:335— src/lerobot/scripts/convert_dataset_v21_to_v30.py:335-345 | src/lerobot/scripts/convert_dataset_v21_to_v30.py:371-381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) src/lerobot/scripts/lerobot_record.py:400— src/lerobot/scripts/lerobot_record.py:400-410 | src/lerobot/scripts/lerobot_teleoperate.py:263-273 — 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) src/lerobot/streaming/mp4.py:420— src/lerobot/streaming/mp4.py:420-430 | src/lerobot/streaming/mp4.py:454-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.
Duplicated block (11 lines × 2) src/lerobot/policies/wall_x/modeling_wall_x.py:838— src/lerobot/policies/wall_x/modeling_wall_x.py:838-848 | src/lerobot/policies/wall_x/modeling_wall_x.py:1238-1248 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/wall_x/modeling_wall_x.py:838` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) src/lerobot/teleoperators/bi_openarm_leader/bi_openarm_leader.py:97— src/lerobot/teleoperators/bi_openarm_leader/bi_openarm_leader.py:97-107 | src/lerobot/teleoperators/bi_so_leader/bi_so_leader.py:90-100 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (11 lines × 2) src/lerobot/policies/lawam/modeling_lawam.py:224— src/lerobot/policies/lawam/modeling_lawam.py:224-234 | src/lerobot/policies/vla_jepa/modeling_vla_jepa.py:410-421 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/lerobot/policies/lawam/modeling_lawam.py:238` calls `validate_features` and `src/lerobot/policies/vla_jepa/modeling_vla_jepa.py:425` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) src/lerobot/policies/praxis/praxis_core/backbone.py:408— src/lerobot/policies/praxis/praxis_core/backbone.py:408-418 | src/lerobot/policies/praxis/praxis_core/backbone.py:432-442 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) src/lerobot/policies/cosmos3/modeling_cosmos3.py:257— src/lerobot/policies/cosmos3/modeling_cosmos3.py:257-263 | src/lerobot/policies/cosmos3/modeling_cosmos3.py:280-286 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/lerobot/policies/cosmos3/modeling_cosmos3.py:256` calls `prepare_action` and `src/lerobot/policies/cosmos3/modeling_cosmos3.py:279` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) src/lerobot/policies/diffusion/modeling_diffusion.py:384— src/lerobot/policies/diffusion/modeling_diffusion.py:384-391 | src/lerobot/policies/multi_task_dit/modeling_multi_task_dit.py:701-707 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) src/lerobot/policies/lingbot_vla_v2/modeling_lingbot_vla_v2.py:1036— src/lerobot/policies/lingbot_vla_v2/modeling_lingbot_vla_v2.py:1036-1042 | src/lerobot/policies/lingbot_vla_v2/modeling_lingbot_vla_v2.py:1866-1872 — both copies are in the same file, so extract the block into 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) src/lerobot/policies/smolvla/modeling_smolvla.py:621— src/lerobot/policies/smolvla/modeling_smolvla.py:621-627 | src/lerobot/policies/smolvla/modeling_smolvla.py:650-656 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/smolvla/modeling_smolvla.py:621` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) src/lerobot/policies/smolvla/smolvlm_with_expert.py:321— src/lerobot/policies/smolvla/smolvlm_with_expert.py:321-327 | src/lerobot/policies/smolvla/smolvlm_with_expert.py:353-359 — both copies are in the same file, so extract the block into 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) src/lerobot/policies/wall_oss_05/processor_wall_oss_05.py:234— src/lerobot/policies/wall_oss_05/processor_wall_oss_05.py:234-240 | src/lerobot/policies/wall_x/processor_wall_x.py:184-190 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) src/lerobot/robots/unitree_g1/g1_kinematics.py:140— src/lerobot/robots/unitree_g1/g1_kinematics.py:140-146 | src/lerobot/robots/unitree_g1/g1_kinematics.py:149-155 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/robots/unitree_g1/g1_kinematics.py:140` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) src/lerobot/policies/diffusion/modeling_diffusion.py:550— src/lerobot/policies/diffusion/modeling_diffusion.py:550-556 | src/lerobot/policies/vqbet/modeling_vqbet.py:705-711 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note first that the copies are not typed on the same thing: the declarations holding them bind `config` to `DiffusionConfig` in one and `VQBeTConfig` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (7 lines × 2) src/lerobot/scripts/lerobot_dataset_viz.py:249— src/lerobot/scripts/lerobot_dataset_viz.py:249-255 | src/lerobot/utils/foxglove_visualization.py:574-580 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) src/lerobot/policies/praxis/praxis_core/kernels/layers_triton.py:93— src/lerobot/policies/praxis/praxis_core/kernels/layers_triton.py:93-99 | src/lerobot/policies/praxis/praxis_core/kernels/layers_triton.py:142-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 (7 lines × 2) src/lerobot/policies/multi_task_dit/modeling_multi_task_dit.py:429— src/lerobot/policies/multi_task_dit/modeling_multi_task_dit.py:429-435 | src/lerobot/policies/wall_x/modeling_wall_x.py:116-122 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×9
Edited copy of a member (12 corresponding lines) src/lerobot/policies/xvla/soft_transformer.py:184— src/lerobot/policies/flux3/f3/transformer.py:157-168 | src/lerobot/policies/xvla/soft_transformer.py:184-209 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:271— src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:271-283 | src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:344-355 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) REDACTED:1618— REDACTED:1618-1629 | src/lerobot/policies/pi0/modeling_pi0.py:1101-1124 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src/lerobot/policies/evo1/processor_evo1.py:80— src/lerobot/policies/evo1/processor_evo1.py:80-92 | src/lerobot/policies/wall_oss_05/processor_wall_oss_05.py:404-415 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src/lerobot/teleoperators/homunculus/homunculus_arm.py:226— src/lerobot/teleoperators/homunculus/homunculus_arm.py:226-237 | src/lerobot/teleoperators/homunculus/homunculus_glove.py:257-270 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src/lerobot/env_server/client.py:370— src/lerobot/env_server/client.py:370-381 | src/lerobot/sim/local_vector_env.py:363-376 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src/lerobot/policies/diffusion/modeling_diffusion.py:328— src/lerobot/policies/diffusion/modeling_diffusion.py:328-352 | src/lerobot/policies/multi_task_dit/modeling_multi_task_dit.py:136-147 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src/lerobot/motors/damiao/damiao.py:604— src/lerobot/motors/damiao/damiao.py:604-615 | src/lerobot/motors/robstride/robstride.py:807-819 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) src/lerobot/datasets/lance_utils.py:357— src/lerobot/datasets/lance_utils.py:357-370 | src/lerobot/policies/fastwam/wan/modular.py:889-900 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (7 corresponding lines) · ×9
Edited copy of a member (7 corresponding lines) src/lerobot/policies/evo1/flow_matching.py:36— src/lerobot/policies/evo1/flow_matching.py:36-43 | src/lerobot/policies/lawam/lam_core/core/utils/pos_embs.py:14-20 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src/lerobot/policies/groot/groot_n1_7.py:219— src/lerobot/policies/groot/groot_n1_7.py:219-225 | src/lerobot/policies/vla_jepa/action_head.py:53-59 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src/lerobot/policies/groot/groot_n1_7.py:243— src/lerobot/policies/groot/groot_n1_7.py:243-250 | src/lerobot/policies/vla_jepa/action_head.py:71-77 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:201— src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:201-208 | src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:2066-2072 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src/lerobot/policies/praxis/praxis_core/robot_io.py:189— src/lerobot/policies/praxis/praxis_core/robot_io.py:189-195 | src/lerobot/policies/praxis/praxis_core/robot_io.py:204-211 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src/lerobot/policies/praxis/praxis_core/vae.py:363— src/lerobot/policies/praxis/praxis_core/vae.py:363-369 | src/lerobot/policies/praxis/praxis_core/vae.py:403-409 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src/lerobot/policies/vla_jepa/processor_vla_jepa.py:142— src/lerobot/policies/vla_jepa/processor_vla_jepa.py:142-148 | src/lerobot/policies/vla_jepa/processor_vla_jepa.py:177-183 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src/lerobot/cameras/opencv/camera_opencv.py:131— src/lerobot/cameras/opencv/camera_opencv.py:131-137 | src/lerobot/cameras/realsense/camera_realsense.py:167-174 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) src/lerobot/cameras/opencv/camera_opencv.py:498— src/lerobot/cameras/opencv/camera_opencv.py:498-505 | src/lerobot/cameras/realsense/camera_realsense.py:723-729 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×9
Edited copy of a member (9 corresponding lines) src/lerobot/policies/praxis/praxis_core/vae.py:293— src/lerobot/policies/praxis/praxis_core/vae.py:293-301 | src/lerobot/policies/praxis/praxis_core/vae.py:312-320 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src/lerobot/optim/schedulers.py:120— src/lerobot/optim/schedulers.py:120-128 | src/lerobot/policies/lawam/configuration_lawam.py:44-61 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src/lerobot/robots/robot.py:60— src/lerobot/robots/robot.py:60-68 | src/lerobot/teleoperators/teleoperator.py:49-59 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src/lerobot/policies/praxis/praxis_core/robot_io.py:383— src/lerobot/policies/praxis/praxis_core/robot_io.py:383-391 | src/lerobot/policies/praxis/praxis_core/robot_io.py:394-402 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src/lerobot/policies/groot/processor_groot.py:1991— src/lerobot/policies/groot/processor_groot.py:1991-1999 | src/lerobot/policies/groot/processor_groot.py:2521-2538 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src/lerobot/policies/cosmos3/modeling_cosmos3.py:2367— src/lerobot/policies/cosmos3/modeling_cosmos3.py:2367-2375 | src/lerobot/policies/cosmos3/modeling_cosmos3.py:2768-2777 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src/lerobot/teleoperators/koch_leader/koch_leader.py:84— src/lerobot/teleoperators/koch_leader/koch_leader.py:84-94 | src/lerobot/robots/koch_follower/koch_follower.py:114-122 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src/lerobot/datasets/lerobot_dataset.py:640— src/lerobot/datasets/lerobot_dataset.py:640-648 | src/lerobot/datasets/dataset_metadata.py:787-795 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) src/lerobot/robots/robot.py:175— src/lerobot/robots/robot.py:175-184 | src/lerobot/teleoperators/teleoperator.py:164-172 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (10 lines × 2) examples/isaac_teleop_to_so101/record.py:203— examples/isaac_teleop_to_so101/record.py:203-212 | src/lerobot/scripts/lerobot_record.py:453-462 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `examples/isaac_teleop_to_so101/record.py:203` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/lerobot/scripts/lerobot_record.py:452` calls `hasattr` and `examples/isaac_teleop_to_so101/record.py:202` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) src/lerobot/policies/cosmos3/modeling_cosmos3.py:1893— src/lerobot/policies/cosmos3/modeling_cosmos3.py:1893-1902 | src/lerobot/policies/cosmos3/modeling_cosmos3.py:1904-1913 — both copies are in the same file, so extract the block into 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) src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:3591— src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:3591-3600 | src/lerobot/policies/pi_gemma.py:247-256 — 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) src/lerobot/policies/pi0/configuration_pi0.py:110— src/lerobot/policies/pi0/configuration_pi0.py:110-119 | src/lerobot/policies/pi0_fast/configuration_pi0_fast.py:106-115 — before extracting anything, compare `src/lerobot/policies/pi0/configuration_pi0.py` and `src/lerobot/policies/pi0_fast/configuration_pi0_fast.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/lerobot/policies/pi0/configuration_pi0.py:122` calls `ValueError` and `src/lerobot/policies/pi0_fast/configuration_pi0_fast.py:117` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) src/lerobot/policies/pi0/configuration_pi0.py:116— src/lerobot/policies/pi0/configuration_pi0.py:116-125 | src/lerobot/policies/pi05/configuration_pi05.py:137-146 — `src/lerobot/policies/pi0/configuration_pi0.py` and `src/lerobot/policies/pi05/configuration_pi05.py` are one unit implemented 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 47 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/pi0/configuration_pi0.py:116` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) src/lerobot/policies/praxis/praxis_core/bimanual.py:596— src/lerobot/policies/praxis/praxis_core/bimanual.py:596-605 | src/lerobot/policies/praxis/praxis_core/single_arm.py:629-638 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/lerobot/policies/praxis/praxis_core/bimanual.py:591` calls `_clip`, `canvas_clip` and `src/lerobot/policies/praxis/praxis_core/single_arm.py:626` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) src/lerobot/policies/praxis/praxis_core/kernels/layers_triton.py:116— src/lerobot/policies/praxis/praxis_core/kernels/layers_triton.py:116-125 | src/lerobot/policies/praxis/praxis_core/kernels/layers_triton.py:167-176 — both copies are in the same file, so extract the block into 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) src/lerobot/robots/so_follower/robot_kinematic_processor.py:306— src/lerobot/robots/so_follower/robot_kinematic_processor.py:306-315 | src/lerobot/robots/so_follower/robot_kinematic_processor.py:582-591 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) src/lerobot/robots/reachy2/robot_reachy2.py:159— src/lerobot/robots/reachy2/robot_reachy2.py:159-168 | src/lerobot/teleoperators/reachy2_teleoperator/reachy2_teleoperator.py: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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
TooManyMethods: MolmoAct2Policy src/lerobot/policies/molmoact2/modeling_molmoact2.py:607— TooManyMethods — 56 methods. The bar is 30 methods; this is 26 over it, 1.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SerialMotorsBus src/lerobot/motors/motors_bus.py:156— TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: InferenceEngine src/lerobot/inference/base.py:130— TooManyMethods — 45 methods. The bar is 30 methods; this is 15 over it, 1.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: RobstrideMotorsBus src/lerobot/motors/robstride/robstride.py:68— TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: DamiaoMotorsBus src/lerobot/motors/damiao/damiao.py:75— 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: LingBotVAPolicy src/lerobot/policies/lingbot_va/modeling_lingbot_va.py:62— 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: MolmoAct2ForConditionalGeneration src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:3662— TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: RealSenseCamera src/lerobot/cameras/realsense/camera_realsense.py:48— TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×8
Members sharing a duplicated core (4 members, 50+ identical tokens) src/lerobot/policies/eo1/modeling_eo1.py:208— src/lerobot/policies/eo1/modeling_eo1.py:208-214 | src/lerobot/policies/evo1/modeling_evo1.py:531-541 | src/lerobot/policies/fastwam/modeling_fastwam.py:344-348 | src/lerobot/policies/pi0/modeling_pi0.py:1078-1091 — 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) REDACTED:122— REDACTED:122-184 | REDACTED:1009-1068 | src/lerobot/policies/pi0/modeling_pi0.py:613-659 | src/lerobot/policies/pi05/modeling_pi05.py:883-931 — 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) REDACTED:193— REDACTED:193-225 | src/lerobot/policies/pi0/modeling_pi0.py:733-763 | src/lerobot/policies/pi05/modeling_pi05.py:1030-1060 | src/lerobot/policies/smolvla/modeling_smolvla.py:834-863 — 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) src/lerobot/policies/groot/configuration_groot.py:158— src/lerobot/policies/groot/configuration_groot.py:158-185 | src/lerobot/policies/groot/processor_groot.py:314-326 | src/lerobot/policies/groot/processor_groot.py:333-345 | src/lerobot/policies/groot/processor_groot.py:352-365 — 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) src/lerobot/robots/bi_openarm_follower/bi_openarm_follower.py:111— src/lerobot/robots/bi_openarm_follower/bi_openarm_follower.py:111-116 | src/lerobot/robots/bi_rebot_b601_follower/bi_rebot_b601_follower.py:113-118 | src/lerobot/robots/bi_so_follower/bi_so_follower.py:104-109 | src/lerobot/robots/bi_yam_follower/bi_yam_follower.py:81-86 — 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) src/lerobot/robots/hope_jr/hope_jr_arm.py:157— src/lerobot/robots/hope_jr/hope_jr_arm.py:157-167 | src/lerobot/robots/koch_follower/koch_follower.py:178-202 | src/lerobot/robots/omx_follower/omx_follower.py:192-216 | src/lerobot/robots/so_follower/so_follower.py:189-213 — 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) src/lerobot/robots/koch_follower/koch_follower.py:154— src/lerobot/robots/koch_follower/koch_follower.py:154-174 | src/lerobot/robots/omx_follower/omx_follower.py:168-188 | src/lerobot/teleoperators/koch_leader/koch_leader.py:123-128 | src/lerobot/teleoperators/omx_leader/omx_leader.py:144-149 — 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) examples/training/train_policy.py:30— examples/training/train_policy.py:30-115 | examples/training/train_with_streaming.py:36-117 | examples/tutorial/act/act_training_example.py:22-99 | examples/tutorial/diffusion/diffusion_training_example.py:22-100 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×8
Edited copy of a member (16 corresponding lines) src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:1265— src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:1265-1281 | src/lerobot/policies/molmoact2/processor_molmoact2.py:331-346 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src/lerobot/robots/bi_openarm_follower/bi_openarm_follower.py:153— src/lerobot/robots/bi_openarm_follower/bi_openarm_follower.py:153-168 | src/lerobot/robots/bi_so_follower/bi_so_follower.py:140-155 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src/lerobot/policies/molmoact2/modeling_molmoact2.py:439— src/lerobot/policies/molmoact2/modeling_molmoact2.py:439-456 | src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:2834-2849 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:1295— src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:1295-1319 | src/lerobot/policies/molmoact2/processor_molmoact2.py:388-403 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src/lerobot/policies/praxis/praxis_core/bimanual.py:141— src/lerobot/policies/praxis/praxis_core/bimanual.py:141-156 | src/lerobot/policies/praxis/praxis_core/single_arm.py:112-129 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src/lerobot/common/control_utils.py:209— src/lerobot/common/control_utils.py:209-231 | src/lerobot/common/control_utils.py:237-252 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src/lerobot/policies/molmoact2/molmoact2_hf_model/configuration_molmoact2.py:75— src/lerobot/policies/molmoact2/molmoact2_hf_model/configuration_molmoact2.py:75-91 | src/lerobot/policies/molmoact2/molmoact2_hf_model/configuration_molmoact2.py:147-162 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) src/lerobot/rollout/controller.py:304— src/lerobot/rollout/controller.py:304-323 | src/lerobot/rollout/controller.py:331-346 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×8
Edited copy of a member (10 corresponding lines) src/lerobot/policies/praxis/praxis_core/backbone.py:556— src/lerobot/policies/praxis/praxis_core/backbone.py:556-570 | src/lerobot/policies/praxis/praxis_core/backbone.py:703-712 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src/lerobot/policies/fastwam/wan/model.py:96— src/lerobot/policies/fastwam/wan/model.py:96-108 | src/lerobot/policies/fastwam/wan/video_dit.py:532-541 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src/lerobot/policies/lingbot_vla_v2/processor_lingbot_vla_v2.py:90— src/lerobot/policies/lingbot_vla_v2/processor_lingbot_vla_v2.py:90-99 | src/lerobot/policies/lingbot_vla_v2/processor_lingbot_vla_v2.py:176-186 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src/lerobot/policies/molmoact2/modeling_molmoact2.py:1592— src/lerobot/policies/molmoact2/modeling_molmoact2.py:1592-1602 | src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:3806-3815 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src/lerobot/policies/wall_oss_05/processor_wall_oss_05.py:495— src/lerobot/policies/g05/processor_g05.py:519-528 | src/lerobot/policies/wall_oss_05/processor_wall_oss_05.py:495-504 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src/lerobot/policies/fastwam/modeling_fastwam.py:449— src/lerobot/policies/fastwam/modeling_fastwam.py:449-460 | src/lerobot/policies/molmoact2/modeling_molmoact2.py:533-542 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:299— src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:299-308 | src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:377-386 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) src/lerobot/policies/pi0/modeling_pi0.py:290— src/lerobot/policies/pi0/modeling_pi0.py:290-302 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:173-182 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (4 corresponding lines) · ×8
Edited copy of a member (4 corresponding lines) src/lerobot/policies/evo1/processor_evo1.py:153— src/lerobot/policies/evo1/processor_evo1.py:153-156 | src/lerobot/policies/wall_oss_05/processor_wall_oss_05.py:459-462 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) src/lerobot/policies/evo1/processor_evo1.py:210— src/lerobot/policies/evo1/processor_evo1.py:210-213 | src/lerobot/policies/wall_oss_05/processor_wall_oss_05.py:481-484 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) src/lerobot/policies/groot/groot_n1_7.py:181— src/lerobot/policies/groot/groot_n1_7.py:181-184 | src/lerobot/policies/lawam/vlas/flowmatching_expert.py:71-74 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) src/lerobot/policies/cosmos3/modeling_cosmos3.py:2387— src/lerobot/policies/cosmos3/modeling_cosmos3.py:2387-2391 | src/lerobot/policies/lingbot_vla_v2/model_core/qwen3vl_in_vla.py:404-407 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) src/lerobot/teleoperators/homunculus/homunculus_arm.py:313— src/lerobot/teleoperators/homunculus/homunculus_arm.py:313-316 | src/lerobot/teleoperators/homunculus/homunculus_glove.py:344-347 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) src/lerobot/rewards/robometer/modeling_robometer.py:111— src/lerobot/rewards/robometer/modeling_robometer.py:111-114 | src/lerobot/rewards/topreward/modeling_topreward.py:88-94 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) src/lerobot/policies/fastwam/wan/model.py:66— src/lerobot/policies/fastwam/wan/model.py:66-69 | src/lerobot/policies/praxis/praxis_core/backbone.py:87-90 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) src/lerobot/policies/praxis/praxis_core/bimanual.py:175— src/lerobot/policies/praxis/praxis_core/bimanual.py:175-178 | src/lerobot/policies/praxis/praxis_core/single_arm.py:144-147 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (18 lines × 2) src/lerobot/policies/gaussian_actor/modeling_gaussian_actor.py:587— src/lerobot/policies/gaussian_actor/modeling_gaussian_actor.py:587-604 | src/lerobot/rewards/classifier/modeling_classifier.py:49-66 — 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 (18 lines × 2) src/lerobot/policies/lingbot_va/modeling_lingbot_va.py:728— src/lerobot/policies/lingbot_va/modeling_lingbot_va.py:728-745 | src/lerobot/policies/lingbot_va/modeling_lingbot_va.py:746-764 — both copies are in the same file, so extract the block into 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) src/lerobot/policies/molmoact2/modeling_molmoact2.py:478— src/lerobot/policies/molmoact2/modeling_molmoact2.py:478-495 | src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:2995-3012 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `action_dim_is_pad` to `Tensor | None` in one and `torch.Tensor | None` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (18 lines × 2) src/lerobot/policies/molmoact2/modeling_molmoact2.py:551— src/lerobot/policies/molmoact2/modeling_molmoact2.py:551-568 | src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:1338-1355 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 2) src/lerobot/rl/actor.py:510— src/lerobot/rl/actor.py:510-527 | src/lerobot/rl/actor.py:626-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/lerobot/rl/actor.py:506` calls `info` and `src/lerobot/rl/actor.py:620` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (18 lines × 2) src/lerobot/robots/openarm_follower/openarm_follower.py:55— src/lerobot/robots/openarm_follower/openarm_follower.py:55-72 | src/lerobot/teleoperators/openarm_leader/openarm_leader.py:48-65 — before extracting anything, compare `src/lerobot/robots/openarm_follower/openarm_follower.py` and `src/lerobot/teleoperators/openarm_leader/openarm_leader.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `config` to `OpenArmFollowerConfig` in one and `OpenArmLeaderConfig` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (18 lines × 2) src/lerobot/teleoperators/homunculus/homunculus_arm.py:206— src/lerobot/teleoperators/homunculus/homunculus_arm.py:206-223 | src/lerobot/teleoperators/homunculus/homunculus_glove.py:237-254 — before extracting anything, compare `src/lerobot/teleoperators/homunculus/homunculus_arm.py` and `src/lerobot/teleoperators/homunculus/homunculus_glove.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (18 lines × 2) examples/phone_to_so100/record.py:164— examples/phone_to_so100/record.py:164-181 | examples/so100_to_so100_EE/record.py:159-176 — `examples/phone_to_so100/record.py` and `examples/so100_to_so100_EE/record.py` are one unit implemented 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 149 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `examples/phone_to_so100/record.py:164` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) examples/dataset/slurm_compute_rabc.py:437— examples/dataset/slurm_compute_rabc.py:437-453 | src/lerobot/rewards/sarm/compute_rabc_weights.py:746-763 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `examples/dataset/slurm_compute_rabc.py:437` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) src/lerobot/policies/lingbot_vla_v2/modeling_lingbot_vla_v2.py:1547— src/lerobot/policies/lingbot_vla_v2/modeling_lingbot_vla_v2.py:1547-1563 | src/lerobot/policies/lingbot_vla_v2/modeling_lingbot_vla_v2.py:1568-1584 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (17 lines × 2) src/lerobot/policies/pi05/configuration_pi05.py:156— src/lerobot/policies/pi05/configuration_pi05.py:156-172 | src/lerobot/policies/pi0_fast/configuration_pi0_fast.py:121-137 — `src/lerobot/policies/pi05/configuration_pi05.py` and `src/lerobot/policies/pi0_fast/configuration_pi0_fast.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 54 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/pi05/configuration_pi05.py:156` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) src/lerobot/policies/wall_x/modeling_wall_x.py:821— src/lerobot/policies/wall_x/modeling_wall_x.py:821-837 | src/lerobot/policies/wall_x/modeling_wall_x.py:1220-1236 — both copies are in the same file, so extract the block into 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) src/lerobot/teleoperators/homunculus/homunculus_arm.py:265— src/lerobot/teleoperators/homunculus/homunculus_arm.py:265-281 | src/lerobot/teleoperators/homunculus/homunculus_glove.py:302-318 — before extracting anything, compare `src/lerobot/teleoperators/homunculus/homunculus_arm.py` and `src/lerobot/teleoperators/homunculus/homunculus_glove.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 2) src/lerobot/transforms/deprecated.py:79— src/lerobot/transforms/deprecated.py:79-95 | src/lerobot/transforms/transforms.py:1621-1639 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (17 lines × 2) src/lerobot/policies/molmoact2/molmoact2_hf_model/image_processing_molmoact2.py:236— src/lerobot/policies/molmoact2/molmoact2_hf_model/image_processing_molmoact2.py:236-252 | src/lerobot/policies/molmoact2/molmoact2_hf_model/video_processing_molmoact2.py:144-160 — before extracting anything, compare `src/lerobot/policies/molmoact2/molmoact2_hf_model/image_processing_molmoact2.py` and `src/lerobot/policies/molmoact2/molmoact2_hf_model/video_processing_molmoact2.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 2) examples/rtc/eval_dataset.py:462— examples/rtc/eval_dataset.py:462-478 | examples/rtc/eval_dataset.py:495-511 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `examples/rtc/eval_dataset.py:462` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) src/lerobot/policies/lingbot_vla_v2/model_core/modeling_lingbot_vla_v2_base.py:27— src/lerobot/policies/lingbot_vla_v2/model_core/modeling_lingbot_vla_v2_base.py:27-40 | src/lerobot/policies/lingbot_vla_v2/model_core/modeling_lingbot_vla_v2_base.py:58-71 — both copies are in the same file, so extract the block into 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) src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:2323— src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:2323-2336 | src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:2375-2388 — both copies are in the same file, so extract the block into 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) src/lerobot/policies/praxis/praxis_core/bimanual.py:321— src/lerobot/policies/praxis/praxis_core/bimanual.py:321-334 | src/lerobot/policies/praxis/praxis_core/single_arm.py:294-307 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/praxis/praxis_core/bimanual.py:321` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) src/lerobot/robots/robot.py:187— src/lerobot/robots/robot.py:187-200 | src/lerobot/teleoperators/teleoperator.py:175-188 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/lerobot/robots/robot.py:182` calls `mkdir` and `src/lerobot/teleoperators/teleoperator.py:170` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) src/lerobot/scripts/lerobot_edit_dataset.py:440— src/lerobot/scripts/lerobot_edit_dataset.py:440-453 | src/lerobot/scripts/lerobot_edit_dataset.py:556-569 — both copies are in the same file, so extract the block into 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) src/lerobot/policies/praxis/praxis_core/bimanual.py:564— src/lerobot/policies/praxis/praxis_core/bimanual.py:564-577 | src/lerobot/policies/praxis/praxis_core/single_arm.py:601-614 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/lerobot/policies/praxis/praxis_core/bimanual.py:563` calls `str` and `src/lerobot/policies/praxis/praxis_core/single_arm.py:600` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:1266— src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:1266-1279 | src/lerobot/policies/molmoact2/processor_molmoact2.py:332-345 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (14 lines × 2) src/lerobot/teleoperators/koch_leader/koch_leader.py:40— src/lerobot/teleoperators/koch_leader/koch_leader.py:40-53 | src/lerobot/teleoperators/omx_leader/omx_leader.py:39-52 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note first that the copies are not typed on the same thing: the declarations holding them bind `config` to `KochLeaderConfig` in one and `OmxLeaderConfig` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication· Edited copy of a member (21 corresponding lines) · ×7
Edited copy of a member (21 corresponding lines) src/lerobot/motors/damiao/damiao.py:437— src/lerobot/motors/damiao/damiao.py:437-462 | src/lerobot/motors/robstride/robstride.py:689-709 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) src/lerobot/policies/xvla/action_hub.py:134— src/lerobot/policies/xvla/action_hub.py:134-158 | src/lerobot/policies/xvla/action_hub.py:239-259 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) src/lerobot/robots/omx_follower/omx_follower.py:116— src/lerobot/robots/omx_follower/omx_follower.py:116-136 | src/lerobot/teleoperators/omx_leader/omx_leader.py:83-107 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) src/lerobot/policies/diffusion/modeling_diffusion.py:260— src/lerobot/policies/diffusion/modeling_diffusion.py:260-287 | src/lerobot/policies/multi_task_dit/modeling_multi_task_dit.py:730-750 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) src/lerobot/teleoperators/bi_rebot_102_leader/bi_rebot_102_leader.py:43— src/lerobot/teleoperators/bi_rebot_102_leader/bi_rebot_102_leader.py:43-67 | src/lerobot/teleoperators/bi_so_leader/bi_so_leader.py:40-60 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) src/lerobot/transforms/deprecated.py:79— src/lerobot/transforms/deprecated.py:79-99 | src/lerobot/transforms/transforms.py:1621-1643 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) src/lerobot/teleoperators/homunculus/homunculus_arm.py:242— src/lerobot/teleoperators/homunculus/homunculus_arm.py:242-262 | src/lerobot/teleoperators/homunculus/homunculus_glove.py:275-299 — 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.
Duplicated block (15 lines × 2) src/lerobot/policies/lawam/vlas/flowmatching_expert.py:701— src/lerobot/policies/lawam/vlas/flowmatching_expert.py:701-715 | src/lerobot/policies/lawam/vlas/flowmatching_expert.py:731-745 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/lawam/vlas/flowmatching_expert.py:701` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) src/lerobot/policies/pi0/modeling_pi0.py:420— src/lerobot/policies/pi0/modeling_pi0.py:420-434 | src/lerobot/policies/pi05/modeling_pi05.py:647-661 — `src/lerobot/policies/pi0/modeling_pi0.py` and `src/lerobot/policies/pi05/modeling_pi05.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 547 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/pi0/modeling_pi0.py:420` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `config` to `PI0Config` in one and `PI05Config` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (15 lines × 2) src/lerobot/policies/pi05/processor_pi05.py:57— src/lerobot/policies/pi05/processor_pi05.py:57-71 | src/lerobot/policies/pi0_fast/processor_pi0_fast.py:54-68 — `src/lerobot/policies/pi05/processor_pi05.py` and `src/lerobot/policies/pi0_fast/processor_pi0_fast.py` are one unit implemented 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 89 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (15 lines × 2) src/lerobot/processor/normalize_processor.py:390— src/lerobot/processor/normalize_processor.py:390-404 | src/lerobot/processor/normalize_processor.py:407-421 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) src/lerobot/rewards/robometer/processor_robometer.py:89— src/lerobot/rewards/robometer/processor_robometer.py:89-103 | src/lerobot/rewards/topreward/processor_topreward.py:91-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) src/lerobot/rollout/strategies/dagger.py:351— src/lerobot/rollout/strategies/dagger.py:351-365 | src/lerobot/rollout/strategies/dagger.py:540-554 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/lerobot/rollout/strategies/dagger.py:557` calls `RuntimeError` and `src/lerobot/rollout/strategies/dagger.py:367` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15 lines × 2) src/lerobot/rollout/strategies/episodic.py:267— src/lerobot/rollout/strategies/episodic.py:267-281 | src/lerobot/rollout/strategies/sentry.py: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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
X17 · Uncapped recursion over a caller-supplied document· Recursive walk over a caller-supplied document has no depth cap · ×7
Recursive walk over a caller-supplied document has no depth cap src/lerobot/utils/utils.py:186— `unwrap_scalar` is public and takes `value: Any` from its caller, and it calls itself at line 186 (`unwrap_scalar`) with a piece of `value` — and nowhere in `unwrap_scalar` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `unwrap_scalar` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap src/lerobot/utils/utils.py:251— `flatten_dict` is public and takes `d: dict[str, Any]` from its caller, and it calls itself at line 251 (`flatten_dict`) with a piece of `d` — and nowhere in `flatten_dict` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `flatten_dict` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap src/lerobot/transforms/transforms.py:552— `slice_params` is public, takes a document from its caller (line 533) and hands it to `_slice`, which calls itself at line 552 (`_slice`) with a piece of `value` (and at line 554) — and nowhere in `_slice` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_slice` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap src/lerobot/policies/groot/utils.py:83— `as_float_list` is public and takes `values: Any` from its caller, and it calls itself at line 83 (`as_float_list`) with a piece of `values` — and nowhere in `as_float_list` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `as_float_list` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap src/lerobot/policies/dm05/core/tokenization.py:107— `format_speed_value` is public and takes `speed: Any` from its caller, and it calls itself at line 107 (`format_speed_value`) with a piece of `speed` — and nowhere in `format_speed_value` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `format_speed_value` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap src/lerobot/envs/factory.py:247— `check_served` is public, takes a document from its caller (line 241) and hands it to `plain`, which calls itself at line 247 (`plain`) with a piece of `value` (and at line 249) — and nowhere in `plain` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `plain` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap src/lerobot/datasets/recipe.py:148— `from_dict` is public and takes `data: dict[str, Any]` from its caller, and it calls itself at line 148 (`self.from_dict`) with a piece of `data` — and nowhere in `from_dict` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `from_dict` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
D4 · Code Duplication· Edited copy of a member (3 corresponding lines) · ×6
Edited copy of a member (3 corresponding lines) src/lerobot/policies/groot/action_head/cross_attention_dit.py:52— src/lerobot/policies/groot/action_head/cross_attention_dit.py:52-55 | src/lerobot/policies/lawam/vlas/cross_attention_dit.py:32-34 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) src/lerobot/robots/hope_jr/hope_jr_hand.py:184— src/lerobot/robots/hope_jr/hope_jr_hand.py:184-186 | src/lerobot/teleoperators/so_leader/so_leader.py:137-139 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) src/lerobot/utils/foxglove_visualization.py:83— src/lerobot/utils/foxglove_visualization.py:83-85 | src/lerobot/utils/rerun_visualization.py:42-44 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) src/lerobot/policies/xvla/soft_transformer.py:275— REDACTED:423-425 | src/lerobot/policies/xvla/soft_transformer.py:275-286 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) src/lerobot/policies/groot/groot_n1_7.py:187— src/lerobot/policies/groot/groot_n1_7.py:187-189 | src/lerobot/policies/lawam/vlas/flowmatching_expert.py:77-79 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) src/lerobot/policies/praxis/praxis_core/bimanual.py:160— src/lerobot/policies/praxis/praxis_core/bimanual.py:160-162 | src/lerobot/policies/praxis/praxis_core/single_arm.py:133-135 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
HackComment tests/training/test_visual_validation.py:170— # HACK: disable the internal CLI validation step for tests, we did it with custom_validate — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment tests/policies/test_policies.py:660— # HACK — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment src/lerobot/robots/hope_jr/hope_jr_arm.py:57— # HACK — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment src/lerobot/configs/eval.py:53— # HACK: We parse again the cli args here to get the pretrained path if there was one. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment src/lerobot/configs/rewards.py:151— # HACK: Parse the original config to get the config subclass, so that we can — 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.
Change coupling: lerobot_calibrate.py ↔ lerobot_replay.py src/lerobot/scripts/lerobot_calibrate.py:1— `src/lerobot/scripts/lerobot_calibrate.py` and `src/lerobot/scripts/lerobot_replay.py` change together 70% of the time (7 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 7 shared commits counted here, the most recent 3 are `9e5ee985` feat(robot): yam robot arm with motorbridge (#4855); `3409ef0d` refactor(cameras): cameras API extension (#2808); `44831848` feat(robots): add bi manual openarm follower and leader (#2835) — run `git show` on any of them.
Change coupling: lerobot_replay.py ↔ lerobot_teleoperate.py src/lerobot/scripts/lerobot_replay.py:1— `src/lerobot/scripts/lerobot_replay.py` and `src/lerobot/scripts/lerobot_teleoperate.py` change together 62% of the time (13 of the 21 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency 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 `9e5ee985` feat(robot): yam robot arm with motorbridge (#4855); `44831848` feat(robots): add bi manual openarm follower and leader (#2835); `bf337e71` feat(robots): add OpenArm robot & teleoperator (#2795) — run `git show` on any of them.
Change coupling: so_follower.py ↔ so_leader.py src/lerobot/robots/so_follower/so_follower.py:1— `src/lerobot/robots/so_follower/so_follower.py` and `src/lerobot/teleoperators/so_leader/so_leader.py` 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 `326484d7` refactor(motors): share the hand calibration and the motor setup of s…; `9a6bb610` feat(calibration): show the homing position as an ASCII diagram - #46…; `7d615acf` fix(robots): retry SO follower/leader bus reads on transient Feetech … — run `git show` on any of them.
Change coupling: lekiwi.py ↔ so_follower.py src/lerobot/robots/lekiwi/lekiwi.py:1— `src/lerobot/robots/lekiwi/lekiwi.py` and `src/lerobot/robots/so_follower/so_follower.py` 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 `326484d7` refactor(motors): share the hand calibration and the motor setup of s…; `70a0bf63` chore(mypy): cover robot (#4754); `bc382613` feat(robots): use read_latest() camera (#2987) — run `git show` on any of them.
Change coupling: lerobot_calibrate.py ↔ lerobot_find_joint_limits.py src/lerobot/scripts/lerobot_calibrate.py:1— `src/lerobot/scripts/lerobot_calibrate.py` and `src/lerobot/scripts/lerobot_find_joint_limits.py` change together 50% of the time (5 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 5 shared commits counted here, the most recent 3 are `d576c59a` refactor(robots): homogenize bi-manual setups implementations (#3772); `c085531b` fix: add missing openarm_mini import to CLI scripts (#3028); `44831848` feat(robots): add bi manual openarm follower and leader (#2835) — run `git show` on any of them.
D4 · Code Duplication· Edited copy of a member (27 corresponding lines) · ×5
Edited copy of a member (27 corresponding lines) src/lerobot/policies/smolvla/modeling_smolvla.py:357— src/lerobot/policies/smolvla/modeling_smolvla.py:357-383 | src/lerobot/policies/xvla/modeling_xvla.py:296-332 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) src/lerobot/motors/motors_bus.py:1011— src/lerobot/motors/motors_bus.py:1011-1037 | src/lerobot/motors/motors_bus.py:1040-1067 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) src/lerobot/rewards/robometer/processor_robometer.py:164— src/lerobot/rewards/robometer/processor_robometer.py:164-199 | src/lerobot/rewards/topreward/processor_topreward.py:146-172 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) src/lerobot/policies/pi05/configuration_pi05.py:156— src/lerobot/policies/pi05/configuration_pi05.py:156-182 | src/lerobot/policies/pi0_fast/configuration_pi0_fast.py:121-147 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) src/lerobot/cameras/opencv/camera_opencv.py:461— src/lerobot/cameras/opencv/camera_opencv.py:461-495 | src/lerobot/cameras/zmq/camera_zmq.py:246-272 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×5
Edited copy of a member (15 corresponding lines) src/lerobot/policies/pretrained.py:413— src/lerobot/policies/pretrained.py:413-434 | src/lerobot/policies/vla_jepa/modeling_vla_jepa.py:424-438 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src/lerobot/policies/act/modeling_act.py:545— src/lerobot/policies/act/modeling_act.py:545-559 | src/lerobot/policies/act/modeling_act.py:607-624 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src/lerobot/policies/gaussian_actor/modeling_gaussian_actor.py:390— src/lerobot/policies/gaussian_actor/modeling_gaussian_actor.py:390-408 | src/lerobot/rl/algorithms/sac/sac_algorithm.py:608-622 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src/lerobot/policies/xvla/processor_xvla.py:128— src/lerobot/policies/xvla/processor_xvla.py:128-142 | src/lerobot/processor/env_processor.py:88-105 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) src/lerobot/cameras/opencv/camera_opencv.py:623— src/lerobot/cameras/opencv/camera_opencv.py:623-637 | src/lerobot/cameras/realsense/camera_realsense.py:900-916 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (8 corresponding lines) · ×5
Edited copy of a member (8 corresponding lines) src/lerobot/policies/lingbot_vla_v2/model_core/qwen2_action_expert.py:45— src/lerobot/policies/lingbot_vla_v2/model_core/qwen2_action_expert.py:45-52 | src/lerobot/policies/wall_x/qwen_model/qwen2_5_vl_moe.py:90-98 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src/lerobot/policies/groot/processor_groot.py:1981— src/lerobot/policies/groot/processor_groot.py:1981-1988 | src/lerobot/policies/groot/processor_groot.py:2505-2518 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src/lerobot/envs/factory.py:42— src/lerobot/envs/factory.py:42-49 | src/lerobot/rl/algorithms/factory.py:24-43 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src/lerobot/policies/pretrained.py:125— src/lerobot/policies/pretrained.py:125-133 | src/lerobot/rewards/pretrained.py:46-53 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) src/lerobot/policies/groot/configuration_groot.py:504— src/lerobot/policies/groot/configuration_groot.py:504-512 | src/lerobot/policies/molmoact2/configuration_molmoact2.py:491-498 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (51 corresponding lines) · ×4
Edited copy of a member (51 corresponding lines) src/lerobot/robots/so_follower/robot_kinematic_processor.py:304— src/lerobot/robots/so_follower/robot_kinematic_processor.py:304-354 | src/lerobot/robots/so_follower/robot_kinematic_processor.py:574-634 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (51 corresponding lines) src/lerobot/motors/damiao/damiao.py:764— src/lerobot/motors/damiao/damiao.py:764-814 | src/lerobot/motors/robstride/robstride.py:965-1030 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (51 corresponding lines) src/lerobot/policies/fastwam/wan/modular.py:1729— src/lerobot/policies/fastwam/wan/modular.py:1729-1779 | src/lerobot/policies/fastwam/wan/modular.py:1791-1841 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (51 corresponding lines) examples/port_datasets/slurm_aggregate_shards.py:91— examples/port_datasets/slurm_aggregate_shards.py:91-145 | examples/port_datasets/slurm_port_shards.py:100-158 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (22 corresponding lines) · ×4
Edited copy of a member (22 corresponding lines) src/lerobot/policies/praxis/praxis_core/bimanual.py:434— src/lerobot/policies/praxis/praxis_core/bimanual.py:434-460 | src/lerobot/policies/praxis/praxis_core/single_arm.py:457-478 — 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) src/lerobot/policies/lawam/lam_core/core/utils/pos_embs.py:36— src/lerobot/policies/lawam/lam_core/core/utils/pos_embs.py:36-66 | src/lerobot/policies/lawam/lam_core/core/utils/pos_embs.py:87-108 — 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) src/lerobot/datasets/dataset_metadata.py:313— src/lerobot/datasets/dataset_metadata.py:313-334 | src/lerobot/datasets/dataset_metadata.py:337-364 — 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) src/lerobot/policies/dm05/core/modeling.py:552— src/lerobot/policies/dm05/core/modeling.py:552-574 | src/lerobot/policies/dm05/core/modeling.py:611-632 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×4
Edited copy of a member (13 corresponding lines) src/lerobot/policies/molmoact2/processor_molmoact2.py:1089— src/lerobot/policies/molmoact2/processor_molmoact2.py:1089-1103 | src/lerobot/policies/molmoact2/processor_molmoact2.py:1131-1143 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:318— src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:318-330 | src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:396-408 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) src/lerobot/policies/pi0_fast/configuration_pi0_fast.py:106— src/lerobot/policies/pi0_fast/configuration_pi0_fast.py:106-118 | src/lerobot/policies/xvla/configuration_xvla.py:156-168 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) REDACTED:36— REDACTED:36-48 | src/lerobot/policies/molmoact2/utils_molmoact2.py:37-55 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×4
Edited copy of a member (11 corresponding lines) REDACTED:1454— REDACTED:1454-1467 | src/lerobot/policies/wall_oss_05/modeling_wall_oss_05.py:555-565 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src/lerobot/policies/lingbot_vla_v2/model_core/modeling_lingbot_vla_v2_base.py:43— src/lerobot/policies/lingbot_vla_v2/model_core/modeling_lingbot_vla_v2_base.py:43-53 | src/lerobot/policies/lingbot_vla_v2/model_core/modeling_lingbot_vla_v2_base.py:74-84 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src/lerobot/motors/damiao/damiao.py:309— src/lerobot/motors/damiao/damiao.py:309-319 | src/lerobot/motors/robstride/robstride.py:396-406 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) src/lerobot/motors/robstride/robstride.py:382— src/lerobot/motors/robstride/robstride.py:382-393 | src/lerobot/motors/damiao/damiao.py:296-306 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×4
Edited copy of a member (18 corresponding lines) src/lerobot/processor/normalize_processor.py:473— src/lerobot/processor/normalize_processor.py:473-493 | src/lerobot/processor/normalize_processor.py:537-554 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) src/lerobot/cameras/opencv/camera_opencv.py:526— src/lerobot/cameras/opencv/camera_opencv.py:526-543 | src/lerobot/cameras/realsense/camera_realsense.py:751-769 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) src/lerobot/policies/diffusion/modeling_diffusion.py:559— src/lerobot/policies/diffusion/modeling_diffusion.py:559-579 | src/lerobot/policies/vqbet/modeling_vqbet.py:714-731 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) src/lerobot/processor/delta_action_processor.py:137— src/lerobot/processor/delta_action_processor.py:137-155 | src/lerobot/teleoperators/phone/phone_processor.py:84-101 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (5 corresponding lines) · ×4
Edited copy of a member (5 corresponding lines) src/lerobot/processor/policy_robot_bridge.py:38— src/lerobot/processor/policy_robot_bridge.py:38-42 | src/lerobot/processor/policy_robot_bridge.py:62-66 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) src/lerobot/policies/molmoact2/molmoact2_hf_model/inference.py:740— src/lerobot/policies/molmoact2/molmoact2_hf_model/inference.py:740-744 | src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:2080-2088 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) src/lerobot/policies/cosmos3/modeling_cosmos3.py:2437— src/lerobot/policies/cosmos3/modeling_cosmos3.py:2437-2441 | src/lerobot/policies/lingbot_vla_v2/model_core/qwen2_action_expert.py:185-189 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) src/lerobot/policies/fastwam/modeling_fastwam.py:489— src/lerobot/policies/fastwam/modeling_fastwam.py:489-493 | src/lerobot/policies/g05/processor_g05.py:709-714 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (19 lines × 2) src/lerobot/policies/diffusion/modeling_diffusion.py:472— src/lerobot/policies/diffusion/modeling_diffusion.py:472-490 | src/lerobot/policies/vqbet/modeling_vqbet.py:234-252 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (19 lines × 2) src/lerobot/policies/pi0/modeling_pi0.py:529— src/lerobot/policies/pi0/modeling_pi0.py:529-547 | src/lerobot/policies/pi05/modeling_pi05.py:804-822 — `src/lerobot/policies/pi0/modeling_pi0.py` and `src/lerobot/policies/pi05/modeling_pi05.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 547 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (19 lines × 2) src/lerobot/rewards/sarm/compute_rabc_weights.py:314— src/lerobot/rewards/sarm/compute_rabc_weights.py:314-332 | src/lerobot/rewards/sarm/compute_rabc_weights.py:549-567 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) src/lerobot/robots/koch_follower/koch_follower.py:178— src/lerobot/robots/koch_follower/koch_follower.py:178-196 | src/lerobot/robots/omx_follower/omx_follower.py:192-210 — `src/lerobot/robots/koch_follower/koch_follower.py` and `src/lerobot/robots/omx_follower/omx_follower.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 118 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (16 lines × 2) src/lerobot/processor/factory.py:218— src/lerobot/policies/flux3/processor_flux3.py:79-94 | src/lerobot/processor/factory.py:218-233 — 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) src/lerobot/policies/groot/action_head/cross_attention_dit.py:190— src/lerobot/policies/groot/action_head/cross_attention_dit.py:190-205 | src/lerobot/policies/lawam/vlas/cross_attention_dit.py:197-212 — before extracting anything, compare `src/lerobot/policies/groot/action_head/cross_attention_dit.py` and `src/lerobot/policies/lawam/vlas/cross_attention_dit.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 114 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/groot/action_head/cross_attention_dit.py:190` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (16 lines × 2) src/lerobot/policies/pi0/modeling_pi0.py:748— src/lerobot/policies/pi0/modeling_pi0.py:748-763 | src/lerobot/policies/pi05/modeling_pi05.py:1045-1060 — `src/lerobot/policies/pi0/modeling_pi0.py` and `src/lerobot/policies/pi05/modeling_pi05.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 547 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (16 lines × 2) src/lerobot/policies/wall_oss_05/processor_wall_oss_05.py:144— src/lerobot/policies/wall_oss_05/processor_wall_oss_05.py:144-159 | src/lerobot/policies/wall_x/processor_wall_x.py:194-209 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (13 lines × 2) src/lerobot/policies/fastwam/configuration_fastwam.py:289— src/lerobot/policies/fastwam/configuration_fastwam.py:289-301 | src/lerobot/policies/vla_jepa/configuration_vla_jepa.py:149-161 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (13 lines × 2) src/lerobot/policies/groot/action_head/cross_attention_dit.py:287— src/lerobot/policies/groot/action_head/cross_attention_dit.py:287-299 | src/lerobot/policies/lawam/vlas/cross_attention_dit.py:298-311 — before extracting anything, compare `src/lerobot/policies/groot/action_head/cross_attention_dit.py` and `src/lerobot/policies/lawam/vlas/cross_attention_dit.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 114 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/groot/action_head/cross_attention_dit.py:287` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) src/lerobot/rewards/robometer/compute_rabc_weights.py:202— src/lerobot/rewards/robometer/compute_rabc_weights.py:202-214 | src/lerobot/rewards/topreward/compute_rabc_weights.py:247-259 — `src/lerobot/rewards/robometer/compute_rabc_weights.py` and `src/lerobot/rewards/topreward/compute_rabc_weights.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 160 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (13 lines × 2) src/lerobot/rollout/strategies/dagger.py:826— src/lerobot/rollout/strategies/dagger.py:826-838 | src/lerobot/rollout/strategies/highlight.py:272-284 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/lerobot/rollout/strategies/dagger.py:839` calls `clear` and `src/lerobot/rollout/strategies/highlight.py:285` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 3) src/lerobot/cameras/opencv/camera_opencv.py:509— src/lerobot/cameras/opencv/camera_opencv.py:509-520 | src/lerobot/cameras/realsense/camera_realsense.py:733-744 | src/lerobot/cameras/zmq/camera_zmq.py:291-302 — `src/lerobot/cameras/opencv/camera_opencv.py` and `src/lerobot/cameras/realsense/camera_realsense.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 68 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (12 lines × 3) src/lerobot/cameras/opencv/camera_opencv.py:609— src/lerobot/cameras/opencv/camera_opencv.py:609-620 | src/lerobot/cameras/realsense/camera_realsense.py:827-838 | src/lerobot/cameras/zmq/camera_zmq.py:362-373 — `src/lerobot/cameras/opencv/camera_opencv.py` and `src/lerobot/cameras/realsense/camera_realsense.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 68 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note first that the copies are not typed on the same thing: the declarations holding them bind `max_age_ms` to `int = 500` in one and `int` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (12 lines × 3) REDACTED:149— REDACTED:149-160 | src/lerobot/policies/pi0/modeling_pi0.py:621-632 | src/lerobot/policies/pi05/modeling_pi05.py:893-904 — `src/lerobot/policies/pi0/modeling_pi0.py` and `src/lerobot/policies/pi05/modeling_pi05.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 547 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (12 lines × 3) src/lerobot/rewards/robometer/compute_rabc_weights.py:307— src/lerobot/rewards/robometer/compute_rabc_weights.py:307-318 | src/lerobot/rewards/sarm/compute_rabc_weights.py:858-869 | src/lerobot/rewards/topreward/compute_rabc_weights.py:338-349 — `src/lerobot/rewards/robometer/compute_rabc_weights.py` and `src/lerobot/rewards/topreward/compute_rabc_weights.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 160 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/rewards/robometer/compute_rabc_weights.py:307` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–8 lines × 2) src/lerobot/policies/groot/action_head/cross_attention_dit.py:311— src/lerobot/policies/groot/action_head/cross_attention_dit.py:311-318 | src/lerobot/policies/groot/action_head/cross_attention_dit.py:378-384 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/groot/action_head/cross_attention_dit.py:311` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–8 lines × 2) src/lerobot/policies/molmoact2/modeling_molmoact2.py:1199— src/lerobot/policies/molmoact2/modeling_molmoact2.py:1199-1206 | src/lerobot/policies/molmoact2/modeling_molmoact2.py:1212-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 (7–8 lines × 2) src/lerobot/rewards/sarm/modeling_sarm.py:788— src/lerobot/rewards/sarm/modeling_sarm.py:788-795 | src/lerobot/rewards/sarm/modeling_sarm.py:801-807 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–8 lines × 2) src/lerobot/scripts/lerobot_setup_can.py:173— src/lerobot/scripts/lerobot_setup_can.py:173-179 | src/lerobot/scripts/lerobot_setup_can.py:224-231 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 3) src/lerobot/rl/actor.py:510— src/lerobot/rl/actor.py:510-515 | src/lerobot/rl/actor.py:626-631 | src/lerobot/rl/learner.py:505-510 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/lerobot/rl/actor.py:506` calls `info` and `src/lerobot/rl/actor.py:620` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 3) src/lerobot/robots/bi_openarm_follower/bi_openarm_follower.py:153— src/lerobot/robots/bi_openarm_follower/bi_openarm_follower.py:153-159 | src/lerobot/robots/bi_rebot_b601_follower/bi_rebot_b601_follower.py:139-144 | src/lerobot/robots/bi_so_follower/bi_so_follower.py:140-146 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (6 lines × 3) src/lerobot/policies/pi0/modeling_pi0.py:153— src/lerobot/policies/pi0/modeling_pi0.py:153-158 | src/lerobot/policies/pi05/modeling_pi05.py:331-336 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:73-78 — `src/lerobot/policies/pi0/modeling_pi0.py` and `src/lerobot/policies/pi05/modeling_pi05.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 547 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note what the matched lines are: every one of them assigns one field to another, so the block is a hand-written mapper between two data shapes rather than behaviour with a helper inside it. Extracting one shared function only works if both sites map the SAME pair of types in the same direction — check that first, because inverse or differently-typed mappers have no single function they can both call. Where they do not, the moves that exist are a generated or reflective mapper, a common embedded/base type the fields live on once, or accepting the run and covering it with a test that fails when a field is added to one side only.
Duplicated block (6 lines × 3) src/lerobot/policies/pi0/modeling_pi0.py:478— src/lerobot/policies/pi0/modeling_pi0.py:478-483 | src/lerobot/policies/pi05/modeling_pi05.py:718-723 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:276-281 — `src/lerobot/policies/pi0/modeling_pi0.py` and `src/lerobot/policies/pi05/modeling_pi05.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 547 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/lerobot/policies/pi05/modeling_pi05.py:725` calls `_prepare_attention_masks_4d`, `prepare_attention_masks_4d` and `src/lerobot/policies/pi0/modeling_pi0.py:485` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Swallowed exception (empty catch) src/lerobot/teleoperators/teleoperator.py:87— An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `__del__()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: narrow the catch to the exception this release can actually raise, and record it through whatever this codebase already uses to report problems — or, if it truly cannot matter, say why in a comment on the catch.
Swallowed exception (empty catch) src/lerobot/robots/robot.py:96— An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `__del__()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: narrow the catch to the exception this release can actually raise, and record it through whatever this codebase already uses to report problems — or, if it truly cannot matter, say why in a comment on the catch.
Swallowed exception (empty catch) REDACTED:1351— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) src/lerobot/cameras/camera.py:75— An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `__del__()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: narrow the catch to the exception this release can actually raise, and record it through whatever this codebase already uses to report problems — or, if it truly cannot matter, say why in a comment on the catch.
Repeated repair: src/lerobot/datasets/compute_stats.py src/lerobot/datasets/compute_stats.py:504— src/lerobot/datasets/compute_stats.py changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is compute_stats.compute_episode_stats at line 504), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(datasets): accumulate running stats in float64 to avoid zero/biased std (#5107)”; “fix: stabilize mypy checks and resolve repository type errors (#5045)”; “fix(datasets): honour quantile_list in get_feature_stats (#4796)”; “fix(datasets): weight sampled image stats by episode length (#4949)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 13:00:08 +01:00' --until='2026-11-13 13:00:08 +01:00' --full-history --no-merges -- src/lerobot/datasets/compute_stats.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: src/lerobot/cameras/opencv/camera_opencv.py src/lerobot/cameras/opencv/camera_opencv.py:201— src/lerobot/cameras/opencv/camera_opencv.py changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is OpenCVCamera._configure_capture_settings at line 201), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: stabilize mypy checks and resolve repository type errors (#5045)”; “Small docstring fix in camera_opencv.py (#4901)”; “fix(cameras): add the missing space in the OpenCV open-failure message (#4910)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 13:00:08 +01:00' --until='2026-11-13 13:00:08 +01:00' --full-history --no-merges -- src/lerobot/cameras/opencv/camera_opencv.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: src/lerobot/utils/random_utils.py src/lerobot/utils/random_utils.py:103— src/lerobot/utils/random_utils.py 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 random_utils.deserialize_torch_rng_state at line 103), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(utils): restore seeded context RNG state on exceptions (#4707)”; “fix(utils): preserve Python Gaussian RNG cache in checkpoints (#4705)”; “fix(utils): retain NumPy Gaussian RNG cache precision (#4706)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 13:00:08 +01:00' --until='2026-11-13 13:00:08 +01:00' --full-history --no-merges -- src/lerobot/utils/random_utils.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
D4 · Code Duplication· Edited copy of a member (35 corresponding lines) · ×3
Edited copy of a member (35 corresponding lines) src/lerobot/policies/cosmos3/modeling_cosmos3.py:1875— src/lerobot/policies/cosmos3/modeling_cosmos3.py:1875-1914 | src/lerobot/policies/eo1/modeling_eo1.py:339-373 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (35 corresponding lines) src/lerobot/robots/rebot_b601_follower/rebot_b601_follower.py:185— src/lerobot/robots/rebot_b601_follower/rebot_b601_follower.py:185-222 | src/lerobot/teleoperators/rebot_102_leader/rebot_102_leader.py:102-136 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (35 corresponding lines) src/lerobot/policies/eo1/processor_eo1.py:384— src/lerobot/policies/eo1/processor_eo1.py:384-418 | src/lerobot/policies/wall_x/processor_wall_x.py:71-131 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (32 corresponding lines) · ×3
Edited copy of a member (32 corresponding lines) src/lerobot/policies/pi05/processor_pi05.py:57— src/lerobot/policies/pi05/processor_pi05.py:57-94 | src/lerobot/policies/pi0_fast/processor_pi0_fast.py:54-85 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) src/lerobot/rollout/strategies/dagger.py:312— src/lerobot/rollout/strategies/dagger.py:312-344 | src/lerobot/rollout/strategies/highlight.py:213-244 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) src/lerobot/cameras/opencv/camera_opencv.py:589— src/lerobot/cameras/opencv/camera_opencv.py:589-620 | src/lerobot/cameras/zmq/camera_zmq.py:342-373 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (20 corresponding lines) · ×3
Edited copy of a member (20 corresponding lines) src/lerobot/motors/robstride/robstride.py:517— src/lerobot/motors/robstride/robstride.py:517-538 | src/lerobot/motors/robstride/robstride.py:571-590 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) src/lerobot/policies/pi0/modeling_pi0.py:780— src/lerobot/policies/pi0/modeling_pi0.py:780-799 | src/lerobot/policies/pi05/modeling_pi05.py:1080-1099 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) src/lerobot/policies/xvla/action_hub.py:309— src/lerobot/policies/xvla/action_hub.py:309-328 | src/lerobot/policies/xvla/action_hub.py:392-413 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (2 corresponding lines) · ×3
Edited copy of a member (2 corresponding lines) src/lerobot/policies/groot/action_head/cross_attention_dit.py:84— src/lerobot/policies/groot/action_head/cross_attention_dit.py:84-87 | src/lerobot/policies/vla_jepa/action_head.py:100-101 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (2 corresponding lines) src/lerobot/policies/wall_oss_05/modeling_wall_oss_05.py:96— REDACTED:402-403 | src/lerobot/policies/wall_oss_05/modeling_wall_oss_05.py:96-97 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (2 corresponding lines) src/lerobot/policies/cosmos3/processor_cosmos3.py:138— src/lerobot/policies/cosmos3/processor_cosmos3.py:138-139 | src/lerobot/policies/praxis/praxis_core/robot_io.py:127-128 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (28 lines × 2) src/lerobot/cameras/opencv/camera_opencv.py:589— src/lerobot/cameras/opencv/camera_opencv.py:589-616 | src/lerobot/cameras/zmq/camera_zmq.py:342-369 — `src/lerobot/cameras/opencv/camera_opencv.py` and `src/lerobot/cameras/zmq/camera_zmq.py` are one unit implemented 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 87 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/cameras/opencv/camera_opencv.py:589` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `max_age_ms` to `int = 500` in one and `int = 1000` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (28 lines × 2) src/lerobot/policies/common/vla_utils.py:61— src/lerobot/policies/common/vla_utils.py:61-88 | src/lerobot/policies/lingbot_vla_v2/model_core/utils.py:54-81 — 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 (28 lines × 2) src/lerobot/policies/diffusion/modeling_diffusion.py:585— src/lerobot/policies/diffusion/modeling_diffusion.py:585-612 | src/lerobot/policies/vqbet/modeling_vqbet.py:737-764 — 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 (21 lines × 2) src/lerobot/policies/lawam/vlas/cross_attention_dit.py:319— src/lerobot/policies/lawam/vlas/cross_attention_dit.py:319-339 | src/lerobot/policies/lawam/vlas/cross_attention_dit.py:409-429 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (21 lines × 2) src/lerobot/policies/pi0/modeling_pi0.py:393— src/lerobot/policies/pi0/modeling_pi0.py:393-413 | src/lerobot/policies/pi05/modeling_pi05.py:613-633 — `src/lerobot/policies/pi0/modeling_pi0.py` and `src/lerobot/policies/pi05/modeling_pi05.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 547 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/lerobot/policies/pi05/modeling_pi05.py:612` calls `_no_grad_if` and `src/lerobot/policies/pi0/modeling_pi0.py:392` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (21 lines × 2) src/lerobot/robots/so_follower/robot_kinematic_processor.py:318— src/lerobot/robots/so_follower/robot_kinematic_processor.py:318-338 | src/lerobot/robots/so_follower/robot_kinematic_processor.py:594-614 — both copies are in the same file, so extract the block into 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 × 3) src/lerobot/policies/eo1/configuration_eo1.py:215— src/lerobot/policies/eo1/configuration_eo1.py:215-232 | src/lerobot/policies/groot/configuration_groot.py:461-478 | src/lerobot/policies/wall_x/configuration_wall_x.py:163-180 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (18 lines × 3) src/lerobot/policies/xvla/processor_xvla.py:194— src/lerobot/policies/xvla/processor_xvla.py:194-211 | src/lerobot/policies/xvla/processor_xvla.py:250-267 | src/lerobot/policies/xvla/processor_xvla.py:323-340 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 3) examples/phone_to_so100/record.py:70— examples/phone_to_so100/record.py:70-96 | examples/phone_to_so100/replay.py:49-66 | examples/so100_to_so100_EE/replay.py:50-67 — `examples/phone_to_so100/replay.py` and `examples/so100_to_so100_EE/replay.py` are one unit implemented 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 109 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (17–18 lines × 2) src/lerobot/motors/damiao/damiao.py:251— src/lerobot/motors/damiao/damiao.py:251-268 | src/lerobot/motors/robstride/robstride.py:330-346 — `src/lerobot/motors/damiao/damiao.py` and `src/lerobot/motors/robstride/robstride.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 142 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (17–18 lines × 2) src/lerobot/policies/fastwam/wan/modular.py:308— src/lerobot/policies/fastwam/wan/modular.py:308-325 | src/lerobot/policies/fastwam/wan/video_dit.py:421-437 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (17–18 lines × 2) src/lerobot/rollout/strategies/dagger.py:312— src/lerobot/rollout/strategies/dagger.py:312-329 | src/lerobot/rollout/strategies/highlight.py:213-229 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 3) src/lerobot/policies/eo1/processor_eo1.py:424— src/lerobot/policies/eo1/processor_eo1.py:424-434 | src/lerobot/policies/wall_oss_05/processor_wall_oss_05.py:147-157 | src/lerobot/policies/wall_x/processor_wall_x.py:197-207 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (11 lines × 3) src/lerobot/policies/pi0/modeling_pi0.py:1054— src/lerobot/policies/pi0/modeling_pi0.py:1054-1064 | src/lerobot/policies/pi05/modeling_pi05.py:1428-1438 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:1023-1033 — `src/lerobot/policies/pi0/modeling_pi0.py` and `src/lerobot/policies/pi05/modeling_pi05.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 547 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/lerobot/policies/pi0/modeling_pi0.py:1066` calls `prepare_state`, `pad_vector` and `src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:1035` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 3) src/lerobot/robots/so_follower/robot_kinematic_processor.py:318— src/lerobot/robots/so_follower/robot_kinematic_processor.py:318-328 | src/lerobot/robots/so_follower/robot_kinematic_processor.py:403-413 | src/lerobot/robots/so_follower/robot_kinematic_processor.py:594-604 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
FixmeComment src/lerobot/scripts/lerobot_eval.py:633— # FIXME: episode_data is either None or it doesn't exist — 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 src/lerobot/policies/wall_x/modeling_wall_x.py:1574— # FIXME: Handle case when input_embeds is used instead — 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.
PaliGemmaWithExpertModel.forward (cognitive 20) src/lerobot/policies/pi0/modeling_pi0.py:311— PaliGemmaWithExpertModel.forward has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 2 (4 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PaliGemmaWithExpertModel.forward (cognitive 20) src/lerobot/policies/pi05/modeling_pi05.py:511— PaliGemmaWithExpertModel.forward has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 2 (4 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
import_utils.is_package_available (cognitive 19) src/lerobot/utils/import_utils.py:38— import_utils.is_package_available has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 2 (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. This shape REPEATS in the file: one other method here (import_utils.is_package_available) 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.
import_utils.is_package_available (cognitive 19) src/lerobot/utils/import_utils.py:43— import_utils.is_package_available has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 2 (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. This shape REPEATS in the file: one other method here (import_utils.is_package_available) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D4 · Code Duplication· Edited copy of a member (24 corresponding lines) · ×2
Edited copy of a member (24 corresponding lines) src/lerobot/policies/diffusion/modeling_diffusion.py:446— src/lerobot/policies/diffusion/modeling_diffusion.py:446-469 | src/lerobot/policies/vqbet/modeling_vqbet.py:208-231 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) src/lerobot/robots/openarm_follower/openarm_follower.py:132— src/lerobot/robots/openarm_follower/openarm_follower.py:132-157 | src/lerobot/teleoperators/openarm_leader/openarm_leader.py:90-113 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (5 members, 50+ identical tokens) src/lerobot/policies/lawam/modeling_lawam.py:322— src/lerobot/policies/lawam/modeling_lawam.py:322-328 | src/lerobot/policies/lingbot_vla_v2/modeling_lingbot_vla_v2.py:2280-2286 | src/lerobot/policies/vla_jepa/modeling_vla_jepa.py:561-567 | src/lerobot/policies/wall_x/modeling_wall_x.py:2021-2030 | src/lerobot/policies/xvla/modeling_xvla.py:459-465 — 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) src/lerobot/rl/actor.py:237— src/lerobot/rl/actor.py:237-431 | src/lerobot/rl/actor.py:497-541 | src/lerobot/rl/actor.py:551-597 | src/lerobot/rl/actor.py:607-656 | src/lerobot/rl/learner.py:490-550 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Edited copy of a member (50 corresponding lines) · ×2
Edited copy of a member (50 corresponding lines) src/lerobot/policies/evo1/modeling_evo1.py:198— src/lerobot/policies/evo1/modeling_evo1.py:198-247 | src/lerobot/policies/evo1/modeling_evo1.py:250-314 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (50 corresponding lines) src/lerobot/configs/policies.py:191— src/lerobot/configs/policies.py:191-248 | src/lerobot/configs/rewards.py:125-174 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (46 corresponding lines) · ×2
Edited copy of a member (46 corresponding lines) src/lerobot/policies/diffusion/modeling_diffusion.py:500— src/lerobot/policies/diffusion/modeling_diffusion.py:500-556 | src/lerobot/policies/vqbet/modeling_vqbet.py:666-711 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (46 corresponding lines) src/lerobot/policies/lingbot_vla_v2/model_core/qwen2_action_expert.py:305— src/lerobot/policies/lingbot_vla_v2/model_core/qwen2_action_expert.py:305-351 | src/lerobot/policies/lingbot_vla_v2/model_core/qwen3vl_in_vla.py:216-261 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (37 corresponding lines) · ×2
Edited copy of a member (37 corresponding lines) src/lerobot/policies/pi0/modeling_pi0.py:420— src/lerobot/policies/pi0/modeling_pi0.py:420-456 | src/lerobot/policies/pi05/modeling_pi05.py:647-688 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (37 corresponding lines) examples/dataset/use_dataset_image_transforms.py:47— examples/dataset/use_dataset_image_transforms.py:47-83 | examples/dataset/use_dataset_image_transforms.py:87-132 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (33 corresponding lines) · ×2
Edited copy of a member (33 corresponding lines) src/lerobot/policies/pi0/modeling_pi0.py:515— src/lerobot/policies/pi0/modeling_pi0.py:515-547 | src/lerobot/policies/pi05/modeling_pi05.py:780-822 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) src/lerobot/scripts/lerobot_edit_dataset.py:436— src/lerobot/scripts/lerobot_edit_dataset.py:436-468 | src/lerobot/scripts/lerobot_edit_dataset.py:552-584 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×2
Edited copy of a member (23 corresponding lines) src/lerobot/policies/praxis/praxis_core/bimanual.py:548— src/lerobot/policies/praxis/praxis_core/bimanual.py:548-577 | src/lerobot/policies/praxis/praxis_core/single_arm.py:592-614 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) src/lerobot/motors/damiao/damiao.py:545— src/lerobot/motors/damiao/damiao.py:545-567 | src/lerobot/motors/robstride/robstride.py:754-794 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (30 corresponding lines) · ×2
Edited copy of a member (30 corresponding lines) src/lerobot/policies/molmoact2/molmoact2_hf_model/image_processing_molmoact2.py:57— src/lerobot/policies/molmoact2/molmoact2_hf_model/image_processing_molmoact2.py:57-86 | src/lerobot/policies/molmoact2/molmoact2_hf_model/video_processing_molmoact2.py:81-118 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) src/lerobot/rewards/robometer/processor_robometer.py:309— src/lerobot/rewards/robometer/processor_robometer.py:309-338 | src/lerobot/rewards/topreward/processor_topreward.py:277-307 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (36 corresponding lines) · ×2
Edited copy of a member (36 corresponding lines) src/lerobot/policies/groot/action_head/cross_attention_dit.py:287— src/lerobot/policies/groot/action_head/cross_attention_dit.py:287-322 | src/lerobot/policies/groot/action_head/cross_attention_dit.py:342-387 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (36 corresponding lines) src/lerobot/motors/damiao/damiao.py:357— src/lerobot/motors/damiao/damiao.py:357-392 | src/lerobot/motors/robstride/robstride.py:441-479 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (44 corresponding lines) · ×2
Edited copy of a member (44 corresponding lines) src/lerobot/policies/groot/action_head/cross_attention_dit.py:233— src/lerobot/policies/groot/action_head/cross_attention_dit.py:233-276 | src/lerobot/policies/lawam/vlas/cross_attention_dit.py:239-285 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (44 corresponding lines) examples/tutorial/act/act_using_example.py:15— examples/tutorial/act/act_using_example.py:15-58 | examples/tutorial/diffusion/diffusion_using_example.py:15-59 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (38 corresponding lines) · ×2
Edited copy of a member (38 corresponding lines) src/lerobot/cameras/opencv/camera_opencv.py:421— src/lerobot/cameras/opencv/camera_opencv.py:421-458 | src/lerobot/cameras/realsense/camera_realsense.py:625-665 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (38 corresponding lines) src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:2317— src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:2317-2354 | src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:2370-2407 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 8+ corresponding lines) · ×2
Edited copies of one member (3 members, 8+ corresponding lines) src/lerobot/robots/so_follower/robot_kinematic_processor.py:171— src/lerobot/robots/so_follower/robot_kinematic_processor.py:171-188 | src/lerobot/robots/so_follower/robot_kinematic_processor.py:485-492 | src/lerobot/robots/so_follower/robot_kinematic_processor.py:518-525 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) src/lerobot/policies/molmoact2/modeling_molmoact2.py:2058— src/lerobot/policies/flux3/modeling_flux3.py:654-667 | src/lerobot/policies/molmoact2/modeling_molmoact2.py:2058-2065 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:1198-1211 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 3+ corresponding lines) · ×2
Edited copies of one member (3 members, 3+ corresponding lines) src/lerobot/policies/molmoact2/molmoact2_hf_model/inference.py:720— src/lerobot/policies/molmoact2/molmoact2_hf_model/inference.py:720-722 | src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:1879-1882 | src/lerobot/policies/multi_task_dit/modeling_multi_task_dit.py:461-463 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 3+ corresponding lines) src/lerobot/policies/groot/groot_n1_7.py:196— src/lerobot/policies/groot/groot_n1_7.py:196-198 | src/lerobot/policies/lawam/lam_core/core/utils/modules.py:43-45 | src/lerobot/policies/lawam/vlas/flowmatching_expert.py:84-87 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (41–42 lines × 2) src/lerobot/motors/damiao/damiao.py:160— src/lerobot/motors/damiao/damiao.py:160-201 | src/lerobot/motors/robstride/robstride.py:177-217 — `src/lerobot/motors/damiao/damiao.py` and `src/lerobot/motors/robstride/robstride.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 142 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 (41–42 lines × 2) src/lerobot/policies/pi0/modeling_pi0.py:1020— src/lerobot/policies/pi0/modeling_pi0.py:1020-1060 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:988-1029 — before extracting anything, compare `src/lerobot/policies/pi0/modeling_pi0.py` and `src/lerobot/policies/pi0_fast/modeling_pi0_fast.py` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 278 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/pi0/modeling_pi0.py:1020` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (32 lines × 2) src/lerobot/policies/pi0/modeling_pi0.py:215— src/lerobot/policies/pi0/modeling_pi0.py:215-246 | src/lerobot/policies/pi05/modeling_pi05.py:398-429 — `src/lerobot/policies/pi0/modeling_pi0.py` and `src/lerobot/policies/pi05/modeling_pi05.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 547 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 (32 lines × 2) src/lerobot/rewards/sarm/modeling_sarm.py:69— src/lerobot/rewards/sarm/modeling_sarm.py:69-100 | src/lerobot/rewards/sarm/modeling_sarm.py:204-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 (30–31 lines × 2) src/lerobot/policies/wall_x/modeling_wall_x.py:858— src/lerobot/policies/wall_x/modeling_wall_x.py:858-887 | src/lerobot/policies/wall_x/modeling_wall_x.py:1172-1202 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/lerobot/policies/wall_x/modeling_wall_x.py:889` calls `any` and `src/lerobot/policies/wall_x/modeling_wall_x.py:1203` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (30–31 lines × 2) examples/phone_to_so100/record.py:183— examples/phone_to_so100/record.py:183-212 | examples/so100_to_so100_EE/record.py:178-208 — `examples/phone_to_so100/record.py` and `examples/so100_to_so100_EE/record.py` are one unit implemented 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 149 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `examples/phone_to_so100/record.py:183` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (29–30 lines × 2) src/lerobot/policies/diffusion/modeling_diffusion.py:514— src/lerobot/policies/diffusion/modeling_diffusion.py:514-542 | src/lerobot/policies/vqbet/modeling_vqbet.py:674-703 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/diffusion/modeling_diffusion.py:514` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `config` to `DiffusionConfig` in one and `VQBeTConfig` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (29–30 lines × 2) src/lerobot/rollout/strategies/dagger.py:388— src/lerobot/rollout/strategies/dagger.py:388-417 | src/lerobot/rollout/strategies/dagger.py:581-609 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/rollout/strategies/dagger.py:581` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (30 lines × 2) src/lerobot/policies/molmoact2/modeling_molmoact2.py:228— src/lerobot/policies/molmoact2/modeling_molmoact2.py:228-257 | src/lerobot/policies/molmoact2/processor_molmoact2.py:188-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 (30 lines × 2) src/lerobot/rewards/robometer/compute_rabc_weights.py:288— src/lerobot/rewards/robometer/compute_rabc_weights.py:288-317 | src/lerobot/rewards/topreward/compute_rabc_weights.py:319-348 — `src/lerobot/rewards/robometer/compute_rabc_weights.py` and `src/lerobot/rewards/topreward/compute_rabc_weights.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 160 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/rewards/robometer/compute_rabc_weights.py:288` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (28–29 lines × 2) src/lerobot/policies/fastwam/wan/modular.py:1618— src/lerobot/policies/fastwam/wan/modular.py:1618-1645 | src/lerobot/policies/fastwam/wan/modular.py:1751-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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (28–29 lines × 2) src/lerobot/rollout/strategies/dagger.py:419— src/lerobot/rollout/strategies/dagger.py:419-446 | src/lerobot/rollout/strategies/dagger.py:636-664 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (25 lines × 2) src/lerobot/policies/molmoact2/molmoact2_hf_model/image_processing_molmoact2.py:58— src/lerobot/policies/molmoact2/molmoact2_hf_model/image_processing_molmoact2.py:58-82 | src/lerobot/policies/molmoact2/molmoact2_hf_model/video_processing_molmoact2.py:87-111 — before extracting anything, compare `src/lerobot/policies/molmoact2/molmoact2_hf_model/image_processing_molmoact2.py` and `src/lerobot/policies/molmoact2/molmoact2_hf_model/video_processing_molmoact2.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/lerobot/policies/molmoact2/molmoact2_hf_model/video_processing_molmoact2.py:114` calls `permute`, `numpy` and `src/lerobot/policies/molmoact2/molmoact2_hf_model/image_processing_molmoact2.py:84` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (25 lines × 2) src/lerobot/policies/smolvla/modeling_smolvla.py:357— src/lerobot/policies/smolvla/modeling_smolvla.py:357-381 | src/lerobot/policies/xvla/modeling_xvla.py:296-320 — 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 (24 lines × 2) src/lerobot/policies/pi0/modeling_pi0.py:636— src/lerobot/policies/pi0/modeling_pi0.py:636-659 | src/lerobot/policies/pi05/modeling_pi05.py:908-931 — `src/lerobot/policies/pi0/modeling_pi0.py` and `src/lerobot/policies/pi05/modeling_pi05.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 547 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 (24 lines × 2) src/lerobot/processor/relative_action_processor.py:45— src/lerobot/processor/relative_action_processor.py:45-68 | src/lerobot/processor/relative_action_processor.py:74-97 — both copies are in the same file, so extract the block into 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 × 3) src/lerobot/policies/pi0/modeling_pi0.py:162— src/lerobot/policies/pi0/modeling_pi0.py:162-182 | src/lerobot/policies/pi05/modeling_pi05.py:340-360 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:82-102 — `src/lerobot/policies/pi0/modeling_pi0.py` and `src/lerobot/policies/pi05/modeling_pi05.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 547 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (21 lines × 3) src/lerobot/policies/pi0/modeling_pi0.py:249— src/lerobot/policies/pi0/modeling_pi0.py:249-269 | src/lerobot/policies/pi05/modeling_pi05.py:432-452 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:149-169 — `src/lerobot/policies/pi0/modeling_pi0.py` and `src/lerobot/policies/pi05/modeling_pi05.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 547 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18–21 lines × 2) src/lerobot/datasets/dataset_metadata.py:313— src/lerobot/datasets/dataset_metadata.py:313-330 | src/lerobot/datasets/dataset_metadata.py:337-357 — both copies are in the same file, so extract the block into 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–21 lines × 2) src/lerobot/policies/lawam/vlas/flowmatching_expert.py:451— src/lerobot/policies/lawam/vlas/flowmatching_expert.py:451-468 | src/lerobot/policies/lawam/vlas/flowmatching_expert.py:672-692 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/lawam/vlas/flowmatching_expert.py:451` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19–20 lines × 2) src/lerobot/policies/pi0/modeling_pi0.py:673— src/lerobot/policies/pi0/modeling_pi0.py:673-692 | src/lerobot/policies/pi05/modeling_pi05.py:946-964 — `src/lerobot/policies/pi0/modeling_pi0.py` and `src/lerobot/policies/pi05/modeling_pi05.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 547 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/pi0/modeling_pi0.py:673` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (19–20 lines × 2) examples/so100_to_so100_EE/record.py:58— examples/so100_to_so100_EE/record.py:58-76 | examples/so100_to_so100_EE/teleoperate.py:44-63 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `examples/so100_to_so100_EE/record.py:58` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–17 lines × 3) src/lerobot/robots/koch_follower/koch_follower.py:45— src/lerobot/robots/koch_follower/koch_follower.py:45-60 | src/lerobot/robots/omx_follower/omx_follower.py:45-60 | src/lerobot/robots/so_follower/so_follower.py:65-81 — `src/lerobot/robots/koch_follower/koch_follower.py` and `src/lerobot/robots/omx_follower/omx_follower.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 118 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind `config` to `KochFollowerConfig` in one and `OmxFollowerConfig` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (16–17 lines × 3) examples/lekiwi/evaluate.py:64— examples/lekiwi/evaluate.py:64-80 | examples/phone_to_so100/evaluate.py:129-144 | examples/so100_to_so100_EE/evaluate.py:129-144 — `examples/phone_to_so100/evaluate.py` and `examples/so100_to_so100_EE/evaluate.py` are one unit implemented 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 248 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `examples/lekiwi/evaluate.py:64` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `examples/lekiwi/evaluate.py:83` calls `make_default_processors` and `examples/phone_to_so100/evaluate.py:147` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17 lines × 3) src/lerobot/rollout/strategies/base.py:62— src/lerobot/rollout/strategies/base.py:62-78 | src/lerobot/rollout/strategies/highlight.py:115-131 | src/lerobot/rollout/strategies/sentry.py:123-139 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/lerobot/rollout/strategies/highlight.py:134` calls `transition_to_robot_action` and `src/lerobot/rollout/strategies/base.py:79` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17 lines × 3) src/lerobot/robots/koch_follower/koch_follower.py:91— src/lerobot/robots/koch_follower/koch_follower.py:91-107 | src/lerobot/robots/omx_follower/omx_follower.py:91-109 | src/lerobot/robots/so_follower/so_follower.py:112-128 — `src/lerobot/robots/koch_follower/koch_follower.py` and `src/lerobot/robots/omx_follower/omx_follower.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 118 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (14–17 lines × 2) src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:3261— src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:3261-3274 | src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:3393-3409 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:3261` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–17 lines × 2) src/lerobot/sim/integrations/metaworld.py:291— src/lerobot/sim/integrations/metaworld.py:291-304 | src/lerobot/sim/integrations/vlabench.py:534-550 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/sim/integrations/vlabench.py:534` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (16 lines × 3) src/lerobot/policies/pi0/configuration_pi0.py:135— src/lerobot/policies/pi0/configuration_pi0.py:135-150 | src/lerobot/policies/pi05/configuration_pi05.py:164-179 | src/lerobot/policies/pi0_fast/configuration_pi0_fast.py:129-144 — `src/lerobot/policies/pi0/configuration_pi0.py` and `src/lerobot/policies/pi05/configuration_pi05.py` are one unit implemented 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 47 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/pi0/configuration_pi0.py:135` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 3) src/lerobot/policies/pi0/modeling_pi0.py:869— src/lerobot/policies/pi0/modeling_pi0.py:869-884 | src/lerobot/policies/pi05/modeling_pi05.py:1219-1234 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:868-883 — `src/lerobot/policies/pi0/modeling_pi0.py` and `src/lerobot/policies/pi05/modeling_pi05.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 547 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind `config` to `PI0Config` in one and `PI0FastConfig` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (14–15 lines × 2) src/lerobot/motors/damiao/damiao.py:448— src/lerobot/motors/damiao/damiao.py:448-462 | src/lerobot/motors/robstride/robstride.py:696-709 — `src/lerobot/motors/damiao/damiao.py` and `src/lerobot/motors/robstride/robstride.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 142 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (14–15 lines × 2) src/lerobot/policies/pretrained.py:220— src/lerobot/policies/pretrained.py:220-233 | src/lerobot/policies/xvla/modeling_xvla.py:492-506 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (14 lines × 3) src/lerobot/policies/pi0/modeling_pi0.py:206— src/lerobot/policies/pi0/modeling_pi0.py:206-219 | src/lerobot/policies/pi05/modeling_pi05.py:389-402 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:118-131 — `src/lerobot/policies/pi0/modeling_pi0.py` and `src/lerobot/policies/pi05/modeling_pi05.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 547 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (14 lines × 3) src/lerobot/rollout/strategies/dagger.py:331— src/lerobot/rollout/strategies/dagger.py:331-344 | src/lerobot/rollout/strategies/highlight.py:231-244 | src/lerobot/rollout/strategies/sentry.py:286-299 — 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–14 lines × 2) src/lerobot/rewards/robometer/compute_rabc_weights.py:167— src/lerobot/rewards/robometer/compute_rabc_weights.py:167-180 | src/lerobot/rewards/topreward/compute_rabc_weights.py:116-126 — `src/lerobot/rewards/robometer/compute_rabc_weights.py` and `src/lerobot/rewards/topreward/compute_rabc_weights.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 160 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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–14 lines × 2) examples/dataset/use_dataset_image_transforms.py:119— examples/dataset/use_dataset_image_transforms.py:119-132 | examples/dataset/use_dataset_image_transforms.py:154-164 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `examples/dataset/use_dataset_image_transforms.py:119` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 3) src/lerobot/policies/lingbot_vla_v2/modeling_lingbot_vla_v2.py:1396— src/lerobot/policies/lingbot_vla_v2/modeling_lingbot_vla_v2.py:1396-1408 | src/lerobot/policies/lingbot_vla_v2/modeling_lingbot_vla_v2.py:1540-1552 | src/lerobot/policies/lingbot_vla_v2/modeling_lingbot_vla_v2.py:1768-1780 — all 3 copies are in the same file, so extract the block into one function there and call 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) src/lerobot/robots/bi_openarm_follower/bi_openarm_follower.py:40— src/lerobot/robots/bi_openarm_follower/bi_openarm_follower.py:40-52 | src/lerobot/robots/bi_rebot_b601_follower/bi_rebot_b601_follower.py:39-51 | src/lerobot/robots/bi_so_follower/bi_so_follower.py:40-52 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Note first that the copies are not typed on the same thing: the declarations holding them bind `config` to `BiOpenArmFollowerConfig` in one and `BiRebotB601FollowerConfig` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (12–13 lines × 2) src/lerobot/policies/dm05/core/modeling.py:1731— src/lerobot/policies/dm05/core/modeling.py:1731-1742 | src/lerobot/policies/dm05/core/modeling.py:1827-1839 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/dm05/core/modeling.py:1731` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–13 lines × 2) src/lerobot/policies/praxis/praxis_core/bimanual.py:141— src/lerobot/policies/praxis/praxis_core/bimanual.py:141-152 | src/lerobot/policies/praxis/praxis_core/single_arm.py:112-124 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/praxis/praxis_core/bimanual.py:141` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 2) src/lerobot/policies/lawam/vlas/flowmatching_expert.py:434— src/lerobot/policies/lawam/vlas/flowmatching_expert.py:434-445 | src/lerobot/policies/lawam/vlas/flowmatching_expert.py:664-674 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/lawam/vlas/flowmatching_expert.py:434` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 2) src/lerobot/policies/xvla/action_hub.py:290— src/lerobot/policies/xvla/action_hub.py:290-301 | src/lerobot/policies/xvla/action_hub.py:469-479 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/lerobot/policies/xvla/action_hub.py:464` calls `BCEWithLogitsLoss` and `src/lerobot/policies/xvla/action_hub.py:287` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10–12 lines × 2) src/lerobot/policies/pi0/modeling_pi0.py:121— src/lerobot/policies/pi0/modeling_pi0.py:121-132 | src/lerobot/policies/pi05/modeling_pi05.py:295-304 — `src/lerobot/policies/pi0/modeling_pi0.py` and `src/lerobot/policies/pi05/modeling_pi05.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 547 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/pi0/modeling_pi0.py:121` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–12 lines × 2) src/lerobot/policies/wall_x/modeling_wall_x.py:887— src/lerobot/policies/wall_x/modeling_wall_x.py:887-898 | src/lerobot/policies/wall_x/modeling_wall_x.py:922-931 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–11 lines × 2) src/lerobot/policies/evo1/processor_evo1.py:115— src/lerobot/policies/evo1/processor_evo1.py:115-125 | src/lerobot/policies/wall_oss_05/processor_wall_oss_05.py:438-447 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10–11 lines × 2) src/lerobot/policies/molmoact2/modeling_molmoact2.py:1938— src/lerobot/policies/molmoact2/modeling_molmoact2.py:1938-1948 | src/lerobot/policies/molmoact2/modeling_molmoact2.py:1966-1975 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/molmoact2/modeling_molmoact2.py:1938` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) src/lerobot/policies/cosmos3/processor_cosmos3.py:680— src/lerobot/policies/cosmos3/processor_cosmos3.py:680-689 | src/lerobot/policies/dm05/processor_dm05.py:438-447 | src/lerobot/policies/lingbot_vla_v2/processor_lingbot_vla_v2.py:445-454 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 3) src/lerobot/rewards/robometer/compute_rabc_weights.py:73— src/lerobot/rewards/robometer/compute_rabc_weights.py:73-82 | src/lerobot/rewards/sarm/compute_rabc_weights.py:70-79 | src/lerobot/rewards/topreward/compute_rabc_weights.py:61-70 — `src/lerobot/rewards/robometer/compute_rabc_weights.py` and `src/lerobot/rewards/topreward/compute_rabc_weights.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 160 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 3) src/lerobot/data_processing/sarm_annotations/subtask_annotation.py:955— src/lerobot/data_processing/sarm_annotations/subtask_annotation.py:955-962 | src/lerobot/rewards/robometer/compute_rabc_weights.py:235-242 | src/lerobot/rewards/topreward/compute_rabc_weights.py:278-285 — `src/lerobot/rewards/robometer/compute_rabc_weights.py` and `src/lerobot/rewards/topreward/compute_rabc_weights.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 160 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/data_processing/sarm_annotations/subtask_annotation.py:955` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/lerobot/rewards/topreward/compute_rabc_weights.py:286` calls `add_argument` and `src/lerobot/rewards/robometer/compute_rabc_weights.py:243` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 3) src/lerobot/policies/eo1/modeling_eo1.py:320— src/lerobot/policies/eo1/modeling_eo1.py:320-327 | src/lerobot/policies/pi0/modeling_pi0.py:489-496 | src/lerobot/policies/pi05/modeling_pi05.py:733-740 — `src/lerobot/policies/pi0/modeling_pi0.py` and `src/lerobot/policies/pi05/modeling_pi05.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 547 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6–8 lines × 2) src/lerobot/datasets/factory.py:218— src/lerobot/datasets/factory.py:218-225 | src/lerobot/datasets/factory.py:311-316 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6–8 lines × 2) src/lerobot/policies/lingbot_vla_v2/model_core/qwen2_action_expert.py:326— src/lerobot/policies/lingbot_vla_v2/model_core/qwen2_action_expert.py:326-333 | src/lerobot/policies/lingbot_vla_v2/model_core/qwen3vl_in_vla.py:230-235 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/lerobot/policies/lingbot_vla_v2/model_core/qwen2_action_expert.py:335` calls `post_attention_layernorm` and `src/lerobot/policies/lingbot_vla_v2/model_core/qwen3vl_in_vla.py:236` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 4) src/lerobot/policies/eo1/modeling_eo1.py:208— src/lerobot/policies/eo1/modeling_eo1.py:208-214 | src/lerobot/policies/evo1/modeling_evo1.py:534-541 | src/lerobot/policies/fastwam/modeling_fastwam.py:344-348 | src/lerobot/policies/pi0/modeling_pi0.py:1083-1091 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/lerobot/policies/evo1/modeling_evo1.py:531` calls `_rtc_enabled` and `src/lerobot/policies/eo1/modeling_eo1.py:207` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 4) src/lerobot/robots/koch_follower/koch_follower.py:154— src/lerobot/robots/koch_follower/koch_follower.py:154-158 | src/lerobot/robots/omx_follower/omx_follower.py:168-172 | src/lerobot/teleoperators/koch_leader/koch_leader.py:123-127 | src/lerobot/teleoperators/omx_leader/omx_leader.py:144-148 — `src/lerobot/robots/koch_follower/koch_follower.py` and `src/lerobot/robots/omx_follower/omx_follower.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 118 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Low cohesion: PreTrainedPolicy (LCOM4 4) src/lerobot/policies/pretrained.py:96— PreTrainedPolicy's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: RolloutStrategy (LCOM4 4) src/lerobot/rollout/strategies/core.py:57— RolloutStrategy's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
lerobot_train.train (cyclomatic 93) src/lerobot/scripts/lerobot_train.py:529— lerobot_train.train has cyclomatic complexity 93 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
subtask_annotation.main (cyclomatic 53) src/lerobot/data_processing/sarm_annotations/subtask_annotation.py:953— subtask_annotation.main has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Qwen2_5_VLMoEForAction.predict (cyclomatic 47) src/lerobot/policies/wall_x/modeling_wall_x.py:1053— Qwen2_5_VLMoEForAction.predict has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
lerobot_train.make_dataloaders (cyclomatic 47) src/lerobot/scripts/lerobot_train.py:325— lerobot_train.make_dataloaders has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
lerobot_eval.rollout (cyclomatic 45) src/lerobot/scripts/lerobot_eval.py:174— lerobot_eval.rollout 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.
factory.make_policy (cyclomatic 40) src/lerobot/policies/factory.py:256— factory.make_policy has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SessionWorker._validate_data (cyclomatic 40) src/lerobot/remote_inference/server.py:449— SessionWorker._validate_data has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
compute_rabc_weights.compute_sarm_progress (cyclomatic 40) src/lerobot/rewards/sarm/compute_rabc_weights.py:466— compute_rabc_weights.compute_sarm_progress has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RTCInferenceEngine._rtc_loop (cyclomatic 39) src/lerobot/inference/rtc.py:507— RTCInferenceEngine._rtc_loop 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.
GrootN17PackInputsStep.__call__ (cyclomatic 39) src/lerobot/policies/groot/processor_groot.py:1751— GrootN17PackInputsStep.__call__ 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.
context.build_rollout_context (cyclomatic 39) src/lerobot/rollout/context.py:478— context.build_rollout_context has cyclomatic complexity 39 (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.
lerobot_eval.eval_policy (cyclomatic 39) src/lerobot/scripts/lerobot_eval.py:464— lerobot_eval.eval_policy 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.
GrootN17ActionDecodeStep.__call__ (cyclomatic 38) src/lerobot/policies/groot/processor_groot.py:2293— GrootN17ActionDecodeStep.__call__ has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
processor_groot.make_groot_pre_post_processors (cyclomatic 38) src/lerobot/policies/groot/processor_groot.py:1088— processor_groot.make_groot_pre_post_processors has cyclomatic complexity 38 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
VectorQuantize.forward (cyclomatic 38) src/lerobot/policies/vqbet/vqbet_utils.py:695— VectorQuantize.forward has cyclomatic complexity 38 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
RolloutConfig.__post_init__ (cyclomatic 38) src/lerobot/rollout/configs.py:358— RolloutConfig.__post_init__ has cyclomatic complexity 38 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Qwen2_5_VLMoEForAction.train_step_forward (cyclomatic 37) src/lerobot/policies/wall_x/modeling_wall_x.py:743— Qwen2_5_VLMoEForAction.train_step_forward has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
migrate_policy_normalization.detect_features_and_norm_modes (cyclomatic 37) src/lerobot/processor/migrate_policy_normalization.py:126— migrate_policy_normalization.detect_features_and_norm_modes has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RemoteInferenceEngine._loop (cyclomatic 37) src/lerobot/remote_inference/engine.py:676— RemoteInferenceEngine._loop has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DatasetConfig.__post_init__ (cyclomatic 36) REDACTED:85— DatasetConfig.__post_init__ has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MolmoAct2ForConditionalGeneration.predict_action (cyclomatic 35) src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:4316— MolmoAct2ForConditionalGeneration.predict_action has cyclomatic complexity 35 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LeRobotDataset.__init__ (cyclomatic 34) src/lerobot/datasets/lerobot_dataset.py:53— LeRobotDataset.__init__ has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
EO1PrepareModelMessagesStep.complementary_data (cyclomatic 34) src/lerobot/policies/eo1/processor_eo1.py:91— EO1PrepareModelMessagesStep.complementary_data has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
processor_groot._build_n1_7_relative_action_processor_assets (cyclomatic 34) src/lerobot/policies/groot/processor_groot.py:952— processor_groot._build_n1_7_relative_action_processor_assets has cyclomatic complexity 34 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SessionWorker.submit (cyclomatic 34) src/lerobot/remote_inference/server.py:268— SessionWorker.submit has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TrainPipelineConfig.validate (cyclomatic 33) src/lerobot/configs/train.py:285— TrainPipelineConfig.validate has cyclomatic complexity 33 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
flow_matching.euler_integrate (cyclomatic 33) src/lerobot/policies/common/flow_matching.py:256— flow_matching.euler_integrate has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MolmoAct2TextModel.forward (cyclomatic 33) src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:2526— MolmoAct2TextModel.forward has cyclomatic complexity 33 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
utils.preprocesser_call (cyclomatic 32) src/lerobot/policies/wall_x/utils.py:57— utils.preprocesser_call 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.
lerobot_dataset_viz.visualize_dataset (cyclomatic 32) src/lerobot/scripts/lerobot_dataset_viz.py:168— lerobot_dataset_viz.visualize_dataset 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.
lerobot_record.record (cyclomatic 32) src/lerobot/scripts/lerobot_record.py:394— lerobot_record.record has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
check_docstrings.match_docstring_with_signature (cyclomatic 32) utils/check_docstrings.py:298— check_docstrings.match_docstring_with_signature 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.
MolmoAct2Config.__post_init__ (cyclomatic 31) src/lerobot/policies/molmoact2/configuration_molmoact2.py:399— MolmoAct2Config.__post_init__ has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
compute_rabc_weights.visualize_sarm_predictions (cyclomatic 31) src/lerobot/rewards/sarm/compute_rabc_weights.py:214— compute_rabc_weights.visualize_sarm_predictions has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DatasetWriter.save_episode (cyclomatic 30) src/lerobot/datasets/dataset_writer.py:271— DatasetWriter.save_episode has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PolicyRunner.__init__ (cyclomatic 30) src/lerobot/inference/policy_runner.py:60— PolicyRunner.__init__ has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FineARTVLAPolicy.forward (cyclomatic 30) REDACTED:776— FineARTVLAPolicy.forward has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SARMEncodingProcessorStep.__call__ (cyclomatic 30) src/lerobot/rewards/sarm/processor_sarm.py:275— SARMEncodingProcessorStep.__call__ has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FastWAM.build_inputs (cyclomatic 29) src/lerobot/policies/fastwam/wan/modular.py:1355— FastWAM.build_inputs has cyclomatic complexity 29 (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.
SessionWorker._run (cyclomatic 29) src/lerobot/remote_inference/server.py:635— SessionWorker._run 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.
codec._encode_value (cyclomatic 29) src/lerobot/transport/protocol/codec.py:147— codec._encode_value 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.
Evo1Config.__post_init__ (cyclomatic 28) src/lerobot/policies/evo1/configuration_evo1.py:117— Evo1Config.__post_init__ 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.
fit_fast_tokenizer.fit_fast_tokenizer (cyclomatic 28) REDACTED:222— fit_fast_tokenizer.fit_fast_tokenizer 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.
MolmoAct2ForConditionalGeneration._generate_depth_prefix (cyclomatic 28) src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:4074— MolmoAct2ForConditionalGeneration._generate_depth_prefix 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.
WallOSS05TokenizerStep.__call__ (cyclomatic 28) src/lerobot/policies/wall_oss_05/processor_wall_oss_05.py:242— WallOSS05TokenizerStep.__call__ 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.
migrate_policy_normalization.main (cyclomatic 28) src/lerobot/processor/migrate_policy_normalization.py:473— migrate_policy_normalization.main 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.
exo_calib.run_exo_calibration (cyclomatic 28) src/lerobot/teleoperators/unitree_g1/exo_calib.py:150— exo_calib.run_exo_calibration 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.
LaWAMConfig.validate_features (cyclomatic 27) src/lerobot/policies/lawam/configuration_lawam.py:192— LaWAMConfig.validate_features has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
StreamingLeRobotDataset._iter_once (cyclomatic 26) src/lerobot/datasets/streaming_dataset.py:494— StreamingLeRobotDataset._iter_once 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.
MultiTaskDiTConfig._validate (cyclomatic 26) src/lerobot/policies/multi_task_dit/configuration_multi_task_dit.py:125— MultiTaskDiTConfig._validate 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.
DM05Policy._prepare_model_inputs (cyclomatic 25) src/lerobot/policies/dm05/modeling_dm05.py:394— DM05Policy._prepare_model_inputs has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FineARTVLAConfig.__post_init__ (cyclomatic 25) src/lerobot/policies/fineart_vla/configuration_fineart_vla.py:166— FineARTVLAConfig.__post_init__ has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ConditionalFlowMatchingHead.sample_actions_cfg (cyclomatic 25) src/lerobot/policies/lawam/vlas/flowmatching_expert.py:536— ConditionalFlowMatchingHead.sample_actions_cfg 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.
MolmoAct2PackInputsProcessorStep.__call__ (cyclomatic 25) src/lerobot/policies/molmoact2/processor_molmoact2.py:938— MolmoAct2PackInputsProcessorStep.__call__ has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ServerConfig.__post_init__ (cyclomatic 25) src/lerobot/remote_inference/configs.py:85— ServerConfig.__post_init__ has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
lerobot_train_tokenizer.train_tokenizer (cyclomatic 25) src/lerobot/scripts/lerobot_train_tokenizer.py:383— lerobot_train_tokenizer.train_tokenizer 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.
dataset_tools.modify_features (cyclomatic 24) src/lerobot/datasets/dataset_tools.py:330— dataset_tools.modify_features has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
dataset_tools.convert_image_to_video_dataset (cyclomatic 24) src/lerobot/datasets/dataset_tools.py:1838— dataset_tools.convert_image_to_video_dataset 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.
video_utils.reencode_video (cyclomatic 24) src/lerobot/datasets/video_utils.py:587— video_utils.reencode_video has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ActionDiT.pre_dit (cyclomatic 24) src/lerobot/policies/fastwam/wan/modular.py:142— ActionDiT.pre_dit 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.
FlowMatchingV2._init_align (cyclomatic 24) src/lerobot/policies/lingbot_vla_v2/modeling_lingbot_vla_v2.py:601— FlowMatchingV2._init_align 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.
_NormalizationMixin._apply_transform (cyclomatic 24) src/lerobot/processor/normalize_processor.py:305— _NormalizationMixin._apply_transform has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
lerobot_record.record_loop (cyclomatic 24) src/lerobot/scripts/lerobot_record.py:232— lerobot_record.record_loop has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
sidecar_utils._read_metadata (cyclomatic 24) src/lerobot/streaming/sidecar_utils.py:178— sidecar_utils._read_metadata has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
dataset_tools.recompute_stats (cyclomatic 23) src/lerobot/datasets/dataset_tools.py:1729— dataset_tools.recompute_stats 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.
ChunkRuntime.__init__ (cyclomatic 23) src/lerobot/inference/execution.py:146— ChunkRuntime.__init__ has cyclomatic complexity 23 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
WanVideoDiT._validate_forward_inputs (cyclomatic 23) src/lerobot/policies/fastwam/wan/video_dit.py:646— WanVideoDiT._validate_forward_inputs 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.
FineARTVLAPolicy.select_message (cyclomatic 23) REDACTED:1317— FineARTVLAPolicy.select_message 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.
Tracker.track (cyclomatic 23) src/lerobot/policies/rtc/debug_tracker.py:126— Tracker.track 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.
RemoteClient.admit (cyclomatic 23) src/lerobot/remote_inference/client.py:228— RemoteClient.admit has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RemoteInferenceEngine._drain_log_events (cyclomatic 23) src/lerobot/remote_inference/engine.py:143— RemoteInferenceEngine._drain_log_events 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.
SessionWorker._execute (cyclomatic 23) src/lerobot/remote_inference/server.py:530— SessionWorker._execute 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.
gym_manipulator.control_loop (cyclomatic 23) src/lerobot/rl/gym_manipulator.py:613— gym_manipulator.control_loop 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.
utils.preprocess_observation (cyclomatic 22) src/lerobot/envs/utils.py:52— utils.preprocess_observation 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.
prediction.predict_chunk (cyclomatic 22) src/lerobot/inference/prediction.py:110— prediction.predict_chunk 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.
PiGemmaModel.forward (cyclomatic 22) src/lerobot/policies/pi_gemma.py:228— PiGemmaModel.forward has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PraxisConfig.__post_init__ (cyclomatic 22) src/lerobot/policies/praxis/configuration_praxis.py:182— PraxisConfig.__post_init__ has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
context.build_remote_rollout_context (cyclomatic 22) src/lerobot/rollout/context.py:764— context.build_remote_rollout_context has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
lerobot_train.update_policy (cyclomatic 22) src/lerobot/scripts/lerobot_train.py:181— lerobot_train.update_policy has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
dataset_tools._copy_and_reindex_episodes_metadata (cyclomatic 21) src/lerobot/datasets/dataset_tools.py:992— dataset_tools._copy_and_reindex_episodes_metadata 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.
LanceDatasetReader.__init__ (cyclomatic 21) src/lerobot/datasets/lance_backend.py:205— LanceDatasetReader.__init__ has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_CameraEncoderThread.run (cyclomatic 21) src/lerobot/datasets/video_utils.py:831— _CameraEncoderThread.run 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.
RTCInferenceEngine.__init__ (cyclomatic 21) src/lerobot/inference/rtc.py:114— RTCInferenceEngine.__init__ has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DM05Config.__post_init__ (cyclomatic 21) src/lerobot/policies/dm05/configuration_dm05.py:122— DM05Config.__post_init__ has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MoT.__init__ (cyclomatic 21) src/lerobot/policies/fastwam/wan/modular.py:710— MoT.__init__ has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
utils.flatten_n1_7_modality_stats (cyclomatic 21) src/lerobot/policies/groot/utils.py:127— utils.flatten_n1_7_modality_stats 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.
LAMEncoder.forward (cyclomatic 21) src/lerobot/policies/lawam/lam_core/core/utils/lam_encoder.py:90— LAMEncoder.forward 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.
LingBotVAPolicy._infer (cyclomatic 21) src/lerobot/policies/lingbot_va/modeling_lingbot_va.py:817— LingBotVAPolicy._infer 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.
VLAJEPAPolicy._prepare_model_inputs (cyclomatic 21) src/lerobot/policies/vla_jepa/modeling_vla_jepa.py:442— VLAJEPAPolicy._prepare_model_inputs 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.
WallXTokenizerStep.__call__ (cyclomatic 21) src/lerobot/policies/wall_x/processor_wall_x.py:432— WallXTokenizerStep.__call__ has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
XVLAPolicy.validate_chunk_input_features (cyclomatic 21) src/lerobot/policies/xvla/modeling_xvla.py:295— XVLAPolicy.validate_chunk_input_features 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.
AddBatchDimensionComplementaryDataStep.complementary_data (cyclomatic 21) src/lerobot/processor/batch_processor.py:149— AddBatchDimensionComplementaryDataStep.complementary_data 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.
RenderTrainingMessagesStep.__call__ (cyclomatic 21) src/lerobot/processor/render_messages_processor.py:67— RenderTrainingMessagesStep.__call__ has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SARMRewardModel.calculate_rewards (cyclomatic 21) src/lerobot/rewards/sarm/modeling_sarm.py:491— SARMRewardModel.calculate_rewards has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
gym_manipulator.make_processors (cyclomatic 21) src/lerobot/rl/gym_manipulator.py:358— gym_manipulator.make_processors has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
dataset_tools._try_keep_episodes_from_video_by_stream_copy (cyclomatic 20) src/lerobot/datasets/dataset_tools.py:645— dataset_tools._try_keep_episodes_from_video_by_stream_copy 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.
dataset_tools.modify_tasks (cyclomatic 20) src/lerobot/datasets/dataset_tools.py:1576— dataset_tools.modify_tasks has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
depth_utils.dequantize_depth (cyclomatic 20) src/lerobot/datasets/depth_utils.py:154— depth_utils.dequantize_depth 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.
StreamingLeRobotDataset.__init__ (cyclomatic 20) src/lerobot/datasets/streaming_dataset.py:210— StreamingLeRobotDataset.__init__ has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ChunkRuntime.accept (cyclomatic 20) src/lerobot/inference/execution.py:434— ChunkRuntime.accept has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GrootPolicy._prepare_n1_7_rtc_inputs (cyclomatic 20) src/lerobot/policies/groot/modeling_groot.py:368— GrootPolicy._prepare_n1_7_rtc_inputs has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GrootN17PackInputsStep._convert_relative_action_groups_for_training (cyclomatic 20) src/lerobot/policies/groot/processor_groot.py:1607— GrootN17PackInputsStep._convert_relative_action_groups_for_training 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.
GrootN17PackInputsStep._normalize_action_groups_for_training (cyclomatic 20) src/lerobot/policies/groot/processor_groot.py:1666— GrootN17PackInputsStep._normalize_action_groups_for_training 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.
moe_loss.sequence_wise_balance_loss (cyclomatic 20) src/lerobot/policies/lingbot_vla_v2/model_core/moe_loss.py:19— moe_loss.sequence_wise_balance_loss 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.
checkpoint._expert_variant (cyclomatic 20) src/lerobot/policies/praxis/praxis_core/checkpoint.py:487— checkpoint._expert_variant has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Qwen2_5_VLMoEForAction.get_rope_index (cyclomatic 20) src/lerobot/policies/wall_x/modeling_wall_x.py:553— Qwen2_5_VLMoEForAction.get_rope_index 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.
deployment.load_deployment (cyclomatic 20) src/lerobot/remote_inference/deployment.py:117— deployment.load_deployment 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.
learner.add_actor_information_and_train (cyclomatic 20) src/lerobot/rl/learner.py:275— learner.add_actor_information_and_train 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.
DAggerStrategy._run_continuous (cyclomatic 20) src/lerobot/rollout/strategies/dagger.py:350— DAggerStrategy._run_continuous 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.
DAggerStrategy._run_corrections_only (cyclomatic 20) src/lerobot/rollout/strategies/dagger.py:539— DAggerStrategy._run_corrections_only 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.
foxglove_visualization._log_foxglove_image (cyclomatic 20) src/lerobot/utils/foxglove_visualization.py:195— foxglove_visualization._log_foxglove_image 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.
DM05ForCausalLM.inference_action (cyclomatic 19) src/lerobot/policies/dm05/core/modeling.py:1636— DM05ForCausalLM.inference_action 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.
DM05TokenizerProcessorStep.observation (cyclomatic 19) src/lerobot/policies/dm05/processor_dm05.py:177— DM05TokenizerProcessorStep.observation 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.
FastWAMConfig.validate_features (cyclomatic 19) src/lerobot/policies/fastwam/configuration_fastwam.py:433— FastWAMConfig.validate_features 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.
FineARTVLAPolicy.get_optim_params (cyclomatic 19) REDACTED:1493— FineARTVLAPolicy.get_optim_params 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.
FlowMatchingV2._align_losses (cyclomatic 19) src/lerobot/policies/lingbot_vla_v2/modeling_lingbot_vla_v2.py:718— FlowMatchingV2._align_losses 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.
MolmoAct2ImageProcessor.preprocess (cyclomatic 19) src/lerobot/policies/molmoact2/molmoact2_hf_model/image_processing_molmoact2.py:427— MolmoAct2ImageProcessor.preprocess has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
_FeatureNormalizer.from_stats (cyclomatic 19) src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:951— _FeatureNormalizer.from_stats 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.
PI05Policy._preprocess_images (cyclomatic 19) src/lerobot/policies/pi05/modeling_pi05.py:1362— PI05Policy._preprocess_images 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.
EpisodicStrategy.run (cyclomatic 19) src/lerobot/rollout/strategies/episodic.py:109— EpisodicStrategy.run 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.
mp4.fetch_mp4_index (cyclomatic 19) src/lerobot/streaming/mp4.py:242— mp4.fetch_mp4_index 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.
BatchedRandomAffine.__init__ (cyclomatic 19) src/lerobot/transforms/transforms.py:729— BatchedRandomAffine.__init__ 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.
ZenohTransport.query (cyclomatic 19) src/lerobot/transport/zenoh.py:379— ZenohTransport.query 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.
subtask_annotation.visualize_annotations (cyclomatic 18) src/lerobot/data_processing/sarm_annotations/subtask_annotation.py:654— subtask_annotation.visualize_annotations 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.
ConditionalFlowMatchingHead.forward (cyclomatic 18) src/lerobot/policies/lawam/vlas/flowmatching_expert.py:343— ConditionalFlowMatchingHead.forward has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PI0Policy.from_pretrained (cyclomatic 18) src/lerobot/policies/pi0/modeling_pi0.py:802— PI0Policy.from_pretrained has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PI0FastPolicy.from_pretrained (cyclomatic 18) src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:801— PI0FastPolicy.from_pretrained has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PraxisPolicy._push_observations (cyclomatic 18) src/lerobot/policies/praxis/modeling_praxis.py:1066— PraxisPolicy._push_observations 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.
SmolVLMWithExpertModel.forward (cyclomatic 18) src/lerobot/policies/smolvla/smolvlm_with_expert.py:414— SmolVLMWithExpertModel.forward 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.
Qwen2_5_VLMoEForAction.prepare_inputs_for_generation (cyclomatic 18) src/lerobot/policies/wall_x/modeling_wall_x.py:1493— Qwen2_5_VLMoEForAction.prepare_inputs_for_generation has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
codec._decode_record (cyclomatic 18) src/lerobot/transport/protocol/codec.py:226— codec._decode_record 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.
DatasetWriter.add_frame (cyclomatic 17) src/lerobot/datasets/dataset_writer.py:202— DatasetWriter.add_frame 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.
pyav_utils._check_option_value (cyclomatic 17) src/lerobot/datasets/pyav_utils.py:108— pyav_utils._check_option_value 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.
EO1VisionFlowMatchingModel.forward (cyclomatic 17) src/lerobot/policies/eo1/modeling_eo1.py:443— EO1VisionFlowMatchingModel.forward 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.
MolmoAct2Policy._compute_flow_matching_loss_joint_per_layer (cyclomatic 17) src/lerobot/policies/molmoact2/modeling_molmoact2.py:1309— MolmoAct2Policy._compute_flow_matching_loss_joint_per_layer has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
processor_molmoact2.make_molmoact2_pre_post_processors (cyclomatic 17) src/lerobot/policies/molmoact2/processor_molmoact2.py:1273— processor_molmoact2.make_molmoact2_pre_post_processors has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SessionWorker._validate_open (cyclomatic 17) src/lerobot/remote_inference/server.py:412— SessionWorker._validate_open has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
sarm_utils.find_stage_and_tau (cyclomatic 17) src/lerobot/rewards/sarm/sarm_utils.py:28— sarm_utils.find_stage_and_tau 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.
ReplayBuffer._lerobotdataset_to_transitions (cyclomatic 17) src/lerobot/rl/buffer.py:611— ReplayBuffer._lerobotdataset_to_transitions 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.
HighlightStrategy.run (cyclomatic 17) src/lerobot/rollout/strategies/highlight.py:94— HighlightStrategy.run 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.
InterjectionsAndSpeechModule._mid_episode_interjections (cyclomatic 16) src/lerobot/annotations/steerable_pipeline/modules/interjections_and_speech.py:99— InterjectionsAndSpeechModule._mid_episode_interjections 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.
PlanSubtasksMemoryModule.run_episode (cyclomatic 16) src/lerobot/annotations/steerable_pipeline/modules/plan_subtasks_memory.py:100— PlanSubtasksMemoryModule.run_episode 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.
Reachy2Camera.read (cyclomatic 16) src/lerobot/cameras/reachy2_camera/reachy2_camera.py:129— Reachy2Camera.read has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
VideoEncoderConfig.get_codec_options (cyclomatic 16) src/lerobot/configs/video.py:197— VideoEncoderConfig.get_codec_options 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.
subtask_annotation.save_annotations_to_dataset (cyclomatic 16) src/lerobot/data_processing/sarm_annotations/subtask_annotation.py:746— subtask_annotation.save_annotations_to_dataset 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.
dataset_tools.split_dataset (cyclomatic 16) src/lerobot/datasets/dataset_tools.py:180— dataset_tools.split_dataset 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.
factory.resolve_delta_timestamps (cyclomatic 16) src/lerobot/datasets/factory.py:39— factory.resolve_delta_timestamps 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.
factory.make_dataset (cyclomatic 16) src/lerobot/datasets/factory.py:108— factory.make_dataset 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.
pipeline_features.aggregate_pipeline_dataset_features (cyclomatic 16) src/lerobot/datasets/pipeline_features.py:71— pipeline_features.aggregate_pipeline_dataset_features 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.
RemoteInferenceConfig.__post_init__ (cyclomatic 16) src/lerobot/inference/factory.py:135— RemoteInferenceConfig.__post_init__ 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.
RangeFinderGUI.run (cyclomatic 16) src/lerobot/motors/calibration_gui.py:355— RangeFinderGUI.run 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.
DM05ForCausalLM.forward (cyclomatic 16) src/lerobot/policies/dm05/core/modeling.py:1448— DM05ForCausalLM.forward 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.
FastWAMConfig.__post_init__ (cyclomatic 16) src/lerobot/policies/fastwam/configuration_fastwam.py:288— FastWAMConfig.__post_init__ 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.
GrootN17PackInputsStep._ordered_image_keys (cyclomatic 16) src/lerobot/policies/groot/processor_groot.py:1524— GrootN17PackInputsStep._ordered_image_keys 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.
LaWAMPolicy.validate_chunk_input_features (cyclomatic 16) src/lerobot/policies/lawam/modeling_lawam.py:236— LaWAMPolicy.validate_chunk_input_features 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.
FlowMatchingV2.embed_prefix (cyclomatic 16) src/lerobot/policies/lingbot_vla_v2/modeling_lingbot_vla_v2.py:811— FlowMatchingV2.embed_prefix 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.
FlowMatchingV2.sample_actions (cyclomatic 16) src/lerobot/policies/lingbot_vla_v2/modeling_lingbot_vla_v2.py:1100— FlowMatchingV2.sample_actions 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.
PI05Policy.from_pretrained (cyclomatic 16) src/lerobot/policies/pi05/modeling_pi05.py:1102— PI05Policy.from_pretrained has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
PraxisConfig.validate_features (cyclomatic 16) src/lerobot/policies/praxis/configuration_praxis.py:265— PraxisConfig.validate_features 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.
ActionExpert.forward_trunk_rope (cyclomatic 16) src/lerobot/policies/praxis/praxis_core/action_expert.py:735— ActionExpert.forward_trunk_rope 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.
SingleArmServeSession.prepare (cyclomatic 16) src/lerobot/policies/praxis/praxis_core/single_arm.py:628— SingleArmServeSession.prepare 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.
XVLAModel._apply_freezing (cyclomatic 16) src/lerobot/policies/xvla/modeling_xvla.py:123— XVLAModel._apply_freezing 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.
ReplayBuffer.to_lerobot_dataset (cyclomatic 16) src/lerobot/rl/buffer.py:505— ReplayBuffer.to_lerobot_dataset 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.
UnitreeG1.disconnect (cyclomatic 16) src/lerobot/robots/unitree_g1/unitree_g1.py:477— UnitreeG1.disconnect 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.
DAggerStrategy._apply_transition (cyclomatic 16) src/lerobot/rollout/strategies/dagger.py:717— DAggerStrategy._apply_transition 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.
foxglove_visualization.log_foxglove_data (cyclomatic 16) src/lerobot/utils/foxglove_visualization.py:386— foxglove_visualization.log_foxglove_data 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.
lerobot_train.train (cognitive 165) src/lerobot/scripts/lerobot_train.py:529— lerobot_train.train has cognitive complexity 165 (threshold 15). Drivers by points: if/else 68 (127 pts), boolean chains 20, ternaries 5 (10 pts), loops 3 (8 pts) (nesting depth added 69). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
subtask_annotation.main (cognitive 96) src/lerobot/data_processing/sarm_annotations/subtask_annotation.py:953— subtask_annotation.main has cognitive complexity 96 (threshold 15). Drivers by points: if/else 22 (47 pts), ternaries 12 (22 pts), boolean chains 12, loops 3 (9 pts), error handling 2 (6 pts) (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.
lerobot_eval.rollout (cognitive 92) src/lerobot/scripts/lerobot_eval.py:174— lerobot_eval.rollout has cognitive complexity 92 (threshold 15). Drivers by points: if/else 26 (50 pts), loops 6 (14 pts), ternaries 5 (14 pts), boolean chains 7, error handling 3 (7 pts) (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EO1PrepareModelMessagesStep.complementary_data (cognitive 90) src/lerobot/policies/eo1/processor_eo1.py:91— EO1PrepareModelMessagesStep.complementary_data has cognitive complexity 90 (threshold 15). Drivers by points: if/else 18 (55 pts), ternaries 5 (18 pts), loops 3 (9 pts), boolean chains 8 (nesting depth added 56). 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.
Qwen2_5_VLMoEForAction.predict (cognitive 86) src/lerobot/policies/wall_x/modeling_wall_x.py:1053— Qwen2_5_VLMoEForAction.predict has cognitive complexity 86 (threshold 15). Drivers by points: if/else 37 (68 pts), boolean chains 8, ternaries 5 (8 pts), loops 1 (2 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
utils.preprocesser_call (cognitive 81) src/lerobot/policies/wall_x/utils.py:57— utils.preprocesser_call has cognitive complexity 81 (threshold 15). Drivers by points: if/else 22 (42 pts), loops 11 (30 pts), ternaries 2 (8 pts), boolean chains 1 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
compute_rabc_weights.compute_sarm_progress (cognitive 81) src/lerobot/rewards/sarm/compute_rabc_weights.py:466— compute_rabc_weights.compute_sarm_progress has cognitive complexity 81 (threshold 15). Drivers by points: if/else 25 (54 pts), ternaries 5 (13 pts), loops 4 (6 pts), boolean chains 5, error handling 1 (3 pts) (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lerobot_train.make_dataloaders (cognitive 79) src/lerobot/scripts/lerobot_train.py:325— lerobot_train.make_dataloaders has cognitive complexity 79 (threshold 15). Drivers by points: if/else 19 (44 pts), ternaries 13 (18 pts), boolean chains 14, loops 1 (3 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RTCInferenceEngine._rtc_loop (cognitive 73) src/lerobot/inference/rtc.py:507— RTCInferenceEngine._rtc_loop has cognitive complexity 73 (threshold 15). Drivers by points: if/else 22 (54 pts), boolean chains 9, ternaries 3 (6 pts), loops 2 (3 pts), error handling 1 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteInferenceEngine._loop (cognitive 73) src/lerobot/remote_inference/engine.py:676— RemoteInferenceEngine._loop has cognitive complexity 73 (threshold 15). Drivers by points: if/else 22 (51 pts), error handling 6 (10 pts), boolean chains 7, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lerobot_eval.eval_policy (cognitive 73) src/lerobot/scripts/lerobot_eval.py:464— lerobot_eval.eval_policy has cognitive complexity 73 (threshold 15). Drivers by points: if/else 28 (53 pts), ternaries 4 (9 pts), loops 4 (6 pts), boolean chains 5 (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.
compute_rabc_weights.visualize_sarm_predictions (cognitive 71) src/lerobot/rewards/sarm/compute_rabc_weights.py:214— compute_rabc_weights.visualize_sarm_predictions has cognitive complexity 71 (threshold 15). Drivers by points: if/else 16 (38 pts), loops 9 (21 pts), ternaries 3 (8 pts), boolean chains 4 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Qwen2_5_VLMoEForAction.train_step_forward (cognitive 70) src/lerobot/policies/wall_x/modeling_wall_x.py:743— Qwen2_5_VLMoEForAction.train_step_forward has cognitive complexity 70 (threshold 15). Drivers by points: if/else 26 (54 pts), ternaries 7 (11 pts), boolean chains 5 (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.
exo_calib.run_exo_calibration (cognitive 69) src/lerobot/teleoperators/unitree_g1/exo_calib.py:150— exo_calib.run_exo_calibration has cognitive complexity 69 (threshold 15). Drivers by points: if/else 19 (49 pts), ternaries 3 (12 pts), boolean chains 6, error handling 1, loops 1 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SessionWorker.submit (cognitive 68) src/lerobot/remote_inference/server.py:268— SessionWorker.submit has cognitive complexity 68 (threshold 15). Drivers by points: if/else 26 (57 pts), ternaries 3 (6 pts), boolean chains 4, error handling 1 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GrootN17PackInputsStep.__call__ (cognitive 66) src/lerobot/policies/groot/processor_groot.py:1751— GrootN17PackInputsStep.__call__ has cognitive complexity 66 (threshold 15). Drivers by points: if/else 29 (56 pts), boolean chains 8, loops 1 (2 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VectorQuantize.forward (cognitive 66) src/lerobot/policies/vqbet/vqbet_utils.py:695— VectorQuantize.forward has cognitive complexity 66 (threshold 15). Drivers by points: if/else 33 (57 pts), boolean chains 5, ternaries 2 (4 pts) (nesting depth added 26). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
SessionWorker._run (cognitive 66) src/lerobot/remote_inference/server.py:635— SessionWorker._run has cognitive complexity 66 (threshold 15). Drivers by points: if/else 18 (44 pts), ternaries 4 (11 pts), boolean chains 6, error handling 2 (4 pts), loops 1 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lerobot_dataset_viz.visualize_dataset (cognitive 64) src/lerobot/scripts/lerobot_dataset_viz.py:168— lerobot_dataset_viz.visualize_dataset has cognitive complexity 64 (threshold 15). Drivers by points: if/else 16 (36 pts), ternaries 6 (14 pts), loops 5 (9 pts), boolean chains 3, error handling 1 (2 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.
migrate_policy_normalization.detect_features_and_norm_modes (cognitive 62) src/lerobot/processor/migrate_policy_normalization.py:126— migrate_policy_normalization.detect_features_and_norm_modes has cognitive complexity 62 (threshold 15). Drivers by points: if/else 19 (40 pts), loops 4 (8 pts), error handling 2 (6 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 31). 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.
Qwen2_5_VLMoEForAction.get_rope_index (cognitive 61) src/lerobot/policies/wall_x/modeling_wall_x.py:553— Qwen2_5_VLMoEForAction.get_rope_index has cognitive complexity 61 (threshold 15). Drivers by points: if/else 17 (44 pts), ternaries 2 (8 pts), loops 2 (5 pts), boolean chains 4 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dataset_tools._copy_and_reindex_episodes_metadata (cognitive 60) src/lerobot/datasets/dataset_tools.py:992— dataset_tools._copy_and_reindex_episodes_metadata has cognitive complexity 60 (threshold 15). Drivers by points: if/else 10 (35 pts), loops 4 (20 pts), boolean chains 4, ternaries 1 (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.
factory.make_policy (cognitive 58) src/lerobot/policies/factory.py:256— factory.make_policy has cognitive complexity 58 (threshold 15). Drivers by points: if/else 31 (45 pts), boolean chains 9, ternaries 2 (4 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.
SessionWorker._validate_data (cognitive 58) src/lerobot/remote_inference/server.py:449— SessionWorker._validate_data has cognitive complexity 58 (threshold 15). Drivers by points: if/else 20 (34 pts), boolean chains 16, loops 2 (3 pts), ternaries 1 (3 pts), error handling 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DatasetWriter.save_episode (cognitive 56) src/lerobot/datasets/dataset_writer.py:271— DatasetWriter.save_episode has cognitive complexity 56 (threshold 15). Drivers by points: if/else 14 (23 pts), loops 5 (12 pts), ternaries 5 (12 pts), boolean chains 5, error handling 1 (4 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
flow_matching.euler_integrate (cognitive 56) src/lerobot/policies/common/flow_matching.py:256— flow_matching.euler_integrate has cognitive complexity 56 (threshold 15). Drivers by points: if/else 16 (29 pts), ternaries 9 (19 pts), boolean chains 7, loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GrootN17ActionDecodeStep.__call__ (cognitive 53) src/lerobot/policies/groot/processor_groot.py:2293— GrootN17ActionDecodeStep.__call__ has cognitive complexity 53 (threshold 15). Drivers by points: if/else 22 (35 pts), boolean chains 11, ternaries 2 (4 pts), loops 2 (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.
HighlightStrategy.run (cognitive 51) src/lerobot/rollout/strategies/highlight.py:94— HighlightStrategy.run has cognitive complexity 51 (threshold 15). Drivers by points: if/else 15 (43 pts), loops 2 (7 pts), boolean chains 1 (nesting depth added 33). 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.
DatasetConfig.__post_init__ (cognitive 49) REDACTED:85— DatasetConfig.__post_init__ has cognitive complexity 49 (threshold 15). Drivers by points: if/else 28 (42 pts), boolean chains 7 (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.
MolmoAct2ForConditionalGeneration.predict_action (cognitive 49) src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:4316— MolmoAct2ForConditionalGeneration.predict_action has cognitive complexity 49 (threshold 15). Drivers by points: if/else 30 (40 pts), boolean chains 8, ternaries 1 (nesting depth added 10). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
check_docstrings.match_docstring_with_signature (cognitive 48) utils/check_docstrings.py:298— check_docstrings.match_docstring_with_signature has cognitive complexity 48 (threshold 15). Drivers by points: if/else 18 (33 pts), boolean chains 7, loops 5 (6 pts), error handling 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.
FineARTVLAPolicy.forward (cognitive 47) REDACTED:776— FineARTVLAPolicy.forward has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 10 (22 pts), if/else 11 (18 pts), boolean chains 7 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
context.build_rollout_context (cognitive 47) src/lerobot/rollout/context.py:478— context.build_rollout_context has cognitive complexity 47 (threshold 15). Drivers by points: if/else 21 (27 pts), boolean chains 10, ternaries 5 (6 pts), error handling 2 (4 pts) (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
moe_loss.sequence_wise_balance_loss (cognitive 46) src/lerobot/policies/lingbot_vla_v2/model_core/moe_loss.py:19— moe_loss.sequence_wise_balance_loss has cognitive complexity 46 (threshold 15). Drivers by points: if/else 17 (33 pts), ternaries 2 (7 pts), loops 2 (4 pts), boolean chains 2 (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.
MolmoAct2ForConditionalGeneration._generate_depth_prefix (cognitive 45) src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:4074— MolmoAct2ForConditionalGeneration._generate_depth_prefix has cognitive complexity 45 (threshold 15). Drivers by points: if/else 19 (28 pts), loops 5 (11 pts), boolean chains 6 (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.
gym_manipulator.control_loop (cognitive 44) src/lerobot/rl/gym_manipulator.py:613— gym_manipulator.control_loop has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (36 pts), boolean chains 4, loops 2 (3 pts), ternaries 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.
lerobot_train_tokenizer.train_tokenizer (cognitive 44) src/lerobot/scripts/lerobot_train_tokenizer.py:383— lerobot_train_tokenizer.train_tokenizer has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (24 pts), loops 5 (10 pts), error handling 3 (6 pts), boolean chains 4 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LeRobotDataset.__init__ (cognitive 42) src/lerobot/datasets/lerobot_dataset.py:53— LeRobotDataset.__init__ has cognitive complexity 42 (threshold 15). Drivers by points: if/else 20 (27 pts), boolean chains 11, ternaries 4 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
StreamingLeRobotDataset._iter_once (cognitive 42) src/lerobot/datasets/streaming_dataset.py:494— StreamingLeRobotDataset._iter_once has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (21 pts), error handling 3 (8 pts), loops 4 (6 pts), ternaries 4, boolean chains 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MolmoAct2TextModel.forward (cognitive 42) src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:2526— MolmoAct2TextModel.forward has cognitive complexity 42 (threshold 15). Drivers by points: if/else 19 (24 pts), ternaries 9 (12 pts), boolean chains 5, loops 1 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
processor_groot.make_groot_pre_post_processors (cognitive 41) src/lerobot/policies/groot/processor_groot.py:1088— processor_groot.make_groot_pre_post_processors has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 16, if/else 11 (13 pts), boolean chains 11, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
migrate_policy_normalization.main (cognitive 41) src/lerobot/processor/migrate_policy_normalization.py:473— migrate_policy_normalization.main has cognitive complexity 41 (threshold 15). Drivers by points: if/else 26 (34 pts), boolean chains 4, ternaries 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.
DAggerStrategy._run_continuous (cognitive 41) src/lerobot/rollout/strategies/dagger.py:350— DAggerStrategy._run_continuous has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (36 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codec._encode_value (cognitive 41) src/lerobot/transport/protocol/codec.py:147— codec._encode_value has cognitive complexity 41 (threshold 15). Drivers by points: if/else 22 (34 pts), boolean chains 5, ternaries 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.
fit_fast_tokenizer.fit_fast_tokenizer (cognitive 40) REDACTED:222— fit_fast_tokenizer.fit_fast_tokenizer has cognitive complexity 40 (threshold 15). Drivers by points: if/else 22 (31 pts), loops 3 (5 pts), error handling 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Tracker.track (cognitive 40) src/lerobot/policies/rtc/debug_tracker.py:126— Tracker.track has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (25 pts), ternaries 7 (13 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SARMEncodingProcessorStep.__call__ (cognitive 40) src/lerobot/rewards/sarm/processor_sarm.py:275— SARMEncodingProcessorStep.__call__ has cognitive complexity 40 (threshold 15). Drivers by points: if/else 21 (29 pts), boolean chains 5, loops 3 (4 pts), ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lerobot_record.record (cognitive 40) src/lerobot/scripts/lerobot_record.py:394— lerobot_record.record has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 10, ternaries 5 (8 pts), loops 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
dataset_tools.recompute_stats (cognitive 39) src/lerobot/datasets/dataset_tools.py:1729— dataset_tools.recompute_stats has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (26 pts), loops 4 (8 pts), boolean chains 4, ternaries 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.
WanVideoDiT._validate_forward_inputs (cognitive 39) src/lerobot/policies/fastwam/wan/video_dit.py:646— WanVideoDiT._validate_forward_inputs has cognitive complexity 39 (threshold 15). Drivers by points: if/else 20 (35 pts), boolean chains 4 (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.
ConditionalFlowMatchingHead.sample_actions_cfg (cognitive 39) src/lerobot/policies/lawam/vlas/flowmatching_expert.py:536— ConditionalFlowMatchingHead.sample_actions_cfg has cognitive complexity 39 (threshold 15). Drivers by points: if/else 23 (32 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MultiTaskDiTConfig._validate (cognitive 39) src/lerobot/policies/multi_task_dit/configuration_multi_task_dit.py:125— MultiTaskDiTConfig._validate has cognitive complexity 39 (threshold 15). Drivers by points: if/else 22 (37 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WallOSS05TokenizerStep.__call__ (cognitive 39) src/lerobot/policies/wall_oss_05/processor_wall_oss_05.py:242— WallOSS05TokenizerStep.__call__ has cognitive complexity 39 (threshold 15). Drivers by points: loops 8 (14 pts), if/else 10 (13 pts), boolean chains 7, ternaries 3 (5 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.
RolloutConfig.__post_init__ (cognitive 39) src/lerobot/rollout/configs.py:358— RolloutConfig.__post_init__ has cognitive complexity 39 (threshold 15). Drivers by points: if/else 21 (23 pts), boolean chains 16 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
lerobot_record.record_loop (cognitive 39) src/lerobot/scripts/lerobot_record.py:232— lerobot_record.record_loop has cognitive complexity 39 (threshold 15). Drivers by points: if/else 17 (31 pts), boolean chains 4, ternaries 1 (3 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.
utils.preprocess_observation (cognitive 38) src/lerobot/envs/utils.py:52— utils.preprocess_observation has cognitive complexity 38 (threshold 15). Drivers by points: if/else 18 (34 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LingBotVAPolicy._infer (cognitive 38) src/lerobot/policies/lingbot_va/modeling_lingbot_va.py:817— LingBotVAPolicy._infer has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (21 pts), ternaries 5 (11 pts), boolean chains 4, loops 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.
FlowMatchingV2._align_losses (cognitive 38) src/lerobot/policies/lingbot_vla_v2/modeling_lingbot_vla_v2.py:718— FlowMatchingV2._align_losses has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 9 (22 pts), if/else 7 (14 pts), boolean chains 2 (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.
DAggerStrategy._run_corrections_only (cognitive 38) src/lerobot/rollout/strategies/dagger.py:539— DAggerStrategy._run_corrections_only has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (33 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
subtask_annotation.save_annotations_to_dataset (cognitive 37) src/lerobot/data_processing/sarm_annotations/subtask_annotation.py:746— subtask_annotation.save_annotations_to_dataset has cognitive complexity 37 (threshold 15). Drivers by points: loops 7 (17 pts), if/else 6 (16 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PolicyRunner.__init__ (cognitive 37) src/lerobot/inference/policy_runner.py:60— PolicyRunner.__init__ has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18 (26 pts), boolean chains 8, error handling 1 (2 pts), ternaries 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.
SmolVLMWithExpertModel.forward (cognitive 37) src/lerobot/policies/smolvla/smolvlm_with_expert.py:414— SmolVLMWithExpertModel.forward has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (22 pts), ternaries 2 (7 pts), loops 4 (5 pts), boolean chains 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dataset_tools.modify_features (cognitive 36) src/lerobot/datasets/dataset_tools.py:330— dataset_tools.modify_features has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (21 pts), loops 4 (8 pts), ternaries 4 (6 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.
_CameraEncoderThread.run (cognitive 36) src/lerobot/datasets/video_utils.py:831— _CameraEncoderThread.run has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (28 pts), boolean chains 4, error handling 2 (3 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PI05Policy._preprocess_images (cognitive 36) src/lerobot/policies/pi05/modeling_pi05.py:1362— PI05Policy._preprocess_images has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (20 pts), ternaries 5 (13 pts), loops 2, 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.
ReplayBuffer._lerobotdataset_to_transitions (cognitive 36) src/lerobot/rl/buffer.py:611— ReplayBuffer._lerobotdataset_to_transitions has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 4 (10 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EpisodicStrategy.run (cognitive 36) src/lerobot/rollout/strategies/episodic.py:109— EpisodicStrategy.run has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (28 pts), boolean chains 6, loops 1, ternaries 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Evo1Config.__post_init__ (cognitive 35) src/lerobot/policies/evo1/configuration_evo1.py:117— Evo1Config.__post_init__ has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (26 pts), boolean chains 4, ternaries 1 (3 pts), loops 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.
FastWAM.build_inputs (cognitive 35) src/lerobot/policies/fastwam/wan/modular.py:1355— FastWAM.build_inputs has cognitive complexity 35 (threshold 15). Drivers by points: if/else 23 (30 pts), boolean chains 5 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
FineARTVLAPolicy.select_message (cognitive 35) REDACTED:1317— FineARTVLAPolicy.select_message has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (23 pts), loops 3 (5 pts), boolean chains 4, ternaries 1 (2 pts), error handling 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.
TrainPipelineConfig.validate (cognitive 34) src/lerobot/configs/train.py:285— TrainPipelineConfig.validate has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 15 (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.
subtask_annotation.visualize_annotations (cognitive 34) src/lerobot/data_processing/sarm_annotations/subtask_annotation.py:654— subtask_annotation.visualize_annotations has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (21 pts), ternaries 3 (7 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RangeFinderGUI.run (cognitive 34) src/lerobot/motors/calibration_gui.py:355— RangeFinderGUI.run has cognitive complexity 34 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 7 (14 pts), ternaries 1 (3 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.
sidecar_utils._read_metadata (cognitive 34) src/lerobot/streaming/sidecar_utils.py:178— sidecar_utils._read_metadata has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 11, error handling 1 (3 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.
dataset_tools._copy_data_with_feature_changes (cognitive 33) src/lerobot/datasets/dataset_tools.py:1145— dataset_tools._copy_data_with_feature_changes has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 3 (9 pts), boolean chains 2 (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.
GrootN17PackInputsStep._convert_relative_action_groups_for_training (cognitive 33) src/lerobot/policies/groot/processor_groot.py:1607— GrootN17PackInputsStep._convert_relative_action_groups_for_training has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 4, ternaries 2 (4 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
processor_groot._build_n1_7_relative_action_processor_assets (cognitive 33) src/lerobot/policies/groot/processor_groot.py:952— processor_groot._build_n1_7_relative_action_processor_assets has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 15, boolean chains 9, if/else 8, error handling 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.
utils.flatten_n1_7_modality_stats (cognitive 33) src/lerobot/policies/groot/utils.py:127— utils.flatten_n1_7_modality_stats has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 5, loops 2 (3 pts), ternaries 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.
dataset_tools.convert_image_to_video_dataset (cognitive 32) src/lerobot/datasets/dataset_tools.py:1838— dataset_tools.convert_image_to_video_dataset has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (18 pts), loops 6 (9 pts), ternaries 3 (5 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
_NormalizationMixin._apply_transform (cognitive 32) src/lerobot/processor/normalize_processor.py:305— _NormalizationMixin._apply_transform has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (25 pts), boolean chains 7 (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.
dataset_tools._copy_and_reindex_videos (cognitive 31) src/lerobot/datasets/dataset_tools.py:862— dataset_tools._copy_and_reindex_videos has cognitive complexity 31 (threshold 15). Drivers by points: loops 6 (17 pts), if/else 6 (13 pts), boolean chains 1 (nesting depth added 18). 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.
depth_utils.dequantize_depth (cognitive 31) src/lerobot/datasets/depth_utils.py:154— depth_utils.dequantize_depth has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (18 pts), ternaries 6 (13 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.
PI0Policy.from_pretrained (cognitive 31) src/lerobot/policies/pi0/modeling_pi0.py:802— PI0Policy.from_pretrained has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (15 pts), loops 5 (13 pts), error handling 2, boolean chains 1 (nesting depth added 11). 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.
PI0FastPolicy.from_pretrained (cognitive 31) src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:801— PI0FastPolicy.from_pretrained has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (15 pts), loops 5 (13 pts), error handling 2, boolean chains 1 (nesting depth added 11). 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.
VLAJEPAPolicy._prepare_model_inputs (cognitive 31) src/lerobot/policies/vla_jepa/modeling_vla_jepa.py:442— VLAJEPAPolicy._prepare_model_inputs has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (17 pts), ternaries 5 (9 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
deployment.load_deployment (cognitive 31) src/lerobot/remote_inference/deployment.py:117— deployment.load_deployment has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (15 pts), ternaries 3 (9 pts), boolean chains 4, 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.
ReplayBuffer.to_lerobot_dataset (cognitive 31) src/lerobot/rl/buffer.py:505— ReplayBuffer.to_lerobot_dataset has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 5 (9 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mp4.fetch_mp4_index (cognitive 31) src/lerobot/streaming/mp4.py:242— mp4.fetch_mp4_index has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 7, ternaries 2 (4 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
foxglove_visualization._log_foxglove_image (cognitive 31) src/lerobot/utils/foxglove_visualization.py:195— foxglove_visualization._log_foxglove_image has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 6 (11 pts), boolean chains 4 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
foxglove_visualization.log_foxglove_data (cognitive 31) src/lerobot/utils/foxglove_visualization.py:386— foxglove_visualization.log_foxglove_data has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (21 pts), ternaries 2 (6 pts), loops 2 (4 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MolmoAct2Config.__post_init__ (cognitive 30) src/lerobot/policies/molmoact2/configuration_molmoact2.py:399— MolmoAct2Config.__post_init__ has cognitive complexity 30 (threshold 15). Drivers by points: if/else 22, 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.
sarm_utils.find_stage_and_tau (cognitive 30) src/lerobot/rewards/sarm/sarm_utils.py:28— sarm_utils.find_stage_and_tau has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 2 (9 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
learner.add_actor_information_and_train (cognitive 30) src/lerobot/rl/learner.py:275— learner.add_actor_information_and_train has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 4, ternaries 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_YamMotorsBus._wait_for_fresh_states (cognitive 30) src/lerobot/robots/yam_follower/yam_follower.py:261— _YamMotorsBus._wait_for_fresh_states has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 3 (4 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rerun_visualization.log_rerun_data (cognitive 30) src/lerobot/utils/rerun_visualization.py:223— rerun_visualization.log_rerun_data has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (20 pts), ternaries 2 (6 pts), loops 2 (4 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
factory.make_dataset (cognitive 29) src/lerobot/datasets/factory.py:108— factory.make_dataset has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 2 (5 pts), boolean chains 4, ternaries 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LanceDatasetReader._prepare_files (cognitive 29) src/lerobot/datasets/lance_backend.py:689— LanceDatasetReader._prepare_files has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 6 (10 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
prediction.predict_chunk (cognitive 29) src/lerobot/inference/prediction.py:110— prediction.predict_chunk has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 9, ternaries 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RTCInferenceEngine.__init__ (cognitive 29) src/lerobot/inference/rtc.py:114— RTCInferenceEngine.__init__ has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 4, ternaries 4 (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.
DM05Policy._prepare_model_inputs (cognitive 29) src/lerobot/policies/dm05/modeling_dm05.py:394— DM05Policy._prepare_model_inputs has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (18 pts), ternaries 4 (7 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
GrootN17PackInputsStep._normalize_action_groups_for_training (cognitive 29) src/lerobot/policies/groot/processor_groot.py:1666— GrootN17PackInputsStep._normalize_action_groups_for_training has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (18 pts), ternaries 3 (6 pts), boolean chains 4, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
XVLAPolicy.validate_chunk_input_features (cognitive 29) src/lerobot/policies/xvla/modeling_xvla.py:295— XVLAPolicy.validate_chunk_input_features has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 8, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lerobot_train_tokenizer.process_episode (cognitive 29) src/lerobot/scripts/lerobot_train_tokenizer.py:191— lerobot_train_tokenizer.process_episode has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (15 pts), ternaries 3 (8 pts), loops 3 (5 pts), error handling 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.
DatasetWriter.add_frame (cognitive 28) src/lerobot/datasets/dataset_writer.py:202— DatasetWriter.add_frame has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 3 (4 pts), ternaries 1 (3 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.
ActionDiT.pre_dit (cognitive 28) src/lerobot/policies/fastwam/wan/modular.py:142— ActionDiT.pre_dit has cognitive complexity 28 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 4 (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.
MoT.__init__ (cognitive 28) src/lerobot/policies/fastwam/wan/modular.py:710— MoT.__init__ has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 3, loops 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FineARTVLAConfig.__post_init__ (cognitive 28) src/lerobot/policies/fineart_vla/configuration_fineart_vla.py:166— FineARTVLAConfig.__post_init__ has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 10 (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.
FlowMatchingV2._init_align (cognitive 28) src/lerobot/policies/lingbot_vla_v2/modeling_lingbot_vla_v2.py:601— FlowMatchingV2._init_align has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 7 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
VanillaObservationProcessorStep.transform_features (cognitive 28) src/lerobot/processor/observation_processor.py:131— VanillaObservationProcessorStep.transform_features has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (18 pts), loops 4 (9 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.
ServerConfig.__post_init__ (cognitive 28) src/lerobot/remote_inference/configs.py:85— ServerConfig.__post_init__ has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 9, loops 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
SessionWorker._execute (cognitive 28) src/lerobot/remote_inference/server.py:530— SessionWorker._execute has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 8 (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.
UnitreeG1.disconnect (cognitive 28) src/lerobot/robots/unitree_g1/unitree_g1.py:477— UnitreeG1.disconnect has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
augment_dataset_quantile_stats.collect_episode_arrays (cognitive 28) src/lerobot/scripts/augment_dataset_quantile_stats.py:84— augment_dataset_quantile_stats.collect_episode_arrays has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 4 (8 pts), ternaries 2 (5 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.
dataset_tools._try_keep_episodes_from_video_by_stream_copy (cognitive 27) src/lerobot/datasets/dataset_tools.py:645— dataset_tools._try_keep_episodes_from_video_by_stream_copy has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 6 (7 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
video_utils.reencode_video (cognitive 27) src/lerobot/datasets/video_utils.py:587— video_utils.reencode_video has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 8, error handling 2, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LaWAMConfig.validate_features (cognitive 27) src/lerobot/policies/lawam/configuration_lawam.py:192— LaWAMConfig.validate_features has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 6, ternaries 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
LAMEncoder.forward (cognitive 27) src/lerobot/policies/lawam/lam_core/core/utils/lam_encoder.py:90— LAMEncoder.forward has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_FeatureNormalizer.from_stats (cognitive 27) src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:951— _FeatureNormalizer.from_stats has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 4 (7 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MolmoAct2PackInputsProcessorStep.__call__ (cognitive 27) src/lerobot/policies/molmoact2/processor_molmoact2.py:938— MolmoAct2PackInputsProcessorStep.__call__ has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 5, ternaries 2, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
PI05Policy.from_pretrained (cognitive 27) src/lerobot/policies/pi05/modeling_pi05.py:1102— PI05Policy.from_pretrained has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (12 pts), loops 4 (12 pts), error handling 2, boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PraxisPolicy._push_observations (cognitive 27) src/lerobot/policies/praxis/modeling_praxis.py:1066— PraxisPolicy._push_observations has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 3 (7 pts), loops 4 (5 pts), boolean chains 4 (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.
SARMRewardModel.calculate_rewards (cognitive 27) src/lerobot/rewards/sarm/modeling_sarm.py:491— SARMRewardModel.calculate_rewards has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16 (19 pts), ternaries 7 (8 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
lerobot_eval._build_raw_frame (cognitive 27) src/lerobot/scripts/lerobot_eval.py:130— lerobot_eval._build_raw_frame has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check_config_docstrings.check_config_docstrings (cognitive 27) utils/check_config_docstrings.py:98— check_config_docstrings.check_config_docstrings has cognitive complexity 27 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 3 (6 pts), boolean chains 5, error handling 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LanceDatasetReader._fetch_rows (cognitive 26) src/lerobot/datasets/lance_backend.py:524— LanceDatasetReader._fetch_rows has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (8 pts), ternaries 1 (6 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.
XVLAModel._apply_freezing (cognitive 26) src/lerobot/policies/xvla/modeling_xvla.py:123— XVLAModel._apply_freezing has cognitive complexity 26 (threshold 15). Drivers by points: loops 5 (12 pts), if/else 7 (11 pts), boolean chains 3 (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
AddBatchDimensionComplementaryDataStep.complementary_data (cognitive 26) src/lerobot/processor/batch_processor.py:149— AddBatchDimensionComplementaryDataStep.complementary_data has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 8 (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.
RemoteClient.admit (cognitive 26) src/lerobot/remote_inference/client.py:228— RemoteClient.admit has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 5, error handling 2, ternaries 2, 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.
Reachy2Robot.send_action (cognitive 26) src/lerobot/robots/reachy2/robot_reachy2.py:194— Reachy2Robot.send_action has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lerobot_find_cameras.find_and_print_cameras (cognitive 26) src/lerobot/scripts/lerobot_find_cameras.py:89— lerobot_find_cameras.find_and_print_cameras has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 3 (10 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lerobot_train.update_policy (cognitive 26) src/lerobot/scripts/lerobot_train.py:181— lerobot_train.update_policy has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 6, loops 1 (2 pts), ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
processor_fineart_vla._vqa_answer_to_loc (cognitive 25) src/lerobot/policies/fineart_vla/processor_fineart_vla.py:180— processor_fineart_vla._vqa_answer_to_loc has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 2 (5 pts), boolean chains 3, loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
processor_groot._apply_groot_step_overrides (cognitive 25) src/lerobot/policies/groot/processor_groot.py:401— processor_groot._apply_groot_step_overrides has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 3 (6 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.
LingbotVLAV2Config.__post_init__ (cognitive 25) src/lerobot/policies/lingbot_vla_v2/configuration_lingbot_vla_v2.py:231— LingbotVLAV2Config.__post_init__ has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 4 (10 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.
PraxisConfig.__post_init__ (cognitive 25) src/lerobot/policies/praxis/configuration_praxis.py:182— PraxisConfig.__post_init__ has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 3, loops 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
SmolVLMWithExpertModel.set_requires_grad (cognitive 25) src/lerobot/policies/smolvla/smolvlm_with_expert.py:152— SmolVLMWithExpertModel.set_requires_grad has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 5 (9 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.
actor.act_with_policy (cognitive 25) src/lerobot/rl/actor.py:230— actor.act_with_policy has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
utils.canonical_observation (cognitive 25) src/lerobot/sim/integrations/utils.py:28— utils.canonical_observation has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 3 (8 pts), loops 3 (4 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.
feature_utils.combine_feature_dicts (cognitive 25) src/lerobot/utils/feature_utils.py:186— feature_utils.combine_feature_dicts has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vlm_client._to_openai_messages (cognitive 24) REDACTED:579— vlm_client._to_openai_messages has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (7 pts), ternaries 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
aggregate.update_meta_data (cognitive 24) src/lerobot/datasets/aggregate.py:186— aggregate.update_meta_data has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 6 (12 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.
pipeline_features.aggregate_pipeline_dataset_features (cognitive 24) src/lerobot/datasets/pipeline_features.py:71— pipeline_features.aggregate_pipeline_dataset_features has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 6, loops 2 (3 pts), ternaries 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.
DamiaoMotorsBus.record_ranges_of_motion (cognitive 24) src/lerobot/motors/damiao/damiao.py:759— DamiaoMotorsBus.record_ranges_of_motion has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 4 (7 pts), boolean chains 2 (nesting depth added 12). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
RobstrideMotorsBus.record_ranges_of_motion (cognitive 24) src/lerobot/motors/robstride/robstride.py:962— RobstrideMotorsBus.record_ranges_of_motion has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 4 (7 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.
EO1VisionFlowMatchingModel.forward (cognitive 24) src/lerobot/policies/eo1/modeling_eo1.py:443— EO1VisionFlowMatchingModel.forward has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 2, ternaries 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.
PiGemmaModel.forward (cognitive 24) src/lerobot/policies/pi_gemma.py:228— PiGemmaModel.forward has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 7 (8 pts), boolean chains 3, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
PraxisModel.sample_window_joint (cognitive 24) src/lerobot/policies/praxis/praxis_core/model.py:180— PraxisModel.sample_window_joint has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (4 pts), ternaries 3, boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gym_manipulator.make_processors (cognitive 24) src/lerobot/rl/gym_manipulator.py:358— gym_manipulator.make_processors has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 5, ternaries 3 (4 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
EarthRoverMiniPlus._get_camera_frames (cognitive 24) src/lerobot/robots/earthrover_mini_plus/robot_earthrover_mini_plus.py:387— EarthRoverMiniPlus._get_camera_frames has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 2, error handling 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LanguageColumnsWriter._rewrite_one (cognitive 23) src/lerobot/annotations/steerable_pipeline/writer.py:208— LanguageColumnsWriter._rewrite_one has cognitive complexity 23 (threshold 15). Drivers by points: loops 8 (14 pts), if/else 3 (6 pts), ternaries 2, boolean chains 1 (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
RealSenseCamera._read_loop (cognitive 23) src/lerobot/cameras/realsense/camera_realsense.py:667— RealSenseCamera._read_loop has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (18 pts), error handling 2 (4 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
subtask_annotation.compute_temporal_proportions (cognitive 23) src/lerobot/data_processing/sarm_annotations/subtask_annotation.py:102— subtask_annotation.compute_temporal_proportions has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (6 pts), ternaries 2 (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.
dataset_tools.split_dataset (cognitive 23) src/lerobot/datasets/dataset_tools.py:180— dataset_tools.split_dataset has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 2, ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dataset_tools._keep_episodes_from_video_with_av (cognitive 23) src/lerobot/datasets/dataset_tools.py:749— dataset_tools._keep_episodes_from_video_with_av has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 5 (10 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
factory.make_train_eval_datasets (cognitive 23) src/lerobot/datasets/factory.py:228— factory.make_train_eval_datasets has cognitive complexity 23 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 4 (7 pts), ternaries 3 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pyav_utils._check_option_value (cognitive 23) src/lerobot/datasets/pyav_utils.py:108— pyav_utils._check_option_value has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 4, error handling 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChunkRuntime.__init__ (cognitive 23) src/lerobot/inference/execution.py:146— ChunkRuntime.__init__ has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 12, if/else 9 (10 pts), loops 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
MoTModelMixin.get_rope_index (cognitive 23) src/lerobot/policies/cosmos3/modeling_cosmos3.py:1972— MoTModelMixin.get_rope_index has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (5 pts), ternaries 2, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DM05ForCausalLM.inference_action (cognitive 23) src/lerobot/policies/dm05/core/modeling.py:1636— DM05ForCausalLM.inference_action has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
DM05TokenizerProcessorStep.observation (cognitive 23) src/lerobot/policies/dm05/processor_dm05.py:177— DM05TokenizerProcessorStep.observation has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 4, ternaries 2 (3 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConditionalFlowMatchingHead.forward (cognitive 23) src/lerobot/policies/lawam/vlas/flowmatching_expert.py:343— ConditionalFlowMatchingHead.forward has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17 (18 pts), boolean chains 4, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ActionExpert.forward_trunk_rope (cognitive 23) src/lerobot/policies/praxis/praxis_core/action_expert.py:735— ActionExpert.forward_trunk_rope has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (16 pts), ternaries 3 (5 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WallXPolicy.forward (cognitive 23) src/lerobot/policies/wall_x/modeling_wall_x.py:1880— WallXPolicy.forward has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 pts), ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpenArmFollower.send_action (cognitive 23) src/lerobot/robots/openarm_follower/openarm_follower.py:267— OpenArmFollower.send_action has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 2 (6 pts), boolean chains 2, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
context.build_remote_rollout_context (cognitive 23) src/lerobot/rollout/context.py:764— context.build_remote_rollout_context has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 4, error handling 2 (3 pts), ternaries 3 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ZenohTransport.query (cognitive 23) src/lerobot/transport/zenoh.py:379— ZenohTransport.query has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 5, loops 2, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
reader._iter_one_path (cognitive 22) src/lerobot/annotations/steerable_pipeline/reader.py:151— reader._iter_one_path has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 5 (9 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.
LanceDatasetReader.__init__ (cognitive 22) src/lerobot/datasets/lance_backend.py:205— LanceDatasetReader.__init__ has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 5, error handling 1 (2 pts), ternaries 2 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FastWAMConfig.validate_features (cognitive 22) src/lerobot/policies/fastwam/configuration_fastwam.py:433— FastWAMConfig.validate_features has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 1, 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.
FastWAMPolicy.from_pretrained (cognitive 22) src/lerobot/policies/fastwam/modeling_fastwam.py:98— FastWAMPolicy.from_pretrained has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GrootN17PackInputsStep._ordered_image_keys (cognitive 22) src/lerobot/policies/groot/processor_groot.py:1524— GrootN17PackInputsStep._ordered_image_keys has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
modeling_lingbot_vla_v2_base.replace_lnorm_with_adanorm (cognitive 22) src/lerobot/policies/lingbot_vla_v2/model_core/modeling_lingbot_vla_v2_base.py:87— modeling_lingbot_vla_v2_base.replace_lnorm_with_adanorm has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 3, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FlowMatchingV2.embed_prefix (cognitive 22) src/lerobot/policies/lingbot_vla_v2/modeling_lingbot_vla_v2.py:811— FlowMatchingV2.embed_prefix has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17 (19 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
FlowMatchingV2.sample_actions (cognitive 22) src/lerobot/policies/lingbot_vla_v2/modeling_lingbot_vla_v2.py:1100— FlowMatchingV2.sample_actions has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 3, loops 2, ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MolmoAct2Policy._continue_discrete_generation_from_output (cognitive 22) src/lerobot/policies/molmoact2/modeling_molmoact2.py:1609— MolmoAct2Policy._continue_discrete_generation_from_output has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MolmoAct2Processor.__call__ (cognitive 22) src/lerobot/policies/molmoact2/molmoact2_hf_model/processing_molmoact2.py:265— MolmoAct2Processor.__call__ has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (11 pts), loops 4 (10 pts), boolean chains 1 (nesting depth added 7). 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.
processor_molmoact2._feature_names_from_meta (cognitive 22) src/lerobot/policies/molmoact2/processor_molmoact2.py:527— processor_molmoact2._feature_names_from_meta has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), error handling 1 (3 pts), boolean chains 2, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WallXPromptProcessorStep.complementary_data (cognitive 22) src/lerobot/policies/wall_x/processor_wall_x.py:294— WallXPromptProcessorStep.complementary_data has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (5 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WallXTokenizerStep.__call__ (cognitive 22) src/lerobot/policies/wall_x/processor_wall_x.py:432— WallXTokenizerStep.__call__ has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 4 (5 pts), boolean chains 3, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
utils.get_frame_instruction (cognitive 22) src/lerobot/policies/wall_x/utils.py:432— utils.get_frame_instruction has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (4 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.
DataProcessorPipeline._resolve_artifact_paths (cognitive 22) src/lerobot/processor/pipeline.py:1058— DataProcessorPipeline._resolve_artifact_paths has cognitive complexity 22 (threshold 15). Drivers by points: if/else 3 (9 pts), ternaries 2 (7 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RenderTrainingMessagesStep.__call__ (cognitive 22) src/lerobot/processor/render_messages_processor.py:67— RenderTrainingMessagesStep.__call__ has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 10 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
crop_dataset_roi.convert_lerobot_dataset_to_cropped_lerobot_dataset (cognitive 22) src/lerobot/rl/crop_dataset_roi.py:163— crop_dataset_roi.convert_lerobot_dataset_to_cropped_lerobot_dataset has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 3 (4 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.
EpisodeVideoManifest._save_file_sidecar (cognitive 22) src/lerobot/streaming/manifest.py:350— EpisodeVideoManifest._save_file_sidecar has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 2 (3 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.
check_docstrings.replace_default_in_arg_description (cognitive 22) utils/check_docstrings.py:202— check_docstrings.replace_default_in_arg_description has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), error handling 1 (4 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
parser.filter_path_args (cognitive 21) src/lerobot/configs/parser.py:319— parser.filter_path_args has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (4 pts), boolean chains 1, ternaries 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.
compute_stats.compute_episode_stats (cognitive 21) src/lerobot/datasets/compute_stats.py:504— compute_stats.compute_episode_stats has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 2 (6 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dataset_tools.modify_tasks (cognitive 21) src/lerobot/datasets/dataset_tools.py:1576— dataset_tools.modify_tasks has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, loops 3, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
factory.resolve_delta_timestamps (cognitive 21) src/lerobot/datasets/factory.py:39— factory.resolve_delta_timestamps has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 3 (5 pts), boolean chains 4, 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.
ChunkRuntime.accept (cognitive 21) src/lerobot/inference/execution.py:434— ChunkRuntime.accept has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13, boolean chains 6, ternaries 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
video_dit.retract_video_rope (cognitive 21) src/lerobot/policies/fastwam/wan/video_dit.py:211— video_dit.retract_video_rope has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
processor_groot._make_relative_action_training_stats (cognitive 21) src/lerobot/policies/groot/processor_groot.py:718— processor_groot._make_relative_action_training_stats has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, loops 2 (3 pts), error handling 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.
MolmoAct2ImageProcessor.preprocess (cognitive 21) src/lerobot/policies/molmoact2/molmoact2_hf_model/image_processing_molmoact2.py:427— MolmoAct2ImageProcessor.preprocess has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 11, if/else 7 (8 pts), loops 1 (2 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
processor_molmoact2._add_gripper_masks_to_stats (cognitive 21) src/lerobot/policies/molmoact2/processor_molmoact2.py:565— processor_molmoact2._add_gripper_masks_to_stats has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 3, 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.
IsaaclabArenaProcessorStep._process_observation (cognitive 21) src/lerobot/processor/env_processor.py:174— IsaaclabArenaProcessorStep._process_observation has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
migrate_policy_normalization.load_state_dict_with_missing_key_handling (cognitive 21) src/lerobot/processor/migrate_policy_normalization.py:307— migrate_policy_normalization.load_state_dict_with_missing_key_handling has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 3 (8 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.
PolicyServer._flush_replies (cognitive 21) src/lerobot/remote_inference/server.py:941— PolicyServer._flush_replies has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2, error handling 1 (2 pts), loops 1, ternaries 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.
compute_rabc_weights.compute_topreward_progress (cognitive 21) src/lerobot/rewards/topreward/compute_rabc_weights.py:141— compute_rabc_weights.compute_topreward_progress has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2 (3 pts), boolean chains 2, ternaries 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.
EEReferenceAndDelta.action (cognitive 21) src/lerobot/robots/so_follower/robot_kinematic_processor.py:79— EEReferenceAndDelta.action has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnitreeG1.connect (cognitive 21) src/lerobot/robots/unitree_g1/unitree_g1.py:383— UnitreeG1.connect has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 3, loops 3 (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.
BatchedRandomAffine.__init__ (cognitive 21) src/lerobot/transforms/transforms.py:729— BatchedRandomAffine.__init__ has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 5, ternaries 3 (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.
codec._decode_record (cognitive 21) src/lerobot/transport/protocol/codec.py:226— codec._decode_record has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 5, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InterjectionsAndSpeechModule._mid_episode_interjections (cognitive 20) src/lerobot/annotations/steerable_pipeline/modules/interjections_and_speech.py:99— InterjectionsAndSpeechModule._mid_episode_interjections has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 5, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
parser._register_scoped_actions (cognitive 20) src/lerobot/configs/parser.py:241— parser._register_scoped_actions has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts), ternaries 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dataset_tools._copy_episodes_metadata_and_stats (cognitive 20) src/lerobot/datasets/dataset_tools.py:1231— dataset_tools._copy_episodes_metadata_and_stats has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (5 pts), boolean chains 1, ternaries 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.
hf._tail_logs (cognitive 20) src/lerobot/jobs/hf.py:137— hf._tail_logs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (3 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DM05Config.__post_init__ (cognitive 20) src/lerobot/policies/dm05/configuration_dm05.py:122— DM05Config.__post_init__ has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, boolean chains 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.
FlowMatchingV2._prefix_graphed (cognitive 20) src/lerobot/policies/lingbot_vla_v2/modeling_lingbot_vla_v2.py:1593— FlowMatchingV2._prefix_graphed has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 2, ternaries 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.
MolmoAct2AdamW._step_compensated_bfloat16 (cognitive 20) src/lerobot/policies/molmoact2/configuration_molmoact2.py:88— MolmoAct2AdamW._step_compensated_bfloat16 has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 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.
PI05Policy._fix_pytorch_state_dict_keys (cognitive 20) src/lerobot/policies/pi05/modeling_pi05.py:1251— PI05Policy._fix_pytorch_state_dict_keys has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
modeling_pi05.compute_layer_complete (cognitive 20) src/lerobot/policies/pi05/modeling_pi05.py:204— modeling_pi05.compute_layer_complete has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 2 (4 pts), boolean chains 2, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
checkpoint._expert_variant (cognitive 20) src/lerobot/policies/praxis/praxis_core/checkpoint.py:487— checkpoint._expert_variant has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 4, loops 1 (2 pts), ternaries 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
layers_triton.modulate_fused_backward (cognitive 20) src/lerobot/policies/praxis/praxis_core/kernels/layers_triton.py:333— layers_triton.modulate_fused_backward has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 6 (9 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SingleArmServeSession.prepare (cognitive 20) src/lerobot/policies/praxis/praxis_core/single_arm.py:628— SingleArmServeSession.prepare has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 3, ternaries 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RTCDebugVisualizer.plot_waypoints (cognitive 20) src/lerobot/policies/rtc/debug_visualizer.py:30— RTCDebugVisualizer.plot_waypoints has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 6 (9 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.
compute_rabc_weights.compute_robometer_progress (cognitive 20) src/lerobot/rewards/robometer/compute_rabc_weights.py:104— compute_rabc_weights.compute_robometer_progress has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (5 pts), ternaries 3 (5 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RebotB601FollowerConfig.__post_init__ (cognitive 20) src/lerobot/robots/rebot_b601_follower/config_rebot_b601_follower.py:75— RebotB601FollowerConfig.__post_init__ has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CycleTimer.wait (cognitive 20) src/lerobot/utils/cycle_timer.py:353— CycleTimer.wait has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 2 (6 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CycleTimer._summary_lines (cognitive 20) src/lerobot/utils/cycle_timer.py:491— CycleTimer._summary_lines has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 3 (6 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VideoFrameProvider.frames_at (cognitive 19) src/lerobot/annotations/steerable_pipeline/frames.py:184— VideoFrameProvider.frames_at has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (4 pts), boolean chains 1, ternaries 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.
train_utils.save_training_state (cognitive 19) src/lerobot/common/train_utils.py:356— train_utils.save_training_state has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 6 (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.
TrainPipelineConfig.from_pretrained (cognitive 19) src/lerobot/configs/train.py:452— TrainPipelineConfig.from_pretrained has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 1 (2 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dataset_tools._copy_and_reindex_data (cognitive 19) src/lerobot/datasets/dataset_tools.py:549— dataset_tools._copy_and_reindex_data has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 5 (7 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dataset_tools.reencode_dataset (cognitive 19) src/lerobot/datasets/dataset_tools.py:2103— dataset_tools.reencode_dataset has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (7 pts), loops 4 (6 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StreamingLeRobotDataset.__init__ (cognitive 19) src/lerobot/datasets/streaming_dataset.py:210— StreamingLeRobotDataset.__init__ has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8, ternaries 8, boolean chains 2, error handling 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.
video_utils.concatenate_video_files (cognitive 19) src/lerobot/datasets/video_utils.py:693— video_utils.concatenate_video_files has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 4 (5 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
modeling_dm05.prepare_compiled_suffix_inputs (cognitive 19) src/lerobot/policies/dm05/modeling_dm05.py:61— modeling_dm05.prepare_compiled_suffix_inputs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
processor_groot._slice_stats_entry (cognitive 19) src/lerobot/policies/groot/processor_groot.py:842— processor_groot._slice_stats_entry has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 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.
LaWAMPolicy.validate_chunk_input_features (cognitive 19) src/lerobot/policies/lawam/modeling_lawam.py:236— LaWAMPolicy.validate_chunk_input_features has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 6, 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.
MolmoAct2Policy._freeze_input_embeddings (cognitive 19) src/lerobot/policies/molmoact2/modeling_molmoact2.py:821— MolmoAct2Policy._freeze_input_embeddings has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 4 (8 pts), boolean chains 1, ternaries 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.
MolmoAct2Policy._compute_flow_matching_loss_joint_per_layer (cognitive 19) src/lerobot/policies/molmoact2/modeling_molmoact2.py:1309— MolmoAct2Policy._compute_flow_matching_loss_joint_per_layer has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 2, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MolmoAct2Policy._decode_discrete_action_chunk (cognitive 19) src/lerobot/policies/molmoact2/modeling_molmoact2.py:1706— MolmoAct2Policy._decode_discrete_action_chunk has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PI0FastPytorch.sample_actions_fast_kv_cache (cognitive 19) src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:604— PI0FastPytorch.sample_actions_fast_kv_cache has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 1, ternaries 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.
Qwen2_5_VLMoEForAction.prepare_inputs_for_generation (cognitive 19) src/lerobot/policies/wall_x/modeling_wall_x.py:1493— Qwen2_5_VLMoEForAction.prepare_inputs_for_generation has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BiYamFollower.connect (cognitive 19) src/lerobot/robots/bi_yam_follower/bi_yam_follower.py:100— BiYamFollower.connect has cognitive complexity 19 (threshold 15). Drivers by points: loops 5 (8 pts), if/else 4 (5 pts), error handling 2 (4 pts), boolean chains 1, ternaries 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.
lekiwi_host.main (cognitive 19) src/lerobot/robots/lekiwi/lekiwi_host.py:62— lekiwi_host.main has cognitive complexity 19 (threshold 15). Drivers by points: error handling 4 (7 pts), if/else 2 (5 pts), loops 2 (3 pts), ternaries 1 (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.
MitController._run (cognitive 19) src/lerobot/robots/yam_follower/mit_control.py:621— MitController._run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 2 (3 pts), error handling 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.
sidecar_utils.mapped_sidecar (cognitive 19) src/lerobot/streaming/sidecar_utils.py:332— sidecar_utils.mapped_sidecar has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (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.
check_docstrings.check_docstrings (cognitive 19) utils/check_docstrings.py:505— check_docstrings.check_docstrings has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (5 pts), error handling 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GeneralVqaModule.run_episode (cognitive 18) src/lerobot/annotations/steerable_pipeline/modules/general_vqa.py:104— GeneralVqaModule.run_episode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (4 pts), ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlanSubtasksMemoryModule.run_episode (cognitive 18) src/lerobot/annotations/steerable_pipeline/modules/plan_subtasks_memory.py:100— PlanSubtasksMemoryModule.run_episode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 3 (4 pts), boolean chains 3, ternaries 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ImageServer.run (cognitive 18) src/lerobot/cameras/zmq/image_server.py:126— ImageServer.run has cognitive complexity 18 (threshold 15). Drivers by points: loops 7 (9 pts), if/else 3 (7 pts), boolean chains 1, error handling 1 (nesting depth added 6). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
train_utils.save_pretrained_model (cognitive 18) src/lerobot/common/train_utils.py:308— train_utils.save_pretrained_model has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 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.
RangeFinderGUI._handle_dropdown_event (cognitive 18) src/lerobot/motors/calibration_gui.py:319— RangeFinderGUI._handle_dropdown_event has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ACT.forward (cognitive 18) src/lerobot/policies/act/modeling_act.py:389— ACT.forward has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 2 (3 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
DM05ForCausalLM.forward (cognitive 18) src/lerobot/policies/dm05/core/modeling.py:1448— DM05ForCausalLM.forward has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (14 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
Evo1Policy._prepare_actions (cognitive 18) src/lerobot/policies/evo1/modeling_evo1.py:249— Evo1Policy._prepare_actions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (18 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.
FastWAM.infer_joint (cognitive 18) src/lerobot/policies/fastwam/wan/modular.py:1982— FastWAM.infer_joint has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 3 (6 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.
FineARTVLAPolicy.get_optim_params (cognitive 18) REDACTED:1493— FineARTVLAPolicy.get_optim_params has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5, loops 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
processor_fineart_vla._flatten_say_tool_calls (cognitive 18) src/lerobot/policies/fineart_vla/processor_fineart_vla.py:103— processor_fineart_vla._flatten_say_tool_calls has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 1 (3 pts), ternaries 2 (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.
GrootPolicy.from_pretrained (cognitive 18) src/lerobot/policies/groot/modeling_groot.py:160— GrootPolicy.from_pretrained has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), error handling 2 (3 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
GrootPolicy._prepare_n1_7_rtc_inputs (cognitive 18) src/lerobot/policies/groot/modeling_groot.py:368— GrootPolicy._prepare_n1_7_rtc_inputs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 2, error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
utils.stat_dim_from_entry (cognitive 18) src/lerobot/policies/groot/utils.py:112— utils.stat_dim_from_entry has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 2 (6 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ViTMultiHeadDotProductAttention.forward (cognitive 18) src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:1505— ViTMultiHeadDotProductAttention.forward has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (17 pts), ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MolmoAct2VideoProcessor.sample_times (cognitive 18) src/lerobot/policies/molmoact2/molmoact2_hf_model/video_processing_molmoact2.py:621— MolmoAct2VideoProcessor.sample_times has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PI0Policy._fix_pytorch_state_dict_keys (cognitive 18) src/lerobot/policies/pi0/modeling_pi0.py:917— PI0Policy._fix_pytorch_state_dict_keys has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
checkpoint.strict_load (cognitive 18) src/lerobot/policies/praxis/praxis_core/checkpoint.py:868— checkpoint.strict_load has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 2, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ResidualVQ.forward (cognitive 18) src/lerobot/policies/vqbet/vqbet_utils.py:439— ResidualVQ.forward has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 5). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
ActionTokenizerProcessorStep._tokenize_action (cognitive 18) src/lerobot/processor/tokenizer_processor.py:446— ActionTokenizerProcessorStep._tokenize_action has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteInferenceEngine._drain_log_events (cognitive 18) src/lerobot/remote_inference/engine.py:143— RemoteInferenceEngine._drain_log_events has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 3 (7 pts), if/else 4 (6 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PolicyServer.serve (cognitive 18) src/lerobot/remote_inference/server.py:981— PolicyServer.serve has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 2 (5 pts), boolean chains 2, error handling 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.
SARMEncodingProcessorStep._validate_annotation_columns (cognitive 18) src/lerobot/rewards/sarm/processor_sarm.py:149— SARMEncodingProcessorStep._validate_annotation_columns has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 1 (3 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.
SARMEncodingProcessorStep._encode_images_batch (cognitive 18) src/lerobot/rewards/sarm/processor_sarm.py:511— SARMEncodingProcessorStep._encode_images_batch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 1 (3 pts), loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReplayBuffer.sample (cognitive 18) src/lerobot/rl/buffer.py:234— ReplayBuffer.sample has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (7 pts), loops 4 (7 pts), boolean chains 2, ternaries 2 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
UnitreeG1.publish_lowcmd (cognitive 18) src/lerobot/robots/unitree_g1/unitree_g1.py:263— UnitreeG1.publish_lowcmd has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 3 (6 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.
RolloutController.serve (cognitive 18) src/lerobot/rollout/controller.py:357— RolloutController.serve has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (17 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.
EnvServerLaunchConfig.__post_init__ (cognitive 18) src/lerobot/scripts/lerobot_env_server.py:77— EnvServerLaunchConfig.__post_init__ has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, ternaries 1 (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.
StorageLocation.parse (cognitive 18) src/lerobot/streaming/location.py:57— StorageLocation.parse has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 5 (6 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Mp4Index.sample_slice (cognitive 18) src/lerobot/streaming/mp4.py:125— Mp4Index.sample_slice has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (16 pts), ternaries 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.
mp4._sample_offsets (cognitive 18) src/lerobot/streaming/mp4.py:764— mp4._sample_offsets has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (6 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HomunculusArm._read_loop (cognitive 18) src/lerobot/teleoperators/homunculus/homunculus_arm.py:264— HomunculusArm._read_loop has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (4 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HomunculusGlove._read_loop (cognitive 18) src/lerobot/teleoperators/homunculus/homunculus_glove.py:301— HomunculusGlove._read_loop has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (4 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check_docstrings.iter_objects_to_check (cognitive 18) utils/check_docstrings.py:468— check_docstrings.iter_objects_to_check has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 3, loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TrainPipelineConfig._validate_distributed (cognitive 17) src/lerobot/configs/train.py:378— TrainPipelineConfig._validate_distributed has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4 (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.
VideoEncoderConfig.get_codec_options (cognitive 17) src/lerobot/configs/video.py:197— VideoEncoderConfig.get_codec_options has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VideoAnnotator.annotate (cognitive 17) src/lerobot/data_processing/sarm_annotations/subtask_annotation.py:376— VideoAnnotator.annotate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 2 (4 pts), boolean chains 2, 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.
LeRobotDatasetMetadata.__init__ (cognitive 17) src/lerobot/datasets/dataset_metadata.py:75— LeRobotDatasetMetadata.__init__ has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, ternaries 2, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
LeRobotDatasetMetadata._save_episode_metadata (cognitive 17) src/lerobot/datasets/dataset_metadata.py:572— LeRobotDatasetMetadata._save_episode_metadata has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (5 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance_utils.resolve_lance_root (cognitive 17) src/lerobot/datasets/lance_utils.py:373— lance_utils.resolve_lance_root has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, ternaries 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.
StreamingLeRobotDataset._worker_share (cognitive 17) src/lerobot/datasets/streaming_dataset.py:694— StreamingLeRobotDataset._worker_share has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 3 (7 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
utils.validate_checkpoint (cognitive 17) src/lerobot/envs/utils.py:181— utils.validate_checkpoint has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteInferenceConfig.__post_init__ (cognitive 17) src/lerobot/inference/factory.py:135— RemoteInferenceConfig.__post_init__ has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 5, ternaries 1 (2 pts), error handling 1, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
FastWAMConfig.__post_init__ (cognitive 17) src/lerobot/policies/fastwam/configuration_fastwam.py:288— FastWAMConfig.__post_init__ has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
GrootConfig.__post_init__ (cognitive 17) src/lerobot/policies/groot/configuration_groot.py:383— GrootConfig.__post_init__ has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
processor_lawam.make_lawam_pre_post_processors (cognitive 17) src/lerobot/policies/lawam/processor_lawam.py:555— processor_lawam.make_lawam_pre_post_processors has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4 (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.
Qwen3VLVisionAttention.forward (cognitive 17) src/lerobot/policies/lingbot_vla_v2/model_core/qwen3vl_in_vla.py:77— Qwen3VLVisionAttention.forward has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 2 (4 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.
MolmoAct2Policy._generate_actions_from_inputs_with_rtc (cognitive 17) src/lerobot/policies/molmoact2/modeling_molmoact2.py:1794— MolmoAct2Policy._generate_actions_from_inputs_with_rtc has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
processor_molmoact2.make_molmoact2_pre_post_processors (cognitive 17) src/lerobot/policies/molmoact2/processor_molmoact2.py:1273— processor_molmoact2.make_molmoact2_pre_post_processors has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 7 (8 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
PI0FastPolicy.detokenize_actions (cognitive 17) src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:1108— PI0FastPolicy.detokenize_actions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PraxisPolicy._load_weights (cognitive 17) src/lerobot/policies/praxis/modeling_praxis.py:668— PraxisPolicy._load_weights has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (4 pts), boolean chains 3, ternaries 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.
BimanualServeSession.prepare (cognitive 17) src/lerobot/policies/praxis/praxis_core/bimanual.py:595— BimanualServeSession.prepare has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, ternaries 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
bimanual._pose8_rows (cognitive 17) src/lerobot/policies/praxis/praxis_core/bimanual.py:185— bimanual._pose8_rows has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, ternaries 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
bimanual.view_stacks (cognitive 17) src/lerobot/policies/praxis/praxis_core/bimanual.py:239— bimanual.view_stacks has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
checkpoint._check_normalization (cognitive 17) src/lerobot/policies/praxis/praxis_core/checkpoint.py:671— checkpoint._check_normalization has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, loops 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SmolVLAPolicy.validate_chunk_input_features (cognitive 17) src/lerobot/policies/smolvla/modeling_smolvla.py:356— SmolVLAPolicy.validate_chunk_input_features has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 5, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WallOSS05Model.generate_text (cognitive 17) src/lerobot/policies/wall_oss_05/modeling_wall_oss_05.py:568— WallOSS05Model.generate_text has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WallOSS05TokenizerStep._message_content (cognitive 17) src/lerobot/policies/wall_oss_05/processor_wall_oss_05.py:143— WallOSS05TokenizerStep._message_content has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (6 pts), boolean chains 4, error handling 1 (3 pts), ternaries 2 (3 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WallXPromptProcessorStep._message_content (cognitive 17) src/lerobot/policies/wall_x/processor_wall_x.py:193— WallXPromptProcessorStep._message_content has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (6 pts), boolean chains 4, error handling 1 (3 pts), ternaries 2 (3 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataProcessorPipeline._save_pretrained (cognitive 17) src/lerobot/processor/pipeline.py:558— DataProcessorPipeline._save_pretrained has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 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.
OpenArmFollower.get_observation (cognitive 17) src/lerobot/robots/openarm_follower/openarm_follower.py:227— OpenArmFollower.get_observation has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 3 (8 pts), if/else 3 (6 pts), loops 2, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DAggerStrategy._apply_transition (cognitive 17) src/lerobot/rollout/strategies/dagger.py:717— DAggerStrategy._apply_transition has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 5 (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.
augment_dataset_quantile_stats.compute_quantile_stats_for_dataset (cognitive 17) src/lerobot/scripts/augment_dataset_quantile_stats.py:150— augment_dataset_quantile_stats.compute_quantile_stats_for_dataset has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (4 pts), ternaries 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lerobot_find_joint_limits.find_joint_and_ee_bounds (cognitive 17) src/lerobot/scripts/lerobot_find_joint_limits.py:95— lerobot_find_joint_limits.find_joint_and_ee_bounds has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 2, 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.
lerobot_train_tokenizer.apply_normalization (cognitive 17) src/lerobot/scripts/lerobot_train_tokenizer.py:133— lerobot_train_tokenizer.apply_normalization has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
import_utils.make_device_from_device_class (cognitive 17) src/lerobot/utils/import_utils.py:184— import_utils.make_device_from_device_class has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), error handling 2 (6 pts), ternaries 2, 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.
RealSenseCamera._configure_sensor_options (cognitive 16) src/lerobot/cameras/realsense/camera_realsense.py:478— RealSenseCamera._configure_sensor_options has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
LeRobotDatasetMetadata._flush_metadata_buffer (cognitive 16) src/lerobot/datasets/dataset_metadata.py:154— LeRobotDatasetMetadata._flush_metadata_buffer has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), ternaries 2 (6 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DatasetReader._check_cached_episodes_sufficient (cognitive 16) src/lerobot/datasets/dataset_reader.py:253— DatasetReader._check_cached_episodes_sufficient has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 2 (5 pts), boolean chains 1, ternaries 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.
recipe.render_message_turns (cognitive 16) src/lerobot/datasets/recipe.py:267— recipe.render_message_turns has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 1 (3 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.
StreamingLeRobotDataset._load_episode_dataset (cognitive 16) src/lerobot/datasets/streaming_dataset.py:782— StreamingLeRobotDataset._load_episode_dataset has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 3, loops 2 (3 pts), error handling 1 (2 pts), ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
video_utils.decode_video_frames_pyav (cognitive 16) src/lerobot/datasets/video_utils.py:172— video_utils.decode_video_frames_pyav has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
video_utils.encode_video_frames (cognitive 16) src/lerobot/datasets/video_utils.py:480— video_utils.encode_video_frames has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 2, boolean chains 1, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ChunkRuntime.begin (cognitive 16) src/lerobot/inference/execution.py:386— ChunkRuntime.begin has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 7, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
DiffusionConfig.validate_features (cognitive 16) src/lerobot/policies/diffusion/configuration_diffusion.py:229— DiffusionConfig.validate_features has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DM05CoreModelConfig.__init__ (cognitive 16) src/lerobot/policies/dm05/core/modeling.py:1119— DM05CoreModelConfig.__init__ has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 5, ternaries 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tokenization.get_camera_labels (cognitive 16) src/lerobot/policies/dm05/core/tokenization.py:40— tokenization.get_camera_labels has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GrootConfig.validate_features (cognitive 16) src/lerobot/policies/groot/configuration_groot.py:460— GrootConfig.validate_features has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
configuration_groot._infer_groot_model_version_from_config (cognitive 16) src/lerobot/policies/groot/configuration_groot.py:216— configuration_groot._infer_groot_model_version_from_config has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Qwen3Backbone.__init__ (cognitive 16) src/lerobot/policies/groot/groot_n1_7.py:262— Qwen3Backbone.__init__ has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (2 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.
GrootActionUnpackUnnormalizeStep.__call__ (cognitive 16) src/lerobot/policies/groot/processor_groot.py:2437— GrootActionUnpackUnnormalizeStep.__call__ has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3 (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.
utils.prepare_n1_7_language_batch (cognitive 16) src/lerobot/policies/groot/utils.py:233— utils.prepare_n1_7_language_batch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MolmoAct2PackInputsProcessorStep._build_labels (cognitive 16) src/lerobot/policies/molmoact2/processor_molmoact2.py:906— MolmoAct2PackInputsProcessorStep._build_labels has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MultiTaskDiTConfig.validate_features (cognitive 16) src/lerobot/policies/multi_task_dit/configuration_multi_task_dit.py:215— MultiTaskDiTConfig.validate_features has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (4 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SmolVLAPolicy.prepare_images (cognitive 16) src/lerobot/policies/smolvla/modeling_smolvla.py:385— SmolVLAPolicy.prepare_images has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2, ternaries 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.
VLAJEPAPolicy._load_checkpoint (cognitive 16) src/lerobot/policies/vla_jepa/modeling_vla_jepa.py:570— VLAJEPAPolicy._load_checkpoint has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WallOSS05TokenizerStep._recipe_prompt (cognitive 16) src/lerobot/policies/wall_oss_05/processor_wall_oss_05.py:161— WallOSS05TokenizerStep._recipe_prompt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WallXConfig.validate_features (cognitive 16) src/lerobot/policies/wall_x/configuration_wall_x.py:162— WallXConfig.validate_features has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
XVLAImageToFloatProcessorStep.__call__ (cognitive 16) src/lerobot/policies/xvla/processor_xvla.py:249— XVLAImageToFloatProcessorStep.__call__ has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataProcessorPipeline._load_config (cognitive 16) src/lerobot/processor/pipeline.py:833— DataProcessorPipeline._load_config has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 1 (4 pts), error handling 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RenderTrainingMessagesStep._call_batch (cognitive 16) src/lerobot/processor/render_messages_processor.py:138— RenderTrainingMessagesStep._call_batch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 3 (5 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
render_messages_processor._fallback_low_level_render (cognitive 16) src/lerobot/processor/render_messages_processor.py:323— render_messages_processor._fallback_low_level_render has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteClient._exchange (cognitive 16) src/lerobot/remote_inference/client.py:418— RemoteClient._exchange has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SessionWorker._validate_open (cognitive 16) src/lerobot/remote_inference/server.py:412— SessionWorker._validate_open has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 5, error handling 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.
ReplayBuffer.from_lerobot_dataset (cognitive 16) src/lerobot/rl/buffer.py:411— ReplayBuffer.from_lerobot_dataset has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnitreeG1.reset (cognitive 16) src/lerobot/robots/unitree_g1/unitree_g1.py:646— UnitreeG1.reset has cognitive complexity 16 (threshold 15). Drivers by points: loops 3 (7 pts), if/else 5, boolean chains 2, ternaries 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.
YamFollowerConfig.__post_init__ (cognitive 16) src/lerobot/robots/yam_follower/config_yam_follower.py:68— YamFollowerConfig.__post_init__ has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (4 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.
lerobot_setup_can.test_interface (cognitive 16) src/lerobot/scripts/lerobot_setup_can.py:162— lerobot_setup_can.test_interface has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), loops 3 (5 pts), ternaries 1 (4 pts), error handling 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.
VLABenchEnv._get_obs (cognitive 16) src/lerobot/sim/integrations/vlabench.py:276— VLABenchEnv._get_obs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 4, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GamepadControllerHID._update (cognitive 16) src/lerobot/teleoperators/gamepad/gamepad_utils.py:416— GamepadControllerHID._update has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 4 (5 pts), boolean chains 2, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
language.normalize_semantic_messages (cognitive 16) src/lerobot/utils/language.py:40— language.normalize_semantic_messages has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Near-duplicate member family (7 members, 12 shared lines) · ×1
Near-duplicate member family (7 members, 12 shared lines) src/lerobot/robots/hope_jr/hope_jr_arm.py:132— src/lerobot/robots/hope_jr/hope_jr_arm.py:132-153 | src/lerobot/robots/hope_jr/hope_jr_hand.py:161-180 | src/lerobot/robots/koch_follower/koch_follower.py:154-174 | src/lerobot/robots/omx_follower/omx_follower.py:168-188 | src/lerobot/robots/openarm_follower/openarm_follower.py:228-264 | src/lerobot/robots/rebot_b601_follower/rebot_b601_follower.py:293-311 | src/lerobot/robots/so_follower/so_follower.py:165-185 — These 7 members are variants of one another: a block of 12 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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.
Near-duplicate member pair (109 shared lines) src/lerobot/rollout/strategies/dagger.py:351— src/lerobot/rollout/strategies/dagger.py:351-533 | src/lerobot/rollout/strategies/dagger.py:540-711 — These two members are variants of one another: 109 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (94 shared lines) src/lerobot/policies/pi0/modeling_pi0.py:817— src/lerobot/policies/pi0/modeling_pi0.py:817-915 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:816-914 — These two members are variants of one another: 94 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (55 shared lines) src/lerobot/rewards/robometer/compute_rabc_weights.py:114— src/lerobot/rewards/robometer/compute_rabc_weights.py:114-214 | src/lerobot/rewards/topreward/compute_rabc_weights.py:151-259 — 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.
Near-duplicate member pair (42 shared lines) src/lerobot/policies/pi0/modeling_pi0.py:79— src/lerobot/policies/pi0/modeling_pi0.py:79-146 | src/lerobot/policies/pi05/modeling_pi05.py:218-324 — These two members are variants of one another: 42 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (22 shared lines) src/lerobot/policies/praxis/praxis_core/bimanual.py:596— src/lerobot/policies/praxis/praxis_core/bimanual.py:596-644 | src/lerobot/policies/praxis/praxis_core/single_arm.py:629-681 — These two members are variants of one another: 22 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (7 members, 50+ identical tokens) src/lerobot/robots/hope_jr/hope_jr_arm.py:67— src/lerobot/robots/hope_jr/hope_jr_arm.py:67-74 | src/lerobot/robots/hope_jr/hope_jr_hand.py:102-109 | src/lerobot/robots/koch_follower/koch_follower.py:68-75 | src/lerobot/robots/omx_follower/omx_follower.py:68-75 | src/lerobot/robots/openarm_follower/openarm_follower.py:105-113 | src/lerobot/robots/rebot_b601_follower/rebot_b601_follower.py:100-107 | src/lerobot/robots/unitree_g1/unitree_g1.py:296-303 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication· Edited copy of a member (94 corresponding lines) · ×1
Edited copy of a member (94 corresponding lines) src/lerobot/policies/pi0/modeling_pi0.py:320— src/lerobot/policies/pi0/modeling_pi0.py:320-413 | src/lerobot/policies/pi05/modeling_pi05.py:524-633 — These two members are one piece of code written twice and then edited apart: 94 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (61 corresponding lines) · ×1
Edited copy of a member (61 corresponding lines) src/lerobot/robots/bi_openarm_follower/bi_openarm_follower.py:40— src/lerobot/robots/bi_openarm_follower/bi_openarm_follower.py:40-100 | src/lerobot/robots/bi_rebot_b601_follower/bi_rebot_b601_follower.py:39-102 — These two members are one piece of code written twice and then edited apart: 61 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (52 corresponding lines) · ×1
Edited copy of a member (52 corresponding lines) src/lerobot/rewards/sarm/modeling_sarm.py:128— src/lerobot/rewards/sarm/modeling_sarm.py:128-179 | src/lerobot/rewards/sarm/modeling_sarm.py:277-331 — These two members are one piece of code written twice and then edited apart: 52 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (47 corresponding lines) · ×1
Edited copy of a member (47 corresponding lines) src/lerobot/policies/pi0/modeling_pi0.py:200— src/lerobot/policies/pi0/modeling_pi0.py:200-246 | src/lerobot/policies/pi05/modeling_pi05.py:383-429 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (63 corresponding lines) · ×1
Edited copy of a member (63 corresponding lines) src/lerobot/policies/pi0/modeling_pi0.py:1002— src/lerobot/policies/pi0/modeling_pi0.py:1002-1064 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:970-1033 — These two members are one piece of code written twice and then edited apart: 63 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (73 corresponding lines) · ×1
Edited copy of a member (73 corresponding lines) src/lerobot/robots/utils.py:30— src/lerobot/robots/utils.py:30-102 | src/lerobot/teleoperators/utils.py:38-118 — These two members are one piece of code written twice and then edited apart: 73 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (41 corresponding lines) · ×1
Edited copy of a member (41 corresponding lines) src/lerobot/policies/groot/configuration_groot.py:461— src/lerobot/policies/groot/configuration_groot.py:461-501 | src/lerobot/policies/wall_x/configuration_wall_x.py:163-203 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (34 corresponding lines) · ×1
Edited copy of a member (34 corresponding lines) src/lerobot/robots/unitree_g1/controllers/holosoma_locomotion.py:67— src/lerobot/robots/unitree_g1/controllers/holosoma_locomotion.py:67-100 | src/lerobot/robots/unitree_g1/controllers/sonic_whole_body.py:79-114 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (40 corresponding lines) · ×1
Edited copy of a member (40 corresponding lines) src/lerobot/policies/pi0/modeling_pi0.py:673— src/lerobot/policies/pi0/modeling_pi0.py:673-723 | src/lerobot/policies/smolvla/modeling_smolvla.py:786-825 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (54 corresponding lines) · ×1
Edited copy of a member (54 corresponding lines) src/lerobot/policies/pi0/modeling_pi0.py:920— src/lerobot/policies/pi0/modeling_pi0.py:920-973 | src/lerobot/policies/pi05/modeling_pi05.py:1254-1311 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×1
Edited copy of a member (19 corresponding lines) src/lerobot/policies/diffusion/configuration_diffusion.py:230— src/lerobot/policies/diffusion/configuration_diffusion.py:230-248 | src/lerobot/policies/vqbet/configuration_vqbet.py:157-175 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (39 corresponding lines) · ×1
Edited copy of a member (39 corresponding lines) src/lerobot/rewards/pretrained.py:99— src/lerobot/rewards/pretrained.py:99-140 | src/lerobot/rl/algorithms/base.py:167-205 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 28+ corresponding lines) · ×1
Edited copies of one member (3 members, 28+ corresponding lines) src/lerobot/sim/integrations/metaworld.py:291— src/lerobot/sim/integrations/metaworld.py:291-318 | src/lerobot/sim/integrations/robotwin.py:589-630 | src/lerobot/sim/integrations/vlabench.py:534-564 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 28 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (29 corresponding lines) · ×1
Edited copy of a member (29 corresponding lines) src/lerobot/teleoperators/homunculus/homunculus_arm.py:265— src/lerobot/teleoperators/homunculus/homunculus_arm.py:265-301 | src/lerobot/teleoperators/homunculus/homunculus_glove.py:302-330 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 9+ corresponding lines) · ×1
Edited copies of one member (3 members, 9+ corresponding lines) src/lerobot/policies/praxis/praxis_core/kernels/layers_triton.py:93— src/lerobot/policies/praxis/praxis_core/kernels/layers_triton.py:93-101 | src/lerobot/policies/praxis/praxis_core/kernels/layers_triton.py:116-128 | src/lerobot/policies/praxis/praxis_core/kernels/layers_triton.py:142-154 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (42 corresponding lines) · ×1
Edited copy of a member (42 corresponding lines) src/lerobot/policies/cosmos3/modeling_cosmos3.py:2246— src/lerobot/policies/cosmos3/modeling_cosmos3.py:2246-2287 | src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:4569-4630 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×1
Edited copy of a member (17 corresponding lines) src/lerobot/policies/cosmos3/modeling_cosmos3.py:250— src/lerobot/policies/cosmos3/modeling_cosmos3.py:250-266 | src/lerobot/policies/cosmos3/modeling_cosmos3.py:270-293 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 21+ corresponding lines) · ×1
Edited copies of one member (3 members, 21+ corresponding lines) src/lerobot/rollout/strategies/dagger.py:814— src/lerobot/rollout/strategies/dagger.py:814-845 | src/lerobot/rollout/strategies/highlight.py:270-290 | src/lerobot/rollout/strategies/sentry.py:302-337 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (31 corresponding lines) · ×1
Edited copy of a member (31 corresponding lines) src/lerobot/policies/diffusion/modeling_diffusion.py:129— src/lerobot/policies/diffusion/modeling_diffusion.py:129-164 | src/lerobot/policies/vqbet/modeling_vqbet.py:128-158 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (26 corresponding lines) · ×1
Edited copy of a member (26 corresponding lines) src/lerobot/motors/damiao/damiao.py:397— src/lerobot/motors/damiao/damiao.py:397-426 | src/lerobot/motors/robstride/robstride.py:484-509 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 20+ corresponding lines) · ×1
Edited copies of one member (3 members, 20+ corresponding lines) src/lerobot/policies/pi0/processor_pi0.py:49— src/lerobot/policies/pi0/processor_pi0.py:49-78 | src/lerobot/policies/wall_x/processor_wall_x.py:143-163 | src/lerobot/processor/newline_task_processor.py:35-54 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×1
Edited copy of a member (14 corresponding lines) src/lerobot/policies/common/vla_utils.py:44— src/lerobot/policies/common/vla_utils.py:44-57 | src/lerobot/policies/lingbot_vla_v2/model_core/utils.py:30-44 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (25 corresponding lines) · ×1
Edited copy of a member (25 corresponding lines) src/lerobot/policies/fastwam/wan/modular.py:562— src/lerobot/policies/fastwam/wan/modular.py:562-586 | src/lerobot/policies/fastwam/wan/modular.py:598-625 — 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 copies of one member (4 members, 11+ corresponding lines) · ×1
Edited copies of one member (4 members, 11+ corresponding lines) src/lerobot/policies/cosmos3/modeling_cosmos3.py:2328— src/lerobot/policies/cosmos3/modeling_cosmos3.py:2328-2345 | src/lerobot/policies/cosmos3/modeling_cosmos3.py:2662-2682 | src/lerobot/policies/lingbot_vla_v2/model_core/qwen2_action_expert.py:407-420 | src/lerobot/policies/lingbot_vla_v2/model_core/qwen3vl_in_vla.py:375-385 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 15+ corresponding lines) · ×1
Edited copies of one member (3 members, 15+ corresponding lines) src/lerobot/cameras/opencv/camera_opencv.py:508— src/lerobot/cameras/opencv/camera_opencv.py:508-523 | src/lerobot/cameras/realsense/camera_realsense.py:732-748 | src/lerobot/cameras/zmq/camera_zmq.py:291-305 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 18+ corresponding lines) · ×1
Edited copies of one member (3 members, 18+ corresponding lines) src/lerobot/cameras/opencv/camera_opencv.py:547— src/lerobot/cameras/opencv/camera_opencv.py:547-585 | src/lerobot/cameras/realsense/camera_realsense.py:772-789 | src/lerobot/cameras/zmq/camera_zmq.py:309-338 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 24+ corresponding lines) · ×1
Edited copies of one member (3 members, 24+ corresponding lines) src/lerobot/sim/integrations/libero.py:403— src/lerobot/sim/integrations/libero.py:403-427 | src/lerobot/sim/integrations/metaworld.py:236-276 | src/lerobot/sim/integrations/robocasa.py:285-308 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 4+ corresponding lines) · ×1
Edited copies of one member (5 members, 4+ corresponding lines) src/lerobot/policies/praxis/praxis_core/backbone.py:233— src/lerobot/policies/praxis/praxis_core/backbone.py:233-237 | src/lerobot/policies/praxis/praxis_core/vae.py:417-420 | src/lerobot/policies/praxis/praxis_core/vae.py:424-428 | src/lerobot/policies/praxis/praxis_core/vae.py:432-435 | src/lerobot/policies/praxis/praxis_core/vae.py:439-442 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 7+ corresponding lines) · ×1
Edited copies of one member (4 members, 7+ corresponding lines) src/lerobot/motors/robstride/robstride.py:222— src/lerobot/motors/robstride/robstride.py:222-228 | src/lerobot/motors/robstride/robstride.py:364-370 | src/lerobot/motors/robstride/robstride.py:373-379 | src/lerobot/motors/robstride/robstride.py:427-436 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 6+ corresponding lines) · ×1
Edited copies of one member (5 members, 6+ corresponding lines) src/lerobot/robots/bi_openarm_follower/bi_openarm_follower.py:133— src/lerobot/robots/bi_openarm_follower/bi_openarm_follower.py:133-143 | src/lerobot/robots/bi_rebot_b601_follower/bi_rebot_b601_follower.py:130-135 | src/lerobot/robots/bi_so_follower/bi_so_follower.py:125-135 | src/lerobot/robots/bi_yam_follower/bi_yam_follower.py:141-147 | src/lerobot/teleoperators/bi_openarm_mini/bi_openarm_mini.py:87-92 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 11+ corresponding lines) · ×1
Edited copies of one member (5 members, 11+ corresponding lines) src/lerobot/processor/pipeline.py:1890— src/lerobot/processor/pipeline.py:1890-1900 | src/lerobot/processor/pipeline.py:1950-1960 | src/lerobot/processor/pipeline.py:1979-1989 | src/lerobot/processor/pipeline.py:2095-2105 | src/lerobot/processor/pipeline.py:2124-2134 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 10+ corresponding lines) · ×1
Edited copies of one member (3 members, 10+ corresponding lines) src/lerobot/robots/hope_jr/hope_jr_arm.py:90— src/lerobot/robots/hope_jr/hope_jr_arm.py:90-104 | src/lerobot/robots/hope_jr/hope_jr_hand.py:125-134 | src/lerobot/robots/lekiwi/lekiwi.py:115-126 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 4+ corresponding lines) · ×1
Edited copies of one member (3 members, 4+ corresponding lines) src/lerobot/configs/policies.py:106— src/lerobot/configs/policies.py:106-109 | src/lerobot/configs/rewards.py:78-81 | src/lerobot/rl/algorithms/configs.py:65-69 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 2+ corresponding lines) · ×1
Edited copies of one member (3 members, 2+ corresponding lines) src/lerobot/configs/policies.py:174— src/lerobot/configs/policies.py:174-175 | src/lerobot/configs/rewards.py:108-109 | src/lerobot/rl/algorithms/configs.py:81-85 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 2 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (1 corresponding lines) · ×1
Edited copy of a member (1 corresponding lines) src/lerobot/robots/lekiwi/lekiwi_client.py:110— src/lerobot/robots/lekiwi/lekiwi_client.py:110-110 | src/lerobot/robots/yam_follower/yam_follower.py:342-342 — These two members are one piece of code written twice and then edited apart: 1 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (56–68 lines × 3) src/lerobot/policies/pi0/processor_pi0.py:102— src/lerobot/policies/pi0/processor_pi0.py:102-157 | src/lerobot/policies/pi05/processor_pi05.py:112-172 | src/lerobot/policies/pi0_fast/processor_pi0_fast.py:103-170 — `src/lerobot/policies/pi05/processor_pi05.py` and `src/lerobot/policies/pi0_fast/processor_pi0_fast.py` are one unit implemented 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 89 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (55 lines × 2) src/lerobot/policies/groot/action_head/cross_attention_dit.py:113— src/lerobot/policies/groot/action_head/cross_attention_dit.py:113-167 | src/lerobot/policies/lawam/vlas/cross_attention_dit.py:94-148 — before extracting anything, compare `src/lerobot/policies/groot/action_head/cross_attention_dit.py` and `src/lerobot/policies/lawam/vlas/cross_attention_dit.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 114 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/lerobot/policies/groot/action_head/cross_attention_dit.py:112` calls `require_package` and `src/lerobot/policies/lawam/vlas/cross_attention_dit.py:93` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (49–50 lines × 2) src/lerobot/robots/openarm_follower/openarm_follower.py:165— src/lerobot/robots/openarm_follower/openarm_follower.py:165-213 | src/lerobot/teleoperators/openarm_leader/openarm_leader.py:121-170 — before extracting anything, compare `src/lerobot/robots/openarm_follower/openarm_follower.py` and `src/lerobot/teleoperators/openarm_leader/openarm_leader.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 76 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (49 lines × 3) src/lerobot/policies/pi0/modeling_pi0.py:818— src/lerobot/policies/pi0/modeling_pi0.py:818-866 | src/lerobot/policies/pi05/modeling_pi05.py:1133-1181 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:817-865 — `src/lerobot/policies/pi0/modeling_pi0.py` and `src/lerobot/policies/pi05/modeling_pi05.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 547 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note first that the copies are not typed on the same thing: the declarations holding them bind `config` to `PI0Config` in one and `PI05Config` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (47 lines × 2) src/lerobot/policies/pi0/modeling_pi0.py:326— src/lerobot/policies/pi0/modeling_pi0.py:326-372 | src/lerobot/policies/pi05/modeling_pi05.py:535-581 — `src/lerobot/policies/pi0/modeling_pi0.py` and `src/lerobot/policies/pi05/modeling_pi05.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 547 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/pi0/modeling_pi0.py:326` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (40–41 lines × 2) src/lerobot/policies/fastwam/wan/modular.py:1735— src/lerobot/policies/fastwam/wan/modular.py:1735-1775 | src/lerobot/policies/fastwam/wan/modular.py:1800-1839 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/fastwam/wan/modular.py:1735` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (37 lines × 2) src/lerobot/policies/pi0/modeling_pi0.py:920— src/lerobot/policies/pi0/modeling_pi0.py:920-956 | src/lerobot/policies/pi05/modeling_pi05.py:1254-1290 — `src/lerobot/policies/pi0/modeling_pi0.py` and `src/lerobot/policies/pi05/modeling_pi05.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 547 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/lerobot/policies/pi05/modeling_pi05.py:1292` calls `startswith`, `warning` and `src/lerobot/policies/pi0/modeling_pi0.py:959` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (36–37 lines × 2) src/lerobot/scripts/lerobot_edit_dataset.py:698— src/lerobot/scripts/lerobot_edit_dataset.py:698-733 | src/lerobot/scripts/lerobot_edit_dataset.py:760-796 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/scripts/lerobot_edit_dataset.py:760` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/lerobot/scripts/lerobot_edit_dataset.py:733` calls `LeRobotDataset`, `info` and `src/lerobot/scripts/lerobot_edit_dataset.py:796` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (26–36 lines × 2) src/lerobot/policies/cosmos3/processor_cosmos3.py:652— src/lerobot/policies/cosmos3/processor_cosmos3.py:652-687 | src/lerobot/policies/dm05/processor_dm05.py:420-445 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/cosmos3/processor_cosmos3.py:652` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (26–35 lines × 2) src/lerobot/cameras/opencv/camera_opencv.py:384— src/lerobot/cameras/opencv/camera_opencv.py:384-418 | src/lerobot/cameras/zmq/camera_zmq.py:218-243 — `src/lerobot/cameras/opencv/camera_opencv.py` and `src/lerobot/cameras/zmq/camera_zmq.py` are one unit implemented 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 87 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (35 lines × 2) src/lerobot/policies/groot/configuration_groot.py:467— src/lerobot/policies/groot/configuration_groot.py:467-501 | src/lerobot/policies/wall_x/configuration_wall_x.py:169-203 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11–32 lines × 2) src/lerobot/cameras/opencv/camera_opencv.py:547— src/lerobot/cameras/opencv/camera_opencv.py:547-578 | src/lerobot/cameras/realsense/camera_realsense.py:772-782 — `src/lerobot/cameras/opencv/camera_opencv.py` and `src/lerobot/cameras/realsense/camera_realsense.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 68 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note first that the copies are not typed on the same thing: the declarations holding them bind `timeout_ms` to `float = 200` in one and `float` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (30–31 lines × 3) src/lerobot/policies/pi0/modeling_pi0.py:1002— src/lerobot/policies/pi0/modeling_pi0.py:1002-1031 | src/lerobot/policies/pi05/modeling_pi05.py:1363-1393 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:970-1000 — `src/lerobot/policies/pi0/modeling_pi0.py` and `src/lerobot/policies/pi05/modeling_pi05.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 547 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 (53 lines × 2) src/lerobot/teleoperators/homunculus/homunculus_arm.py:147— src/lerobot/teleoperators/homunculus/homunculus_arm.py:147-199 | src/lerobot/teleoperators/homunculus/homunculus_glove.py:178-230 — before extracting anything, compare `src/lerobot/teleoperators/homunculus/homunculus_arm.py` and `src/lerobot/teleoperators/homunculus/homunculus_glove.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (29 lines × 3) src/lerobot/policies/pi0/modeling_pi0.py:887— src/lerobot/policies/pi0/modeling_pi0.py:887-915 | src/lerobot/policies/pi05/modeling_pi05.py:1186-1214 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:886-914 — `src/lerobot/policies/pi0/modeling_pi0.py` and `src/lerobot/policies/pi05/modeling_pi05.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 547 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (26–28 lines × 2) src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:3273— src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:3273-3300 | src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:3418-3443 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:3273` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (27–28 lines × 2) src/lerobot/rewards/robometer/compute_rabc_weights.py:218— src/lerobot/rewards/robometer/compute_rabc_weights.py:218-244 | src/lerobot/rewards/topreward/compute_rabc_weights.py:263-290 — `src/lerobot/rewards/robometer/compute_rabc_weights.py` and `src/lerobot/rewards/topreward/compute_rabc_weights.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 160 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/rewards/robometer/compute_rabc_weights.py:218` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (26 lines × 2) src/lerobot/rewards/robometer/compute_rabc_weights.py:130— src/lerobot/rewards/robometer/compute_rabc_weights.py:130-155 | src/lerobot/rewards/topreward/compute_rabc_weights.py:184-209 — `src/lerobot/rewards/robometer/compute_rabc_weights.py` and `src/lerobot/rewards/topreward/compute_rabc_weights.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 160 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/rewards/robometer/compute_rabc_weights.py:130` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (24–26 lines × 2) src/lerobot/robots/unitree_g1/controllers/holosoma_locomotion.py:67— src/lerobot/robots/unitree_g1/controllers/holosoma_locomotion.py:67-90 | src/lerobot/robots/unitree_g1/controllers/sonic_whole_body.py:79-104 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `policy_type` to `str = "fastsac"` in one and `str = "default"` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (25–26 lines × 2) src/lerobot/rollout/strategies/dagger.py:454— src/lerobot/rollout/strategies/dagger.py:454-478 | src/lerobot/rollout/strategies/dagger.py:672-697 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/rollout/strategies/dagger.py:672` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (25 lines × 3) src/lerobot/configs/policies.py:191— src/lerobot/configs/policies.py:191-215 | src/lerobot/configs/rewards.py:125-149 | src/lerobot/rl/algorithms/configs.py:101-125 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/lerobot/configs/rewards.py:153` calls `config_type`, `parse` and `src/lerobot/configs/policies.py:217` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (23–24 lines × 2) src/lerobot/rewards/sarm/modeling_sarm.py:128— src/lerobot/rewards/sarm/modeling_sarm.py:128-150 | src/lerobot/rewards/sarm/modeling_sarm.py:277-300 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) src/lerobot/policies/groot/action_head/cross_attention_dit.py:249— src/lerobot/policies/groot/action_head/cross_attention_dit.py:249-271 | src/lerobot/policies/lawam/vlas/cross_attention_dit.py:262-284 — before extracting anything, compare `src/lerobot/policies/groot/action_head/cross_attention_dit.py` and `src/lerobot/policies/lawam/vlas/cross_attention_dit.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 114 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 (20–22 lines × 2) src/lerobot/policies/cosmos3/modeling_cosmos3.py:2258— src/lerobot/policies/cosmos3/modeling_cosmos3.py:2258-2279 | src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:4601-4620 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/cosmos3/modeling_cosmos3.py:2258` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (2–22 lines × 3) src/lerobot/policies/dm05/core/modeling.py:1017— src/lerobot/policies/dm05/core/modeling.py:1017-1018 | src/lerobot/policies/pi0/modeling_pi0.py:91-112 | src/lerobot/policies/pi05/modeling_pi05.py:247-268 — `src/lerobot/policies/pi0/modeling_pi0.py` and `src/lerobot/policies/pi05/modeling_pi05.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 547 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/lerobot/policies/pi0/modeling_pi0.py:91` calls `v_proj`, `view`, `transpose` and `src/lerobot/policies/dm05/core/modeling.py:1017` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (22 lines × 2) src/lerobot/robots/koch_follower/koch_follower.py:125— src/lerobot/robots/koch_follower/koch_follower.py:125-146 | src/lerobot/robots/omx_follower/omx_follower.py:139-160 — `src/lerobot/robots/koch_follower/koch_follower.py` and `src/lerobot/robots/omx_follower/omx_follower.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 118 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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) src/lerobot/policies/diffusion/modeling_diffusion.py:446— src/lerobot/policies/diffusion/modeling_diffusion.py:446-465 | src/lerobot/policies/vqbet/modeling_vqbet.py:208-227 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (15–19 lines × 2) src/lerobot/motors/damiao/damiao.py:790— src/lerobot/motors/damiao/damiao.py:790-804 | src/lerobot/motors/robstride/robstride.py:1000-1018 — `src/lerobot/motors/damiao/damiao.py` and `src/lerobot/motors/robstride/robstride.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 142 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/motors/robstride/robstride.py:1000` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18–19 lines × 2) src/lerobot/policies/xvla/processor_xvla.py:254— src/lerobot/policies/xvla/processor_xvla.py:254-271 | src/lerobot/policies/xvla/processor_xvla.py:327-345 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16–19 lines × 2) src/lerobot/rewards/robometer/compute_rabc_weights.py:183— src/lerobot/rewards/robometer/compute_rabc_weights.py:183-198 | src/lerobot/rewards/topreward/compute_rabc_weights.py:221-239 — `src/lerobot/rewards/robometer/compute_rabc_weights.py` and `src/lerobot/rewards/topreward/compute_rabc_weights.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 160 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/rewards/robometer/compute_rabc_weights.py:183` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (17–19 lines × 2) src/lerobot/teleoperators/homunculus/homunculus_arm.py:242— src/lerobot/teleoperators/homunculus/homunculus_arm.py:242-258 | src/lerobot/teleoperators/homunculus/homunculus_glove.py:275-293 — before extracting anything, compare `src/lerobot/teleoperators/homunculus/homunculus_arm.py` and `src/lerobot/teleoperators/homunculus/homunculus_glove.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–18 lines × 3) src/lerobot/policies/pi0/modeling_pi0.py:320— src/lerobot/policies/pi0/modeling_pi0.py:320-335 | src/lerobot/policies/pi05/modeling_pi05.py:529-544 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:196-213 — `src/lerobot/policies/pi0/modeling_pi0.py` and `src/lerobot/policies/pi05/modeling_pi05.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 547 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (17 lines × 4) src/lerobot/rl/actor.py:237— src/lerobot/rl/actor.py:237-254 | src/lerobot/rl/actor.py:551-572 | src/lerobot/rl/actor.py:607-627 | src/lerobot/rl/learner.py:490-506 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/lerobot/rl/actor.py:635` calls `ProcessSignalHandler` and `src/lerobot/rl/actor.py:578` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15–17 lines × 2) examples/dataset/slurm_compute_rabc.py:124— examples/dataset/slurm_compute_rabc.py:124-138 | src/lerobot/rewards/sarm/compute_rabc_weights.py:545-561 — 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 × 3) src/lerobot/policies/pi0/processor_pi0.py:64— src/lerobot/policies/pi0/processor_pi0.py:64-78 | src/lerobot/policies/wall_x/processor_wall_x.py:150-163 | src/lerobot/processor/newline_task_processor.py:40-54 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 3) src/lerobot/scripts/lerobot_eval.py:984— src/lerobot/scripts/lerobot_eval.py:984-998 | src/lerobot/scripts/lerobot_eval.py:1051-1065 | src/lerobot/scripts/lerobot_eval.py:1148-1162 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/scripts/lerobot_eval.py:984` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–15 lines × 2) src/lerobot/policies/xvla/modeling_xvla.py:494— src/lerobot/policies/xvla/modeling_xvla.py:494-508 | src/lerobot/rewards/pretrained.py:105-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/xvla/modeling_xvla.py:494` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–14 lines × 2) src/lerobot/policies/dm05/core/modeling.py:1596— src/lerobot/policies/dm05/core/modeling.py:1596-1607 | src/lerobot/policies/dm05/core/modeling.py:1741-1754 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/dm05/core/modeling.py:1596` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13–14 lines × 2) src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:535— src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:535-547 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:642-655 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:549` calls `zeros` and `src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:658` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9–14 lines × 2) src/lerobot/policies/pretrained.py:413— src/lerobot/policies/pretrained.py:413-426 | src/lerobot/policies/vla_jepa/modeling_vla_jepa.py:424-432 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (13 lines × 4) src/lerobot/policies/eo1/configuration_eo1.py:227— src/lerobot/policies/eo1/configuration_eo1.py:227-239 | src/lerobot/policies/pi0/configuration_pi0.py:141-153 | src/lerobot/policies/pi05/configuration_pi05.py:170-182 | src/lerobot/policies/pi0_fast/configuration_pi0_fast.py:135-147 — `src/lerobot/policies/pi0/configuration_pi0.py` and `src/lerobot/policies/pi05/configuration_pi05.py` are one unit implemented 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 47 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (10–13 lines × 2) src/lerobot/policies/lingbot_vla_v2/model_core/moe_loss.py:72— src/lerobot/policies/lingbot_vla_v2/model_core/moe_loss.py:72-84 | src/lerobot/policies/lingbot_vla_v2/model_core/moe_loss.py:97-106 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–13 lines × 2) src/lerobot/policies/xvla/processor_xvla.py:128— src/lerobot/policies/xvla/processor_xvla.py:128-138 | src/lerobot/processor/env_processor.py:88-100 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/processor/env_processor.py:88` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9–13 lines × 2) src/lerobot/processor/pipeline.py:777— src/lerobot/processor/pipeline.py:777-789 | src/lerobot/processor/pipeline.py:817-825 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/processor/pipeline.py:777` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/lerobot/processor/pipeline.py:828` calls `load_state_dict` and `src/lerobot/processor/pipeline.py:790` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11–12 lines × 4) src/lerobot/rollout/strategies/dagger.py:467— src/lerobot/rollout/strategies/dagger.py:467-477 | src/lerobot/rollout/strategies/dagger.py:686-696 | src/lerobot/rollout/strategies/highlight.py:125-136 | src/lerobot/rollout/strategies/sentry.py:133-144 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/lerobot/rollout/strategies/dagger.py:478` calls `robot_action_processor` and `src/lerobot/rollout/strategies/sentry.py:148` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10–11 lines × 4) src/lerobot/policies/groot/configuration_groot.py:174— src/lerobot/policies/groot/configuration_groot.py:174-184 | src/lerobot/policies/groot/processor_groot.py:316-325 | src/lerobot/policies/groot/processor_groot.py:335-344 | src/lerobot/policies/groot/processor_groot.py:354-363 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `embodiment_tag` to `str | None = None` in one and `str` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (5–11 lines × 4) src/lerobot/robots/hope_jr/hope_jr_arm.py:157— src/lerobot/robots/hope_jr/hope_jr_arm.py:157-166 | src/lerobot/robots/koch_follower/koch_follower.py:191-201 | src/lerobot/robots/omx_follower/omx_follower.py:205-215 | src/lerobot/robots/so_follower/so_follower.py:208-212 — before extracting anything, compare `src/lerobot/robots/hope_jr/hope_jr_arm.py` and `src/lerobot/robots/koch_follower/koch_follower.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/lerobot/robots/so_follower/so_follower.py:207` calls `sync_read`, `items` and `src/lerobot/robots/koch_follower/koch_follower.py:191` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7–11 lines × 2) src/lerobot/policies/evo1/modeling_evo1.py:531— src/lerobot/policies/evo1/modeling_evo1.py:531-537 | src/lerobot/policies/pi0/modeling_pi0.py:1079-1089 — 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 × 7) src/lerobot/robots/hope_jr/hope_jr_arm.py:140— src/lerobot/robots/hope_jr/hope_jr_arm.py:140-151 | src/lerobot/robots/hope_jr/hope_jr_hand.py:167-178 | src/lerobot/robots/koch_follower/koch_follower.py:161-172 | src/lerobot/robots/omx_follower/omx_follower.py:175-186 | src/lerobot/robots/openarm_follower/openarm_follower.py:248-259 | src/lerobot/robots/rebot_b601_follower/rebot_b601_follower.py:298-309 | src/lerobot/robots/so_follower/so_follower.py:172-183 — before extracting anything, compare `src/lerobot/robots/hope_jr/hope_jr_arm.py` and `src/lerobot/robots/koch_follower/koch_follower.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/lerobot/robots/openarm_follower/openarm_follower.py:261` calls `perf_counter`, `debug` and `src/lerobot/robots/hope_jr/hope_jr_arm.py:153` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 4) REDACTED:196— REDACTED:196-205 | src/lerobot/policies/pi0/modeling_pi0.py:736-745 | src/lerobot/policies/pi05/modeling_pi05.py:1033-1042 | src/lerobot/policies/smolvla/modeling_smolvla.py:837-846 — `src/lerobot/policies/pi0/modeling_pi0.py` and `src/lerobot/policies/pi05/modeling_pi05.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 547 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:207` calls `_prepare_attention_masks_4d` and `src/lerobot/policies/smolvla/modeling_smolvla.py:848` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9–10 lines × 3) src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:564— src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:564-573 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:671-679 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:726-734 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:564` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 2) src/lerobot/policies/fastwam/wan/modular.py:176— src/lerobot/policies/fastwam/wan/modular.py:176-184 | src/lerobot/policies/fastwam/wan/video_dit.py:704-713 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/fastwam/wan/modular.py:176` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 7) src/lerobot/robots/hope_jr/hope_jr_arm.py:67— src/lerobot/robots/hope_jr/hope_jr_arm.py:67-74 | src/lerobot/robots/hope_jr/hope_jr_hand.py:102-109 | src/lerobot/robots/koch_follower/koch_follower.py:68-75 | src/lerobot/robots/omx_follower/omx_follower.py:68-75 | src/lerobot/robots/openarm_follower/openarm_follower.py:106-113 | src/lerobot/robots/rebot_b601_follower/rebot_b601_follower.py:100-107 | src/lerobot/robots/unitree_g1/unitree_g1.py:296-303 — before extracting anything, compare `src/lerobot/robots/hope_jr/hope_jr_arm.py` and `src/lerobot/robots/koch_follower/koch_follower.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6–7 lines × 4) REDACTED:153— REDACTED:153-159 | REDACTED:1023-1028 | src/lerobot/policies/pi0/modeling_pi0.py:625-631 | src/lerobot/policies/pi05/modeling_pi05.py:897-903 — `src/lerobot/policies/pi0/modeling_pi0.py` and `src/lerobot/policies/pi05/modeling_pi05.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 547 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 3) src/lerobot/policies/smolvla/modeling_smolvla.py:369— src/lerobot/policies/smolvla/modeling_smolvla.py:369-375 | src/lerobot/policies/vla_jepa/modeling_vla_jepa.py:428-434 | src/lerobot/policies/xvla/modeling_xvla.py:308-314 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Note first that the copies are not typed on the same thing: the declarations holding them bind `name` to `"SmolVLA requires at least one camera.") for` in one and `"Canonical feature names must exactly match policy input_features.") for` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (4–5 lines × 5) src/lerobot/policies/lawam/modeling_lawam.py:322— src/lerobot/policies/lawam/modeling_lawam.py:322-326 | src/lerobot/policies/lingbot_vla_v2/modeling_lingbot_vla_v2.py:2280-2284 | src/lerobot/policies/vla_jepa/modeling_vla_jepa.py:561-565 | src/lerobot/policies/wall_x/modeling_wall_x.py:2021-2027 | src/lerobot/policies/xvla/modeling_xvla.py:460-463 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `batch` to `dict[str, Tensor]` in one and `dict` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/lerobot/policies/lingbot_vla_v2/modeling_lingbot_vla_v2.py:2284` calls `predict_action_chunk` and `src/lerobot/policies/xvla/modeling_xvla.py:463` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 3) src/lerobot/policies/smolvla/smolvlm_with_expert.py:241— src/lerobot/policies/smolvla/smolvlm_with_expert.py:241-245 | src/lerobot/policies/smolvla/smolvlm_with_expert.py:323-327 | src/lerobot/policies/smolvla/smolvlm_with_expert.py:355-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 (7 lines × 9) src/lerobot/policies/cosmos3/configuration_cosmos3.py:534— src/lerobot/policies/cosmos3/configuration_cosmos3.py:534-540 | src/lerobot/policies/eo1/configuration_eo1.py:242-248 | src/lerobot/policies/evo1/configuration_evo1.py:244-250 | src/lerobot/policies/flux3/configuration_flux3.py:359-365 | src/lerobot/policies/lingbot_va/configuration_lingbot_va.py:159-165 | src/lerobot/policies/lingbot_vla_v2/configuration_lingbot_vla_v2.py:331-337 | src/lerobot/policies/vla_jepa/configuration_vla_jepa.py:242-248 | src/lerobot/policies/wall_oss_05/configuration_wall_oss_05.py:198-204 | src/lerobot/policies/wall_x/configuration_wall_x.py:206-212 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 9 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 9 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 4) src/lerobot/policies/evo1/modeling_evo1.py:59— src/lerobot/policies/evo1/modeling_evo1.py:59-69 | src/lerobot/policies/pi0/modeling_pi0.py:986-996 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:954-964 | src/lerobot/policies/smolvla/modeling_smolvla.py:179-192 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
Duplicated block (8 lines × 4) src/lerobot/policies/pi0/configuration_pi0.py:156— src/lerobot/policies/pi0/configuration_pi0.py:156-163 | src/lerobot/policies/pi05/configuration_pi05.py:185-192 | src/lerobot/policies/pi0_fast/configuration_pi0_fast.py:150-157 | src/lerobot/policies/smolvla/configuration_smolvla.py:136-143 — `src/lerobot/policies/pi0/configuration_pi0.py` and `src/lerobot/policies/pi05/configuration_pi05.py` are one unit implemented 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 47 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 5) src/lerobot/robots/hope_jr/hope_jr_arm.py:171— src/lerobot/robots/hope_jr/hope_jr_arm.py:171-175 | src/lerobot/robots/hope_jr/hope_jr_hand.py:190-194 | src/lerobot/robots/koch_follower/koch_follower.py:206-210 | src/lerobot/robots/omx_follower/omx_follower.py:220-224 | src/lerobot/robots/so_follower/so_follower.py:217-221 — before extracting anything, compare `src/lerobot/robots/hope_jr/hope_jr_arm.py` and `src/lerobot/robots/koch_follower/koch_follower.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) src/lerobot/teleoperators/koch_leader/koch_leader.py:69— src/lerobot/teleoperators/koch_leader/koch_leader.py:69-77 | src/lerobot/teleoperators/omx_leader/omx_leader.py:68-76 | src/lerobot/teleoperators/so_leader/so_leader.py:87-95 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (6 lines × 4) src/lerobot/robots/bi_openarm_follower/bi_openarm_follower.py:111— src/lerobot/robots/bi_openarm_follower/bi_openarm_follower.py:111-116 | src/lerobot/robots/bi_rebot_b601_follower/bi_rebot_b601_follower.py:113-118 | src/lerobot/robots/bi_so_follower/bi_so_follower.py:104-109 | src/lerobot/robots/bi_yam_follower/bi_yam_follower.py:81-86 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Near-duplicate member pair (120 shared lines) examples/phone_to_so100/record.py:55— examples/phone_to_so100/record.py:55-212 | examples/so100_to_so100_EE/record.py:52-208 — These two members are variants of one another: 120 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 (172 corresponding lines) · ×1
Edited copy of a member (172 corresponding lines) examples/phone_to_so100/evaluate.py:62— examples/phone_to_so100/evaluate.py:62-233 | examples/so100_to_so100_EE/evaluate.py:62-233 — These two members are one piece of code written twice and then edited apart: 172 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (111 lines × 2) examples/phone_to_so100/evaluate.py:62— examples/phone_to_so100/evaluate.py:62-172 | examples/so100_to_so100_EE/evaluate.py:62-172 — `examples/phone_to_so100/evaluate.py` and `examples/so100_to_so100_EE/evaluate.py` are one unit implemented 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 248 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (66–76 lines × 2) examples/phone_to_so100/rollout.py:57— examples/phone_to_so100/rollout.py:57-122 | examples/so100_to_so100_EE/rollout.py:55-130 — `examples/phone_to_so100/rollout.py` and `examples/so100_to_so100_EE/rollout.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 2 separate duplicated blocks between them, totalling at least 99 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 (65 lines × 3) examples/lekiwi/evaluate.py:100— examples/lekiwi/evaluate.py:100-164 | examples/phone_to_so100/evaluate.py:161-225 | examples/so100_to_so100_EE/evaluate.py:161-225 — `examples/phone_to_so100/evaluate.py` and `examples/so100_to_so100_EE/evaluate.py` are one unit implemented 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 248 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (62–63 lines × 2) examples/phone_to_so100/replay.py:41— examples/phone_to_so100/replay.py:41-102 | examples/so100_to_so100_EE/replay.py:42-104 — `examples/phone_to_so100/replay.py` and `examples/so100_to_so100_EE/replay.py` are one unit implemented 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 109 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 (61–62 lines × 2) examples/tutorial/act/act_training_example.py:39— examples/tutorial/act/act_training_example.py:39-99 | examples/tutorial/diffusion/diffusion_training_example.py:39-100 — `examples/tutorial/act/act_training_example.py` and `examples/tutorial/diffusion/diffusion_training_example.py` are one unit implemented 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 96 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (32–55 lines × 3) examples/phone_to_so100/evaluate.py:76— examples/phone_to_so100/evaluate.py:76-107 | examples/phone_to_so100/record.py:70-124 | examples/so100_to_so100_EE/evaluate.py:76-107 — `examples/phone_to_so100/evaluate.py` and `examples/so100_to_so100_EE/evaluate.py` are one unit implemented 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 248 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `examples/phone_to_so100/evaluate.py:76` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (48–49 lines × 2) examples/tutorial/pi0/using_pi0_example.py:20— examples/tutorial/pi0/using_pi0_example.py:20-68 | examples/tutorial/smolvla/using_smolvla_example.py:20-67 — `examples/tutorial/pi0/using_pi0_example.py` and `examples/tutorial/smolvla/using_smolvla_example.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 1 separate duplicated blocks between them, totalling at least 49 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (45–46 lines × 3) examples/port_datasets/slurm_aggregate_shards.py:93— examples/port_datasets/slurm_aggregate_shards.py:93-137 | examples/port_datasets/slurm_port_shards.py:107-152 | examples/port_datasets/slurm_upload.py:217-261 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `examples/port_datasets/slurm_port_shards.py:107` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (43 lines × 2) examples/phone_to_so100/record.py:120— examples/phone_to_so100/record.py:120-162 | examples/so100_to_so100_EE/record.py:115-157 — `examples/phone_to_so100/record.py` and `examples/so100_to_so100_EE/record.py` are one unit implemented 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 149 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `examples/phone_to_so100/record.py:120` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (34–35 lines × 2) examples/tutorial/act/act_using_example.py:25— examples/tutorial/act/act_using_example.py:25-58 | examples/tutorial/diffusion/diffusion_using_example.py:25-59 — `examples/tutorial/act/act_using_example.py` and `examples/tutorial/diffusion/diffusion_using_example.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 1 separate duplicated blocks between them, totalling at least 35 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `examples/tutorial/diffusion/diffusion_using_example.py:25` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (29 lines × 2) examples/phone_to_so100/record.py:74— examples/phone_to_so100/record.py:74-109 | examples/so100_to_so100_EE/record.py:87-115 — `examples/phone_to_so100/record.py` and `examples/so100_to_so100_EE/record.py` are one unit implemented 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 149 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `examples/phone_to_so100/record.py:74` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–23 lines × 3) examples/lekiwi/rollout.py:47— examples/lekiwi/rollout.py:47-62 | examples/phone_to_so100/rollout.py:93-111 | examples/so100_to_so100_EE/rollout.py:97-119 — `examples/phone_to_so100/rollout.py` and `examples/so100_to_so100_EE/rollout.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 2 separate duplicated blocks between them, totalling at least 99 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `examples/phone_to_so100/rollout.py:93` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (21 lines × 4) examples/training/train_policy.py:95— examples/training/train_policy.py:95-115 | examples/training/train_with_streaming.py:97-117 | examples/tutorial/act/act_training_example.py:74-94 | examples/tutorial/diffusion/diffusion_training_example.py:75-95 — `examples/tutorial/act/act_training_example.py` and `examples/tutorial/diffusion/diffusion_training_example.py` are one unit implemented 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 96 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `examples/tutorial/act/act_training_example.py:97` calls `push_to_hub` and `examples/training/train_policy.py:118` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (20–21 lines × 3) examples/lekiwi/record.py:114— examples/lekiwi/record.py:114-133 | examples/phone_to_so100/record.py:189-208 | examples/so100_to_so100_EE/record.py:184-204 — `examples/phone_to_so100/record.py` and `examples/so100_to_so100_EE/record.py` are one unit implemented 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 149 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `examples/lekiwi/record.py:114` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `examples/lekiwi/record.py:134` calls `disconnect` and `examples/phone_to_so100/record.py:209` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (19 lines × 3) examples/lekiwi/replay.py:37— examples/lekiwi/replay.py:37-55 | examples/phone_to_so100/replay.py:70-88 | examples/so100_to_so100_EE/replay.py:71-89 — `examples/phone_to_so100/replay.py` and `examples/so100_to_so100_EE/replay.py` are one unit implemented 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 109 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `examples/phone_to_so100/replay.py:91` calls `get_observation`, `robot_ee_to_joints_processor` and `examples/lekiwi/replay.py:58` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (4–13 lines × 3) examples/training/train_with_streaming.py:53— examples/training/train_with_streaming.py:53-56 | examples/tutorial/act/act_training_example.py:22-34 | examples/tutorial/diffusion/diffusion_training_example.py:22-34 — `examples/tutorial/act/act_training_example.py` and `examples/tutorial/diffusion/diffusion_training_example.py` are one unit implemented 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 96 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 (30 lines × 3) examples/port_datasets/slurm_aggregate_shards.py:57— examples/port_datasets/slurm_aggregate_shards.py:57-87 | examples/port_datasets/slurm_port_shards.py:67-96 | examples/port_datasets/slurm_upload.py:182-211 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
X15 · Unvalidated length from an untrusted reader· Length read from the parsed input is spent without ever being bounded · ×1
Length read from the parsed input is spent without ever being bounded src/lerobot/streaming/mp4.py:711— `sample_count` is read from the bytes being parsed at line 707 (`struct.unpack_from(">II")`), then used to size a `np.empty` at line 711 — and nowhere in its function is `sample_count` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: the call reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and the reservation either raises `MemoryError` out of a parser whose failure path was written for malformed input, not for hostile input, or succeeds and holds gigabytes for a few bytes on the wire. Bound `sample_count` against the bytes actually remaining and a maximum the format allows before reading.
Duplicated predicate src/lerobot/policies/fastwam/modeling_fastwam.py:261— `"context" not in sample or "context_mask" not in sample` appears character-identically in 2 files — src/lerobot/policies/fastwam/modeling_fastwam.py, src/lerobot/policies/fastwam/wan/modular.py. 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 src/lerobot/policies/molmoact2/molmoact2_hf_model/image_processing_molmoact2.py:483— `"height" not in size or "width" not in size` appears character-identically in 2 files — src/lerobot/policies/molmoact2/molmoact2_hf_model/image_processing_molmoact2.py, src/lerobot/policies/molmoact2/molmoact2_hf_model/video_processing_molmoact2.py. 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 src/lerobot/policies/common/vla_utils.py:35— `TYPE_CHECKING or _transformers_available` appears character-identically in 50 files — src/lerobot/policies/common/vla_utils.py, src/lerobot/policies/cosmos3/configuration_cosmos3.py, src/lerobot/policies/cosmos3/modeling_cosmos3.py, src/lerobot/policies/cosmos3/processor_cosmos3.py. 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 src/lerobot/policies/molmoact2/modeling_molmoact2.py:192— `_transformers_available and _scipy_available` appears character-identically in 2 files — src/lerobot/policies/molmoact2/modeling_molmoact2.py, src/lerobot/policies/molmoact2/processor_molmoact2.py. 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 src/lerobot/policies/vla_jepa/processor_vla_jepa.py:106— `action is not None and not isinstance(action, torch.Tensor)` appears character-identically in 3 files — src/lerobot/policies/vla_jepa/processor_vla_jepa.py, src/lerobot/processor/converters.py, src/lerobot/processor/device_processor.py. 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 src/lerobot/policies/dm05/modeling_dm05.py:422— `action_feature is not None and action_feature.shape` appears character-identically in 2 files — src/lerobot/policies/dm05/modeling_dm05.py, src/lerobot/policies/molmoact2/modeling_molmoact2.py. 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 src/lerobot/utils/foxglove_visualization.py:238— `arr.ndim == 3 and arr.shape[0] in (1, 3, 4) and arr.shape[-1] not in (1, 3, 4)` appears character-identically in 2 files — src/lerobot/utils/foxglove_visualization.py, src/lerobot/utils/rerun_visualization.py. 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 src/lerobot/policies/g05/modeling_g05.py:117— `attention_mask is not None and attention_mask.ndim == 2` appears character-identically in 2 files — src/lerobot/policies/g05/modeling_g05.py, src/lerobot/policies/wall_x/qwen_model/qwen2_5_vl_moe.py. 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 src/lerobot/remote_inference/client.py:494— `caps.model_action_dim or caps.action_feature.shape[0]` appears character-identically in 2 files — src/lerobot/remote_inference/client.py, src/lerobot/remote_inference/server.py. 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 src/lerobot/rollout/strategies/episodic.py:130— `cfg.display_data and cfg.display_ip is not None and cfg.display_port is not None` appears character-identically in 3 files — src/lerobot/rollout/strategies/episodic.py, src/lerobot/scripts/lerobot_record.py, src/lerobot/scripts/lerobot_teleoperate.py. 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 src/lerobot/rollout/strategies/base.py:66— `cfg.duration > 0 and (time.perf_counter() - start_time) >= cfg.duration` appears character-identically in 4 files — src/lerobot/rollout/strategies/base.py, src/lerobot/rollout/strategies/dagger.py, src/lerobot/rollout/strategies/highlight.py, src/lerobot/rollout/strategies/sentry.py. 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 src/lerobot/rewards/robometer/compute_rabc_weights.py:155— `config.default_task or "perform the task"` appears character-identically in 2 files — src/lerobot/rewards/robometer/compute_rabc_weights.py, src/lerobot/rewards/topreward/compute_rabc_weights.py. 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 src/lerobot/policies/dm05/processor_dm05.py:343— `config.device is None or config.input_features is None or config.output_features is None` appears character-identically in 2 files — src/lerobot/policies/dm05/processor_dm05.py, src/lerobot/processor/factory.py. 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 src/lerobot/policies/evo1/processor_evo1.py:236— `config.input_features is None or config.output_features is None` appears character-identically in 3 files — src/lerobot/policies/evo1/processor_evo1.py, src/lerobot/policies/lawam/processor_lawam.py, src/lerobot/policies/vla_jepa/processor_vla_jepa.py. 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 src/lerobot/policies/fastwam/wan/modular.py:377— `context_mask is not None and context_mask.dim() == 3` appears character-identically in 2 files — src/lerobot/policies/fastwam/wan/modular.py, src/lerobot/policies/fastwam/wan/video_dit.py. 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 src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:1242— `control_mode.startswith(CONTROL_START_TOKEN) and control_mode.endswith(CONTROL_END_TOKEN)` appears character-identically in 2 files — src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py, src/lerobot/policies/molmoact2/processor_molmoact2.py. 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 src/lerobot/policies/fineart_vla/processor_fineart_vla.py:443— `dataset_meta or getattr(config, "_runtime_dataset_meta", None)` appears character-identically in 2 files — src/lerobot/policies/fineart_vla/processor_fineart_vla.py, src/lerobot/policies/groot/processor_groot.py. 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 src/lerobot/datasets/dataset_writer.py:141— `depth_encoder or depth_encoder_defaults()` appears character-identically in 2 files — src/lerobot/datasets/dataset_writer.py, src/lerobot/datasets/video_utils.py. 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 src/lerobot/motors/damiao/damiao.py:803— `display_values and not user_pressed_enter` appears character-identically in 4 files — src/lerobot/motors/damiao/damiao.py, src/lerobot/motors/robstride/robstride.py, src/lerobot/teleoperators/homunculus/homunculus_arm.py, src/lerobot/teleoperators/homunculus/homunculus_glove.py. 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 REDACTED:134— `dist.is_available() and dist.is_initialized()` appears character-identically in 2 files — REDACTED, src/lerobot/policies/praxis/praxis_core/train/moe.py. 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 src/lerobot/policies/molmoact2/modeling_molmoact2.py:448— `end_ptr < len(ends) and ends[end_ptr] < start` appears character-identically in 2 files — src/lerobot/policies/molmoact2/modeling_molmoact2.py, src/lerobot/policies/molmoact2/processor_molmoact2.py. 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 src/lerobot/policies/lawam/modeling_lawam.py:262— `feature.kind != "tensor" or feature.shape != tuple(policy_feature.shape)` appears character-identically in 5 files — src/lerobot/policies/lawam/modeling_lawam.py, src/lerobot/policies/pretrained.py, src/lerobot/policies/smolvla/modeling_smolvla.py, src/lerobot/policies/vla_jepa/modeling_vla_jepa.py. 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 src/lerobot/policies/lawam/modeling_lawam.py:254— `feature.kind != "tensor" or len(feature.shape) != 1` appears character-identically in 2 files — src/lerobot/policies/lawam/modeling_lawam.py, src/lerobot/policies/xvla/modeling_xvla.py. 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 src/lerobot/cameras/opencv/camera_opencv.py:443— `h != self.capture_height or w != self.capture_width` appears character-identically in 2 files — src/lerobot/cameras/opencv/camera_opencv.py, src/lerobot/cameras/realsense/camera_realsense.py. 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 src/lerobot/policies/pi0/modeling_pi0.py:358— `hasattr(self, "gradient_checkpointing") and self.gradient_checkpointing and self.training` appears character-identically in 2 files — src/lerobot/policies/pi0/modeling_pi0.py, src/lerobot/policies/pi05/modeling_pi05.py. 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.
Interpolated log message defeats structured logging src/lerobot/utils/cycle_timer.py:407— `warning` at line 407 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging src/lerobot/utils/device_utils.py:68— `warning` at line 68 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging src/lerobot/utils/device_utils.py:101— `warning` at line 101 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging src/lerobot/utils/device_utils.py:104— `warning` at line 104 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging src/lerobot/utils/import_utils.py:84— `debug` at line 84 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging src/lerobot/utils/import_utils.py:102— `warning` at line 102 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging src/lerobot/utils/process.py:90— `info` at line 90 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging src/lerobot/utils/utils.py:391— `info` at line 391 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging src/lerobot/utils/utils.py:393— `info` at line 393 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging REDACTED:81— `info` at line 81 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging REDACTED:83— `debug` at line 83 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging REDACTED:85— `info` at line 85 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging REDACTED:92— `debug` at line 92 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging REDACTED:97— `debug` at line 97 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging REDACTED:100— `debug` at line 100 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging REDACTED:111— `debug` at line 111 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging REDACTED:113— `warning` at line 113 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging src/lerobot/teleoperators/teleoperator.py:182— `info` at line 182 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging src/lerobot/teleoperators/teleoperator.py:187— `info` at line 187 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging src/lerobot/teleoperators/unitree_g1/exo_calib.py:176— `info` at line 176 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging src/lerobot/teleoperators/unitree_g1/exo_calib.py:292— `info` at line 292 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging src/lerobot/teleoperators/unitree_g1/exo_calib.py:308— `info` at line 308 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging src/lerobot/teleoperators/unitree_g1/exo_calib.py:314— `info` at line 314 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging src/lerobot/teleoperators/unitree_g1/exo_calib.py:324— `info` at line 324 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging src/lerobot/teleoperators/unitree_g1/exo_calib.py:347— `info` at line 347 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
Orphaned file src/lerobot/teleoperators/gamepad/gamepad_utils.py: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 src/lerobot/motors/calibration_gui.py: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 src/lerobot/policies/xvla/soft_transformer.py: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 src/lerobot/rl/crop_dataset_roi.py: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 src/lerobot/policies/rtc/modeling_rtc.py: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 src/lerobot/rewards/classifier/modeling_classifier.py: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 src/lerobot/policies/tdmpc/configuration_tdmpc.py: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 src/lerobot/policies/rtc/debug_tracker.py: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 src/lerobot/policies/act/configuration_act.py: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 src/lerobot/robots/reachy2/robot_reachy2.py: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 src/lerobot/processor/env_processor.py: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 src/lerobot/processor/observation_processor.py: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 src/lerobot/rl/joint_observations_processor.py: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 REDACTED: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 src/lerobot/policies/smolvla/configuration_smolvla.py: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 src/lerobot/teleoperators/reachy2_teleoperator/reachy2_teleoperator.py: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 src/lerobot/policies/pi0/processor_pi0.py: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 src/lerobot/rl/learner_service.py: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 src/lerobot/robots/reachy2/configuration_reachy2.py: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 src/lerobot/policies/rtc/debug_visualizer.py: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 src/lerobot/policies/xvla/utils.py: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 src/lerobot/cameras/opencv/configuration_opencv.py: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 src/lerobot/cameras/reachy2_camera/configuration_reachy2_camera.py: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 src/lerobot/processor/policy_robot_bridge.py: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 src/lerobot/rewards/classifier/processor_classifier.py: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.
README/code drift docs/source/envhub_isaaclab_arena.mdx:5— docs/source/envhub_isaaclab_arena.mdx names Python 3.11, but pyproject.toml:32 requires `requires-python = ">=3.12"`: the package does not install on Python 3.11. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/source/envhub_leisaac.mdx:5— docs/source/envhub_leisaac.mdx names Python 3.11, but pyproject.toml:32 requires `requires-python = ">=3.12"`: the package does not install on Python 3.11. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/source/robocolosseum.mdx:113— docs/source/robocolosseum.mdx names Python 3.10 or later, but pyproject.toml:32 requires `requires-python = ">=3.12"`: the package does not install on Python 3.10. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/source/vlabench.mdx:60— docs/source/vlabench.mdx names Python 3.10 or later, but pyproject.toml:32 requires `requires-python = ">=3.12"`: the package does not install on Python 3.10. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift src/lerobot/policies/dm05/README.md:6— src/lerobot/policies/dm05/README.md links to `./dm05.mdx`, but `src/lerobot/policies/dm05/dm05.mdx` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 12 significant file(s) lose their only recent owner: src/lerobot/utils/cycle_timer.py, src/lerobot/utils/keyboard_input.py, src/lerobot/rollout/strategies/sentry.py, src/lerobot/rollout/strategies/highlight.py, src/lerobot/policies/wall_x/qwen_model/vision_attention.py, src/lerobot/teleoperators/openarm_leader/openarm_leader.py, src/lerobot/robots/bi_so_follower/bi_so_follower.py, src/lerobot/teleoperators/gamepad/teleop_gamepad.py (+4 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 5 significant file(s) lose their only recent owner: src/lerobot/annotations/steerable_pipeline/modules/plan_subtasks_memory.py, src/lerobot/streaming/episode_cache.py, src/lerobot/streaming/range_fetch.py, src/lerobot/datasets/recipe.py, src/lerobot/annotations/steerable_pipeline/writer.py. 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: src/lerobot/configs/accelerator.py, src/lerobot/distributed/checkpoint.py, src/lerobot/distributed/factory.py, src/lerobot/distributed/utils.py. Pair on, review, or document these before any departure.
X23 · Unguarded diagnostic materialisation· Diagnostic log message is built whether or not it is wanted · ×2
Diagnostic log message is built whether or not it is wanted src/lerobot/policies/groot/action_head/cross_attention_dit.py:273— `debug` at line 273 is called with an argument built by `sum(p.numel() for p in self.parameters() if p.requires_grad)` (line 275), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on.
Diagnostic log message is built whether or not it is wanted src/lerobot/policies/groot/action_head/cross_attention_dit.py:434— `debug` at line 434 is called with an argument built by `sum(p.numel() for p in self.parameters() if p.requires_grad)` (line 436), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 6 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 (29 single-owned of 482 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; 482 of the 661 production source files in this repository met that bar). They are anonymized user #4 (2 file(s)), anonymized user #5 (2 file(s)), anonymized user #6 (1 file(s)), anonymized user #7 (1 file(s)), anonymized user #8 (1 file(s)), anonymized user #9 (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: src/lerobot/policies/multi_task_dit/configuration_multi_task_dit.py, src/lerobot/policies/multi_task_dit/processor_multi_task_dit.py, src/lerobot/robots/unitree_g1/controllers/gr00t_locomotion.py, src/lerobot/robots/unitree_g1/controllers/holosoma_locomotion.py, src/lerobot/configs/video.py, src/lerobot/policies/fastwam/processor_fastwam.py, src/lerobot/utils/eval_stats.py, src/lerobot/teleoperators/phone/phone_processor.py.
No ADRs found pyproject.toml:404— No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `pyproject.toml` makes this repository a deployable product (line 404).
D34 · Knowledge Freshness· Further orphaned files (smaller) · ×1
Further orphaned files (smaller) — 27 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: src/lerobot/teleoperators/gamepad/gamepad_utils.py, src/lerobot/motors/calibration_gui.py, src/lerobot/policies/xvla/soft_transformer.py, src/lerobot/rl/crop_dataset_roi.py, src/lerobot/policies/rtc/modeling_rtc.py, src/lerobot/rewards/classifier/modeling_classifier.py, src/lerobot/policies/tdmpc/configuration_tdmpc.py, src/lerobot/policies/rtc/debug_tracker.py (and 19 more) (30 orphaned of 482 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; 482 of the 661 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
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.
No SAST .github/workflows/benchmark_tests.yml:40— No static application security testing detected. For this repository's stack, add bandit, `semgrep --config=p/python`, or CodeQL's python pack as a CI step. What was searched, so you can tell an absence from a miss: the 15 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
P3 · Security & performance tooling· Dependabot does not watch uv · ×1
Dependabot does not watch uv .github/dependabot.yml:2— `.github/dependabot.yml` schedules updates, but no `package-ecosystem` entry covers `uv`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entry to the `updates:` list.
No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
Outdated: eclipse-zenoh — `eclipse-zenoh` is pinned to 1.10.1, but 1.10.2 is the current stable release on PyPI. An exact pin never moves on its own, so this repository installs 1.10.1 until the declaration is edited.
Outdated: huggingface-hub — `huggingface-hub` is pinned to 1.33.0, but 2.4.0 is the current stable release on PyPI. An exact pin never moves on its own, so this repository installs 1.33.0 until the declaration is edited. This crosses a major version, so it is a migration rather than a bump.
Outdated: msgpack — `msgpack` is pinned to 1.2.3, but 1.2.4 is the current stable release on PyPI. An exact pin never moves on its own, so this repository installs 1.2.3 until the declaration is edited.
Outdated: numpy — `numpy` is pinned to 2.2.6, but 2.5.5 is the current stable release on PyPI. An exact pin never moves on its own, so this repository installs 2.2.6 until the declaration is edited.
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.
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. semgrep could not parse 11 file(s) — `src/lerobot/datasets/aggregate.py`, `src/lerobot/datasets/lance_backend.py`, `src/lerobot/motors/motors_bus.py`, `src/lerobot/policies/wall_oss_05/modeling_wall_oss_05.py`, `src/lerobot/processor/pipeline.py`, … (+6 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
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.
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.
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.
Run 01a1e438-1331-79c4-b3b5-365fe2a1b244 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 14 · Warnings: 1336 · Recommendations: 126 · Info: 4 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 16-11-2026 @ 11:57 UTC.
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.