Public report of huggingface/lerobot, published 20 October 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Watchdog 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, 20 October 2026, 18:12 UTC · Survey ID cd_402db2860a88402ebd841fc412ad1ea1
huggingface/lerobot
Measured 20 October 2026, 18:04 UTC, at code version afbf3f1
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 11 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: 164,326 lines of product code in 1 project, tests not counted · Estimated rebuild effort: about 1.8 person-years · Weakest lens: Maturity, 48
Findings by how serious they are
12 critical1074 serious136 minor
13 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
20 October 2026, 18:04 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds Watchdog. It is open to any tool that
implements it, and today Watchdog is the only one that does.
The score is deterministic, which means the same code always gets the same score. Watchdog works it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
53of 57 dimensions measured by tools. The other 4 are advisory notes from an AI model, which explain the code but don't count towards the score.
1209of 1222 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.
57dimensions across 5 lenses, read from 164,326 lines of product code in 1 project.
huggingface/lerobot scores 58 out of 100 and is rated Adequate, while four of its five lenses score higher still: Architecture at 87, Code Health at 65 and Production Readiness at 62, all rated Adequate, and Security and Compliance at 81, rated Strong. The project hasn't declared a stable release yet, so its lenses are rated against a lower bar than a released product's, while the score itself is worked out as for any repository.
The score is lower than those four because the weakest lens counts most, and here that is Maturity, which scores 48 and is rated Adequate. Its Documentation accuracy dimension scores 0 out of 10, and until that reaches 4, Maturity can't be rated higher than Adequate. The first actions are to resolve the 1 No ADRs found finding(s) in ADR Quality and to reconcile the README with reality: docs/source/act.mdx links to `./installation`, but `docs/source/installation` does not exist; docs/source/action_representations.mdx links to `./introduction_processors`, but `docs/source/introduction_processors` does not exist; docs/source/annotation_pipeline.mdx links to `./language_and_recipes`, but `docs/source/language_and_recipes` does not exist; docs/source/annotation_pipeline.mdx links to `./tools`, but `docs/source/tools` does not exist; docs/source/annotation_pipeline.mdx documents the environment variable `TOOL_REGISTRY`, but no code, script or configuration file names it, and if Maturity rose to 70, the score would rise from 58 to about 66.
12 findings are critical: five in IaC & Container Security, four in Dependency Vulnerabilities, one in Knowledge Freshness, one in Static Analysis (SAST) and one in Test Reliability.
Watchdog couldn't measure 13 dimensions in this code, among them Code Coverage, Internal API Consistency and Navigability, so they are left out of the score. The product code is 164,326 lines, which would take an estimated 1.8 person-years, around €260,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 Maturity rose from 48 to 70, the lowest score rated Strong, the score would rise from 58 to about 66.
Code composition: what the lines of code are
Product code 66%Tests 34%
New since the last survey: 159 findings
These 159 critical or serious findings weren't in the previous survey, on 4 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
God Classes · FileTooLong: transforms/transforms.py src/lerobot/transforms/transforms.py
Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 74 findings
These 74 critical or serious findings were in the previous survey, on 4 October 2026, and are gone from this one.
€87,000 to €440,000, for 1,449 to 4,598 hours of work, about 1.8 person-years for 1 to 4 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.8 at a score of 58. 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: 164,326 lines of product code
How the estimate is made: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 1 No ADRs found finding(s) in ADR Quality.
Raises the score by about 10 points · Low effort · ADR Quality
2
Reconcile the README with reality: docs/source/act.mdx links to `./installation`, but `docs/source/installation` does not exist; docs/source/action_representations.mdx links to `./introduction_processors`, but `docs/source/introduction_processors` does not exist; docs/source/annotation_pipeline.mdx links to `./language_and_recipes`, but `docs/source/language_and_recipes` does not exist; docs/source/annotation_pipeline.mdx links to `./tools`, but `docs/source/tools` does not exist; docs/source/annotation_pipeline.mdx documents the environment variable `TOOL_REGISTRY`, but no code, script or configuration file names it.
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 €260,000 to build again, about 1.8 person-years of work. Its weakest lens is Maturity, at 48 (Weak). Maturity is about how well the project explains and looks after itself, which decides whether a new developer, or a new supplier, can take over. Because the weakest lens counts most in the score, work on Maturity also moves the score most.
Based on: the rebuild estimate · the Maturity grade · how much each lens counts
What to do: Start with the Maturity 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 10 points for low effort, because it clears the 1 ADR Quality findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.7 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 3% to 7% on every change. The history of the code shows how much it changes: about 166,467 lines over the last 90 days, which is about 675,116 lines a year. At that pace, the extra work comes to an estimated 53.8 to 322.6 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change; 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.
522 modules, with 704 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; 482 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.
src.lerobot.annotations.steerable_pipeline.config uses src.lerobot.configs.default, so a change to src.lerobot.configs.default can break src.lerobot.annotations.steerable_pipeline.config, while a change to src.lerobot.annotations.steerable_pipeline.config can't break src.lerobot.configs.default.
Position
Below the diagonal: src.lerobot.annotations.steerable_pipeline.config uses a module listed above it, which is the healthy direction.
src.lerobot.configs.policies uses src.lerobot.optim.optimizers, so a change to src.lerobot.optim.optimizers can break src.lerobot.configs.policies, while a change to src.lerobot.configs.policies can't break src.lerobot.optim.optimizers.
Position
Below the diagonal: src.lerobot.configs.policies uses a module listed above it, which is the healthy direction.
src.lerobot.configs.policies uses src.lerobot.utils.hub, so a change to src.lerobot.utils.hub can break src.lerobot.configs.policies, while a change to src.lerobot.configs.policies can't break src.lerobot.utils.hub.
Position
Below the diagonal: src.lerobot.configs.policies uses a module listed above it, which is the healthy direction.
src.lerobot.configs.rewards uses src.lerobot.utils.hub, so a change to src.lerobot.utils.hub can break src.lerobot.configs.rewards, while a change to src.lerobot.configs.rewards can't break src.lerobot.utils.hub.
Position
Below the diagonal: src.lerobot.configs.rewards uses a module listed above it, which is the healthy direction.
src.lerobot.configs.train uses src.lerobot.configs.default, so a change to src.lerobot.configs.default can break src.lerobot.configs.train, while a change to src.lerobot.configs.train can't break src.lerobot.configs.default.
Position
Below the diagonal: src.lerobot.configs.train uses a module listed above it, which is the healthy direction.
src.lerobot.configs.train uses src.lerobot.utils.hub, so a change to src.lerobot.utils.hub can break src.lerobot.configs.train, while a change to src.lerobot.configs.train can't break src.lerobot.utils.hub.
Position
Below the diagonal: src.lerobot.configs.train uses a module listed above it, which is the healthy direction.
src.lerobot.inference.contracts uses src.lerobot.policies.chunk, so a change to src.lerobot.policies.chunk can break src.lerobot.inference.contracts, while a change to src.lerobot.inference.contracts can't break src.lerobot.policies.chunk.
Position
Below the diagonal: src.lerobot.inference.contracts uses a module listed above it, which is the healthy direction.
src.lerobot.processor.pipeline uses src.lerobot.lerobot_types, so a change to src.lerobot.lerobot_types can break src.lerobot.processor.pipeline, while a change to src.lerobot.processor.pipeline can't break src.lerobot.lerobot_types.
Position
Below the diagonal: src.lerobot.processor.pipeline uses a module listed above it, which is the healthy direction.
src.lerobot.processor.pipeline uses src.lerobot.utils.hub, so a change to src.lerobot.utils.hub can break src.lerobot.processor.pipeline, while a change to src.lerobot.processor.pipeline can't break src.lerobot.utils.hub.
Position
Below the diagonal: src.lerobot.processor.pipeline uses a module listed above it, which is the healthy direction.
src.lerobot.rl.algorithms.base uses src.lerobot.utils.hub, so a change to src.lerobot.utils.hub can break src.lerobot.rl.algorithms.base, while a change to src.lerobot.rl.algorithms.base can't break src.lerobot.utils.hub.
Position
Below the diagonal: src.lerobot.rl.algorithms.base uses a module listed above it, which is the healthy direction.
src.lerobot.robots.robot uses src.lerobot.motors.motors_bus, so a change to src.lerobot.motors.motors_bus can break src.lerobot.robots.robot, while a change to src.lerobot.robots.robot can't break src.lerobot.motors.motors_bus.
Position
Below the diagonal: src.lerobot.robots.robot uses a module listed above it, which is the healthy direction.
src.lerobot.robots.robot uses src.lerobot.robots.config, so a change to src.lerobot.robots.config can break src.lerobot.robots.robot, while a change to src.lerobot.robots.robot can't break src.lerobot.robots.config.
Position
Below the diagonal: src.lerobot.robots.robot uses a module listed above it, which is the healthy direction.
src.lerobot.teleoperators.teleoperator uses src.lerobot.motors.motors_bus, so a change to src.lerobot.motors.motors_bus can break src.lerobot.teleoperators.teleoperator, while a change to src.lerobot.teleoperators.teleoperator can't break src.lerobot.motors.motors_bus.
Position
Below the diagonal: src.lerobot.teleoperators.teleoperator uses a module listed above it, which is the healthy direction.
src.lerobot.teleoperators.teleoperator uses src.lerobot.teleoperators.config, so a change to src.lerobot.teleoperators.config can break src.lerobot.teleoperators.teleoperator, while a change to src.lerobot.teleoperators.teleoperator can't break src.lerobot.teleoperators.config.
Position
Below the diagonal: src.lerobot.teleoperators.teleoperator uses a module listed above it, which is the healthy direction.
src.lerobot.datasets uses src.lerobot.datasets.dataset_metadata, so a change to src.lerobot.datasets.dataset_metadata can break src.lerobot.datasets, while a change to src.lerobot.datasets can't break src.lerobot.datasets.dataset_metadata.
Position
Below the diagonal: src.lerobot.datasets uses a module listed above it, which is the healthy direction.
src.lerobot.datasets uses src.lerobot.datasets.lerobot_dataset, so a change to src.lerobot.datasets.lerobot_dataset can break src.lerobot.datasets, while a change to src.lerobot.datasets can't break src.lerobot.datasets.lerobot_dataset.
Position
Below the diagonal: src.lerobot.datasets uses a module listed above it, which is the healthy direction.
src.lerobot.datasets uses src.lerobot.configs.train, so a change to src.lerobot.configs.train can break src.lerobot.datasets, while a change to src.lerobot.datasets can't break src.lerobot.configs.train.
Position
Below the diagonal: src.lerobot.datasets uses a module listed above it, which is the healthy direction.
src.lerobot.datasets uses src.lerobot.processor.pipeline, so a change to src.lerobot.processor.pipeline can break src.lerobot.datasets, while a change to src.lerobot.datasets can't break src.lerobot.processor.pipeline.
Position
Below the diagonal: src.lerobot.datasets uses a module listed above it, which is the healthy direction.
src.lerobot.inference.base uses src.lerobot.inference.contracts, so a change to src.lerobot.inference.contracts can break src.lerobot.inference.base, while a change to src.lerobot.inference.base can't break src.lerobot.inference.contracts.
Position
Below the diagonal: src.lerobot.inference.base uses a module listed above it, which is the healthy direction.
src.lerobot.policies.pretrained uses src.lerobot.policies.chunk, so a change to src.lerobot.policies.chunk can break src.lerobot.policies.pretrained, while a change to src.lerobot.policies.pretrained can't break src.lerobot.policies.chunk.
Position
Below the diagonal: src.lerobot.policies.pretrained uses a module listed above it, which is the healthy direction.
src.lerobot.policies.pretrained uses src.lerobot.utils.hub, so a change to src.lerobot.utils.hub can break src.lerobot.policies.pretrained, while a change to src.lerobot.policies.pretrained can't break src.lerobot.utils.hub.
Position
Below the diagonal: src.lerobot.policies.pretrained uses a module listed above it, which is the healthy direction.
src.lerobot.policies.pretrained uses src.lerobot.configs.policies, so a change to src.lerobot.configs.policies can break src.lerobot.policies.pretrained, while a change to src.lerobot.policies.pretrained can't break src.lerobot.configs.policies.
Position
Below the diagonal: src.lerobot.policies.pretrained uses a module listed above it, which is the healthy direction.
src.lerobot.policies.pretrained uses src.lerobot.configs.train, so a change to src.lerobot.configs.train can break src.lerobot.policies.pretrained, while a change to src.lerobot.policies.pretrained can't break src.lerobot.configs.train.
Position
Below the diagonal: src.lerobot.policies.pretrained uses a module listed above it, which is the healthy direction.
src.lerobot.policies.vla_jepa.configuration_vla_jepa uses src.lerobot.optim.optimizers, so a change to src.lerobot.optim.optimizers can break src.lerobot.policies.vla_jepa.configuration_vla_jepa, while a change to src.lerobot.policies.vla_jepa.configuration_vla_jepa can't break src.lerobot.optim.optimizers.
Position
Below the diagonal: src.lerobot.policies.vla_jepa.configuration_vla_jepa uses a module listed above it, which is the healthy direction.
src.lerobot.policies.vla_jepa.configuration_vla_jepa uses src.lerobot.optim.schedulers, so a change to src.lerobot.optim.schedulers can break src.lerobot.policies.vla_jepa.configuration_vla_jepa, while a change to src.lerobot.policies.vla_jepa.configuration_vla_jepa can't break src.lerobot.optim.schedulers.
Position
Below the diagonal: src.lerobot.policies.vla_jepa.configuration_vla_jepa uses a module listed above it, which is the healthy direction.
src.lerobot.policies.vla_jepa.configuration_vla_jepa uses src.lerobot.configs.policies, so a change to src.lerobot.configs.policies can break src.lerobot.policies.vla_jepa.configuration_vla_jepa, while a change to src.lerobot.policies.vla_jepa.configuration_vla_jepa can't break src.lerobot.configs.policies.
Position
Below the diagonal: src.lerobot.policies.vla_jepa.configuration_vla_jepa uses a module listed above it, which is the healthy direction.
src.lerobot.remote_inference uses src.lerobot.policies.chunk, so a change to src.lerobot.policies.chunk can break src.lerobot.remote_inference, while a change to src.lerobot.remote_inference can't break src.lerobot.policies.chunk.
Position
Below the diagonal: src.lerobot.remote_inference uses a module listed above it, which is the healthy direction.
src.lerobot.remote_inference uses src.lerobot.configs.policies, so a change to src.lerobot.configs.policies can break src.lerobot.remote_inference, while a change to src.lerobot.remote_inference can't break src.lerobot.configs.policies.
Position
Below the diagonal: src.lerobot.remote_inference uses a module listed above it, which is the healthy direction.
src.lerobot.remote_inference uses src.lerobot.inference.contracts, so a change to src.lerobot.inference.contracts can break src.lerobot.remote_inference, while a change to src.lerobot.remote_inference can't break src.lerobot.inference.contracts.
Position
Below the diagonal: src.lerobot.remote_inference uses a module listed above it, which is the healthy direction.
src.lerobot.remote_inference.client uses src.lerobot.policies.chunk, so a change to src.lerobot.policies.chunk can break src.lerobot.remote_inference.client, while a change to src.lerobot.remote_inference.client can't break src.lerobot.policies.chunk.
Position
Below the diagonal: src.lerobot.remote_inference.client uses a module listed above it, which is the healthy direction.
src.lerobot.remote_inference.client uses src.lerobot.inference.contracts, so a change to src.lerobot.inference.contracts can break src.lerobot.remote_inference.client, while a change to src.lerobot.remote_inference.client can't break src.lerobot.inference.contracts.
Position
Below the diagonal: src.lerobot.remote_inference.client uses a module listed above it, which is the healthy direction.
src.lerobot.rewards.pretrained uses src.lerobot.utils.hub, so a change to src.lerobot.utils.hub can break src.lerobot.rewards.pretrained, while a change to src.lerobot.rewards.pretrained can't break src.lerobot.utils.hub.
Position
Below the diagonal: src.lerobot.rewards.pretrained uses a module listed above it, which is the healthy direction.
src.lerobot.rewards.pretrained uses src.lerobot.configs.rewards, so a change to src.lerobot.configs.rewards can break src.lerobot.rewards.pretrained, while a change to src.lerobot.rewards.pretrained can't break src.lerobot.configs.rewards.
Position
Below the diagonal: src.lerobot.rewards.pretrained uses a module listed above it, which is the healthy direction.
src.lerobot.rl uses src.lerobot.datasets.lerobot_dataset, so a change to src.lerobot.datasets.lerobot_dataset can break src.lerobot.rl, while a change to src.lerobot.rl can't break src.lerobot.datasets.lerobot_dataset.
Position
Below the diagonal: src.lerobot.rl uses a module listed above it, which is the healthy direction.
src.lerobot.rl uses src.lerobot.envs.configs, so a change to src.lerobot.envs.configs can break src.lerobot.rl, while a change to src.lerobot.rl can't break src.lerobot.envs.configs.
Position
Below the diagonal: src.lerobot.rl uses a module listed above it, which is the healthy direction.
src.lerobot.rl uses src.lerobot.lerobot_types, so a change to src.lerobot.lerobot_types can break src.lerobot.rl, while a change to src.lerobot.rl can't break src.lerobot.lerobot_types.
Position
Below the diagonal: src.lerobot.rl uses a module listed above it, which is the healthy direction.
src.lerobot.rl uses src.lerobot.processor.pipeline, so a change to src.lerobot.processor.pipeline can break src.lerobot.rl, while a change to src.lerobot.rl can't break src.lerobot.processor.pipeline.
Position
Below the diagonal: src.lerobot.rl uses a module listed above it, which is the healthy direction.
src.lerobot.rl uses src.lerobot.rl.algorithms.base, so a change to src.lerobot.rl.algorithms.base can break src.lerobot.rl, while a change to src.lerobot.rl can't break src.lerobot.rl.algorithms.base.
Position
Below the diagonal: src.lerobot.rl uses a module listed above it, which is the healthy direction.
src.lerobot.rl uses src.lerobot.robots.robot, so a change to src.lerobot.robots.robot can break src.lerobot.rl, while a change to src.lerobot.rl can't break src.lerobot.robots.robot.
Position
Below the diagonal: src.lerobot.rl uses a module listed above it, which is the healthy direction.
src.lerobot.rl uses src.lerobot.teleoperators.teleoperator, so a change to src.lerobot.teleoperators.teleoperator can break src.lerobot.rl, while a change to src.lerobot.rl can't break src.lerobot.teleoperators.teleoperator.
Position
Below the diagonal: src.lerobot.rl uses a module listed above it, which is the healthy direction.
src.lerobot.common uses src.lerobot.datasets.lerobot_dataset, so a change to src.lerobot.datasets.lerobot_dataset can break src.lerobot.common, while a change to src.lerobot.common can't break src.lerobot.datasets.lerobot_dataset.
Position
Below the diagonal: src.lerobot.common uses a module listed above it, which is the healthy direction.
src.lerobot.common uses src.lerobot.configs.train, so a change to src.lerobot.configs.train can break src.lerobot.common, while a change to src.lerobot.common can't break src.lerobot.configs.train.
Position
Below the diagonal: src.lerobot.common uses a module listed above it, which is the healthy direction.
src.lerobot.common uses src.lerobot.robots.robot, so a change to src.lerobot.robots.robot can break src.lerobot.common, while a change to src.lerobot.common can't break src.lerobot.robots.robot.
Position
Below the diagonal: src.lerobot.common uses a module listed above it, which is the healthy direction.
src.lerobot.common uses src.lerobot.teleoperators.teleoperator, so a change to src.lerobot.teleoperators.teleoperator can break src.lerobot.common, while a change to src.lerobot.common can't break src.lerobot.teleoperators.teleoperator.
Position
Below the diagonal: src.lerobot.common uses a module listed above it, which is the healthy direction.
src.lerobot.common uses src.lerobot.policies.pretrained, so a change to src.lerobot.policies.pretrained can break src.lerobot.common, while a change to src.lerobot.common can't break src.lerobot.policies.pretrained.
Position
Below the diagonal: src.lerobot.common uses a module listed above it, which is the healthy direction.
src.lerobot.inference uses src.lerobot.policies.chunk, so a change to src.lerobot.policies.chunk can break src.lerobot.inference, while a change to src.lerobot.inference can't break src.lerobot.policies.chunk.
Position
Below the diagonal: src.lerobot.inference uses a module listed above it, which is the healthy direction.
src.lerobot.inference uses src.lerobot.inference.base, so a change to src.lerobot.inference.base can break src.lerobot.inference, while a change to src.lerobot.inference can't break src.lerobot.inference.base.
Position
Below the diagonal: src.lerobot.inference uses a module listed above it, which is the healthy direction.
src.lerobot.inference uses src.lerobot.policies.pretrained, so a change to src.lerobot.policies.pretrained can break src.lerobot.inference, while a change to src.lerobot.inference can't break src.lerobot.policies.pretrained.
Position
Below the diagonal: src.lerobot.inference uses a module listed above it, which is the healthy direction.
src.lerobot.rollout.context uses src.lerobot.rollout.configs, so a change to src.lerobot.rollout.configs can break src.lerobot.rollout.context, while a change to src.lerobot.rollout.context can't break src.lerobot.rollout.configs.
Position
Below the diagonal: src.lerobot.rollout.context uses a module listed above it, which is the healthy direction.
src.lerobot.rollout.context uses src.lerobot.inference.base, so a change to src.lerobot.inference.base can break src.lerobot.rollout.context, while a change to src.lerobot.rollout.context can't break src.lerobot.inference.base.
Position
Below the diagonal: src.lerobot.rollout.context uses a module listed above it, which is the healthy direction.
src.lerobot.scripts uses src.lerobot.configs.default, so a change to src.lerobot.configs.default can break src.lerobot.scripts, while a change to src.lerobot.scripts can't break src.lerobot.configs.default.
Position
Below the diagonal: src.lerobot.scripts uses a module listed above it, which is the healthy direction.
src.lerobot.scripts uses src.lerobot.datasets.lerobot_dataset, so a change to src.lerobot.datasets.lerobot_dataset can break src.lerobot.scripts, while a change to src.lerobot.scripts can't break src.lerobot.datasets.lerobot_dataset.
Position
Below the diagonal: src.lerobot.scripts uses a module listed above it, which is the healthy direction.
src.lerobot.scripts uses src.lerobot.envs.configs, so a change to src.lerobot.envs.configs can break src.lerobot.scripts, while a change to src.lerobot.scripts can't break src.lerobot.envs.configs.
Position
Below the diagonal: src.lerobot.scripts uses a module listed above it, which is the healthy direction.
src.lerobot.scripts uses src.lerobot.rollout.configs, so a change to src.lerobot.rollout.configs can break src.lerobot.scripts, while a change to src.lerobot.scripts can't break src.lerobot.rollout.configs.
Position
Below the diagonal: src.lerobot.scripts uses a module listed above it, which is the healthy direction.
src.lerobot.scripts uses src.lerobot.annotations.steerable_pipeline.config, so a change to src.lerobot.annotations.steerable_pipeline.config can break src.lerobot.scripts, while a change to src.lerobot.scripts can't break src.lerobot.annotations.steerable_pipeline.config.
Position
Below the diagonal: src.lerobot.scripts uses a module listed above it, which is the healthy direction.
src.lerobot.scripts uses src.lerobot.configs.train, so a change to src.lerobot.configs.train can break src.lerobot.scripts, while a change to src.lerobot.scripts can't break src.lerobot.configs.train.
Position
Below the diagonal: src.lerobot.scripts uses a module listed above it, which is the healthy direction.
src.lerobot.scripts uses src.lerobot.robots.robot, so a change to src.lerobot.robots.robot can break src.lerobot.scripts, while a change to src.lerobot.scripts can't break src.lerobot.robots.robot.
Position
Below the diagonal: src.lerobot.scripts uses a module listed above it, which is the healthy direction.
src.lerobot.scripts uses src.lerobot.teleoperators.teleoperator, so a change to src.lerobot.teleoperators.teleoperator can break src.lerobot.scripts, while a change to src.lerobot.scripts can't break src.lerobot.teleoperators.teleoperator.
Position
Below the diagonal: src.lerobot.scripts uses a module listed above it, which is the healthy direction.
src.lerobot.scripts uses src.lerobot.policies.pretrained, so a change to src.lerobot.policies.pretrained can break src.lerobot.scripts, while a change to src.lerobot.scripts can't break src.lerobot.policies.pretrained.
Position
Below the diagonal: src.lerobot.scripts uses a module listed above it, which is the healthy direction.
src.lerobot.rollout uses src.lerobot.policies.chunk, so a change to src.lerobot.policies.chunk can break src.lerobot.rollout, while a change to src.lerobot.rollout can't break src.lerobot.policies.chunk.
Position
Below the diagonal: src.lerobot.rollout uses a module listed above it, which is the healthy direction.
src.lerobot.rollout uses src.lerobot.rollout.configs, so a change to src.lerobot.rollout.configs can break src.lerobot.rollout, while a change to src.lerobot.rollout can't break src.lerobot.rollout.configs.
Position
Below the diagonal: src.lerobot.rollout uses a module listed above it, which is the healthy direction.
src.lerobot.rollout uses src.lerobot.configs.policies, so a change to src.lerobot.configs.policies can break src.lerobot.rollout, while a change to src.lerobot.rollout can't break src.lerobot.configs.policies.
Position
Below the diagonal: src.lerobot.rollout uses a module listed above it, which is the healthy direction.
src.lerobot.rollout uses src.lerobot.robots.robot, so a change to src.lerobot.robots.robot can break src.lerobot.rollout, while a change to src.lerobot.rollout can't break src.lerobot.robots.robot.
Position
Below the diagonal: src.lerobot.rollout uses a module listed above it, which is the healthy direction.
src.lerobot.rollout uses src.lerobot.inference.base, so a change to src.lerobot.inference.base can break src.lerobot.rollout, while a change to src.lerobot.rollout can't break src.lerobot.inference.base.
Position
Below the diagonal: src.lerobot.rollout uses a module listed above it, which is the healthy direction.
src.lerobot.rollout uses src.lerobot.policies.pretrained, so a change to src.lerobot.policies.pretrained can break src.lerobot.rollout, while a change to src.lerobot.rollout can't break src.lerobot.policies.pretrained.
Position
Below the diagonal: src.lerobot.rollout uses a module listed above it, which is the healthy direction.
src.lerobot.rollout uses src.lerobot.rollout.context, so a change to src.lerobot.rollout.context can break src.lerobot.rollout, while a change to src.lerobot.rollout can't break src.lerobot.rollout.context.
Position
Below the diagonal: src.lerobot.rollout uses a module listed above it, which is the healthy direction.
src.lerobot.rollout.strategies.core uses src.lerobot.datasets.lerobot_dataset, so a change to src.lerobot.datasets.lerobot_dataset can break src.lerobot.rollout.strategies.core, while a change to src.lerobot.rollout.strategies.core can't break src.lerobot.datasets.lerobot_dataset.
Position
Below the diagonal: src.lerobot.rollout.strategies.core uses a module listed above it, which is the healthy direction.
src.lerobot.rollout.strategies.core uses src.lerobot.rollout.configs, so a change to src.lerobot.rollout.configs can break src.lerobot.rollout.strategies.core, while a change to src.lerobot.rollout.strategies.core can't break src.lerobot.rollout.configs.
Position
Below the diagonal: src.lerobot.rollout.strategies.core uses a module listed above it, which is the healthy direction.
src.lerobot.rollout.strategies.core uses src.lerobot.teleoperators.teleoperator, so a change to src.lerobot.teleoperators.teleoperator can break src.lerobot.rollout.strategies.core, while a change to src.lerobot.rollout.strategies.core can't break src.lerobot.teleoperators.teleoperator.
Position
Below the diagonal: src.lerobot.rollout.strategies.core uses a module listed above it, which is the healthy direction.
src.lerobot.rollout.strategies.core uses src.lerobot.inference.base, so a change to src.lerobot.inference.base can break src.lerobot.rollout.strategies.core, while a change to src.lerobot.rollout.strategies.core can't break src.lerobot.inference.base.
Position
Below the diagonal: src.lerobot.rollout.strategies.core uses a module listed above it, which is the healthy direction.
src.lerobot.rollout.strategies.core uses src.lerobot.rollout.context, so a change to src.lerobot.rollout.context can break src.lerobot.rollout.strategies.core, while a change to src.lerobot.rollout.strategies.core can't break src.lerobot.rollout.context.
Position
Below the diagonal: src.lerobot.rollout.strategies.core uses a module listed above it, which is the healthy direction.
src.lerobot.rollout.strategies.dagger uses src.lerobot.rollout.configs, so a change to src.lerobot.rollout.configs can break src.lerobot.rollout.strategies.dagger, while a change to src.lerobot.rollout.strategies.dagger can't break src.lerobot.rollout.configs.
Position
Below the diagonal: src.lerobot.rollout.strategies.dagger uses a module listed above it, which is the healthy direction.
src.lerobot.rollout.strategies.dagger uses src.lerobot.teleoperators.teleoperator, so a change to src.lerobot.teleoperators.teleoperator can break src.lerobot.rollout.strategies.dagger, while a change to src.lerobot.rollout.strategies.dagger can't break src.lerobot.teleoperators.teleoperator.
Position
Below the diagonal: src.lerobot.rollout.strategies.dagger uses a module listed above it, which is the healthy direction.
src.lerobot.rollout.strategies.dagger uses src.lerobot.inference.base, so a change to src.lerobot.inference.base can break src.lerobot.rollout.strategies.dagger, while a change to src.lerobot.rollout.strategies.dagger can't break src.lerobot.inference.base.
Position
Below the diagonal: src.lerobot.rollout.strategies.dagger uses a module listed above it, which is the healthy direction.
src.lerobot.rollout.strategies.dagger uses src.lerobot.rollout.context, so a change to src.lerobot.rollout.context can break src.lerobot.rollout.strategies.dagger, while a change to src.lerobot.rollout.strategies.dagger can't break src.lerobot.rollout.context.
Position
Below the diagonal: src.lerobot.rollout.strategies.dagger uses a module listed above it, which is the healthy direction.
src.lerobot.rollout.strategies.dagger uses src.lerobot.rollout.strategies.core, so a change to src.lerobot.rollout.strategies.core can break src.lerobot.rollout.strategies.dagger, while a change to src.lerobot.rollout.strategies.dagger can't break src.lerobot.rollout.strategies.core.
Position
Below the diagonal: src.lerobot.rollout.strategies.dagger uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 65% · Adequate · gated by D2, X4 ·
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
42
High / Critical
A03:2025 — Software Supply Chain Failures
11
High / Critical
A05:2025 — Injection
8
High / Critical
Roadmap
First, address the missing Architecture Decision Records by documenting key design choices and resolving the single gap in ADR quality. Next, reconcile documentation accuracy by fixing broken links in the source files and removing references to non-existent resources or variables. Finally, ensure knowledge freshness by cleaning up orphaned items in action_hub.py and update the README to clearly explain how to run the test suite.
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.
Reconcile the README with reality: docs/source/act.mdx links to `./installation`, but `docs/source/installation` does not exist; docs/source/action_representations.mdx links to `./introduction_processors`, but `docs/source/introduction_processors` does not exist; docs/source/annotation_pipeline.mdx links to `./language_and_recipes`, but `docs/source/language_and_recipes` does not exist; docs/source/annotation_pipeline.mdx links to `./tools`, but `docs/source/tools` does not exist; docs/source/annotation_pipeline.mdx documents the environment variable `TOOL_REGISTRY`, but no code, script or configuration file names it.
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.
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
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 — 12
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 — 1074
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 — 136
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
Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 53 of 57 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 4 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 57 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, 1209 of 1222 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, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — 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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT 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. To have real coverage read, produce a coverage report in a standard format (`coverage run -m pytest` then `coverage xml`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures. You can widen what we reach: optional: produce a coverage report in a standard format (`coverage run -m pytest` then `coverage xml`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then the real number is read on the next scan.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This repository declares 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.
D12 Dependency Hygiene — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. This repository's 19 shipped Python distribution(s) across 1 manifest(s) WERE read; what went unanswered is the currency half, because it grades an EXACT pin against the newest release and every declaration here is a floor or a range — which installs the newest release it admits and so cannot be behind one. So pypi.org was never asked. This is a true statement about the repository, and the healthy one, NOT a gap on our side: no reader we could write would find a currency question here.
D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 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.
D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `src/lerobot/datasets/aggregate.py`, `src/lerobot/datasets/lance_backend.py`, `src/lerobot/motors/motors_bus.py`, `src/lerobot/processor/pipeline.py`, `src/lerobot/rewards/sarm/sarm_utils.py`, … (+2 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.
AX6 Interface segregation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
AXR1 Runtime accessibility — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via Dockerfile (REDACTED). docker build failed (exit 1) — DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
Install the buildx component to build images with BuildKit:
https://docs.docker.com/go/bui…; runtime evidence skipped.
C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and no C#, F#, JavaScript/TypeScript, Dart, Ruby or Scala was found, and this repository's Python is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and no C#, JavaScript/TypeScript, Java, Dart, Ruby or Scala was found, and this repository's Python is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
M4 Documentation accuracy — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 137 further occurrence(s) are not listed individually; the score already reflects all 177.
S1 Web-Security Posture — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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.
X16 Unfloored truncation loop — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X18 Disposal-pattern correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala or PHP was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X29 Per-element action decided by a fixed element — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, 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 — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 545 further occurrence(s) are not listed individually; the score already reflects all 585.
X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax and MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, and Kotlin source only, and no C# was loaded, no TypeScript was found, and this repository's Python is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
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 is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a 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: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
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.
The LLM boundary
LLM-set scores this run (4): D19, D21, D26, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.
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.
147 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was lerobot_train.train at 107. 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 16). 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.
+ 142 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 107). — Refactoring it lifts Cyclomatic Complexity from 5.8 to about 6.5/10.
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
+ 296 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 208). — Refactoring it lifts Cognitive Complexity from 2.0 to about 3.3/10.
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
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 47 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 (47 warning-level).
Resolve the 7 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 (7 warning-level).
Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
298 duplicated block group(s) detected. A further 19 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 28 of the 317 are in trees this repository does not ship — vendored, example/demo, 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.
+ 132 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 20 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with dataset_tools.py (2), modeling_pi0.py (2), damiao.py (2). — One of this dimension's main actionable groups (20 warning-level).
Resolve the 17 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with modeling_molmoact2.py (3), configs.py, modeling_act.py. — One of this dimension's main actionable groups (17 warning-level).
Resolve the 16 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with robot.py (2), modeling_eo1.py, modular.py. — One of this dimension's main actionable groups (16 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
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).
Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
3856 test methods: 3839 unit, 17 integration, 0 BDD, 0 e2e. The Python suite contributes 3856 test function(s) across 282 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only.
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 62 shipped Python distribution(s) use a banned license. Licences were resolved from PyPI over the distributions a consumer installs — this repository's 19 declared runtime requirement(s) closed transitively over each distribution's published `requires_dist` (43 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. 8 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 (19×107=2033); src/lerobot/rollout/context.py (18×32=576); src/lerobot/policies/factory.py (14×37=518) Repeated repair below the complexity floor: src/lerobot/cameras/realsense/camera_realsense.py (4 of 7 changes were fixes); src/lerobot/robots/so_follower/robot_kinematic_processor.py (3 of 4 changes were fixes); src/lerobot/datasets/aggregate.py (3 of 4 changes were fixes)
Resolve the 38 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 (38 warning-level).
Resolve the 3 Repeated repair finding(s) in Churn × Complexity Hotspots — start with camera_realsense.py, robot_kinematic_processor.py, aggregate.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.1 / 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.
38 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 415 of the 576 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.
136 deducted task-comment markers across 164326 LoC (0.1/KLoC) → score 9.8. 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 129 TodoComment finding(s) in Explicit Debt — start with REDACTED (11), test_datasets.py (10), test_policies.py (5). — One of this dimension's main actionable groups (129 warning-level).
Resolve the 5 HackComment finding(s) in Explicit Debt — start with rewards.py, eval.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 modeling_wall_x.py, lerobot_eval.py. — One of this dimension's main actionable groups (2 warning-level).
Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.
The repository's root README and the docs/README both provide excellent overview, installation, usage, contribution, and license information. The docker/README is focused on containerization (pre-built images, quick start with GPU, Dockerfiles) but does not contradict or overshadow the broader project documentation. All documents are clipped by the scanner at a fixed byte budget before any section becomes unverifiable; internal jargon and unshown sections were never flagged as defects. The repository's READMEs are well-structured and complete within their scope: each directory's README documents itself (EO-1, EVO1, FastWAM, FineART-VLA, FLUX 3 Action, GROOT, LaWAM, LingBot-VA, MolmoAct2, multitask DiT policy) rather than the repository as a whole. The model-overview sections for each policy describe its architecture and LeRobot integration (policy type, processors, attention backend), with accompanying figures and citations; installation requirements are explicit for each directory's dependencies. The repository's README files are clear and well-structured for the directories they document: each README is a focused overview of its own directory (e.g. π₀.₅ Hugging Face port, Real-Time Chunking RTC module, SmolVLA paper, Temporal Difference Learning for MDP control). The architecture/design docs (20 markdown files) provide deeper structure and are not shown in the summary. All four visible READMEs cover what they claim: each has an overview paragraph, a comparison table, a working-example section, citations, and a license; none is missing any of the standard sections for its directory.
Documentation: no project overviewsrc/lerobot/policies/fastwam/README.md
What to do
Resolve the 1 Documentation finding(s) in Documentation Quality — start with README.md. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d19_recommendation.md · top locations in Appendix A, every location in findings.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: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.
1 of 1 build units (Python) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
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).
8 finding(s): 0 critical, 1 high, 6 medium, 1 low. semgrep hit a parse error in 7 file(s) — `src/lerobot/datasets/aggregate.py` (line 56, line 57, line 76), `src/lerobot/datasets/lance_backend.py` (line 97, lines 101–104, line 820), `src/lerobot/motors/motors_bus.py` (line 44, line 45), `src/lerobot/processor/pipeline.py` (line 78, line 266, lines 270–273, …), `src/lerobot/rewards/sarm/sarm_utils.py` (line 23, line 24), … (+2 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 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 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (4 warning-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.
Resolve the 3 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
Resolve the 1 High vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 3 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (3). — One of this dimension's main actionable groups (3 warning-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 37 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (12), REDACTED (3), REDACTED (3). — One of this dimension's main actionable groups (37 warning-level).
Resolve the 5 High IaC finding(s) in IaC & Container Security — start with REDACTED (3), REDACTED, REDACTED. — One of this dimension's main actionable groups (5 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.
14 of 415 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/xvla/action_hub.py. Counted over 415 of the 576 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Resolve the 1 Orphaned knowledge finding(s) in Knowledge Freshness — start with action_hub.py. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 13 Orphaned file finding(s) in Knowledge Freshness — start with soft_transformer.py, configuration_tdmpc.py, debug_tracker.py. — One of this dimension's main actionable groups (13 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 4 Change coupling finding(s) in Change Coupling — start with lerobot_replay.py, so_follower.py, lekiwi.py. — One of this dimension's main actionable groups (4 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. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.
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 19 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.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
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.
Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
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 README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
docs/source/act.mdx links to `./installation`, but `docs/source/installation` 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. — docs/source/act.mdx:49
docs/source/action_representations.mdx links to `./introduction_processors`, but `docs/source/introduction_processors` 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. — docs/source/action_representations.mdx:228
docs/source/annotation_pipeline.mdx links to `./language_and_recipes`, but `docs/source/language_and_recipes` 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. — docs/source/annotation_pipeline.mdx:6
docs/source/annotation_pipeline.mdx links to `./tools`, but `docs/source/tools` 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. — docs/source/annotation_pipeline.mdx:99
docs/source/annotation_pipeline.mdx documents the environment variable `TOOL_REGISTRY`, but no code, script or configuration file names it. 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/annotation_pipeline.mdx:107
docs/source/annotation_pipeline.mdx names `src/lerobot/tools/`, but no file or folder `src/lerobot/tools` exists. 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/annotation_pipeline.mdx:107
docs/source/bring_your_own_policies.mdx links to `./multi_gpu_training#sharded-training-fsdp`, but `docs/source/multi_gpu_training` 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. — docs/source/bring_your_own_policies.mdx:167
docs/source/bring_your_own_policies.mdx links to `./contributing`, but `docs/source/contributing` 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. — docs/source/bring_your_own_policies.mdx:407
docs/source/bring_your_own_policies.mdx links to `./libero`, but `docs/source/libero` 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. — docs/source/bring_your_own_policies.mdx:474
docs/source/cameras.mdx links to `./video_encoding_parameters#depth-streams`, but `docs/source/video_encoding_parameters` 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. — docs/source/cameras.mdx:179
docs/source/dm05.mdx names `lerobot/dm05_base`, but no file or folder `lerobot/dm05_base` exists. 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/dm05.mdx:20
docs/source/dm05.mdx names `lerobot/libero`, but no file or folder `lerobot/libero` exists. 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/dm05.mdx:63
docs/source/dm05.mdx links to `./action_representations#using-relative-actions-in-lerobot`, but `docs/source/action_representations` 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. — docs/source/dm05.mdx:84
docs/source/dm05.mdx names `lerobot/dm05_libero`, but no file or folder `lerobot/dm05_libero` exists. 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/dm05.mdx:88
docs/source/earthrover_mini_plus.mdx documents the environment variable `MAP_ZOOM_LEVEL`, but no code, script or configuration file names it. 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/earthrover_mini_plus.mdx:40
docs/source/earthrover_mini_plus.mdx documents the environment variable `IMAGE_QUALITY`, but no code, script or configuration file names it. 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/earthrover_mini_plus.mdx:44
docs/source/earthrover_mini_plus.mdx documents the environment variable `IMAGE_FORMAT`, but no code, script or configuration file names it. 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/earthrover_mini_plus.mdx:47
docs/source/earthrover_mini_plus.mdx links to `./installation`, but `docs/source/installation` 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. — docs/source/earthrover_mini_plus.mdx:67
docs/source/envhub_isaaclab_arena.mdx documents the environment variable `PRIVACY_CONSENT`, but no code, script or configuration file names it. 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:44
docs/source/envhub_isaaclab_arena.mdx runs `./isaaclab.sh -i`, but `isaaclab.sh` 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. — docs/source/envhub_isaaclab_arena.mdx:50
docs/source/envhub_isaaclab_arena.mdx documents the environment variable `TORCH_COMPILE_DISABLE`, but no code, script or configuration file names it. 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:122
docs/source/envhub_isaaclab_arena.mdx documents the environment variable `TORCHINDUCTOR_DISABLE`, but no code, script or configuration file names it. 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:122
docs/source/envhub_isaaclab_arena.mdx links to `./smolvla`, but `docs/source/smolvla` 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. — docs/source/envhub_isaaclab_arena.mdx:194
docs/source/envhub_isaaclab_arena.mdx links to `./pi05`, but `docs/source/pi05` 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. — docs/source/envhub_isaaclab_arena.mdx:195
docs/source/envhub_isaaclab_arena.mdx links to `./groot`, but `docs/source/groot` 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. — docs/source/envhub_isaaclab_arena.mdx:196
docs/source/envhub_isaaclab_arena.mdx links to `./envhub#step-3-upload-to-the-hub`, but `docs/source/envhub` 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. — docs/source/envhub_isaaclab_arena.mdx:316
docs/source/eo1.mdx links to `./installation`, but `docs/source/installation` 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. — docs/source/eo1.mdx:29
docs/source/eo1.mdx names `lerobot/eo1-base`, but no file or folder `lerobot/eo1-base` exists. 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/eo1.mdx:70
docs/source/eo1.mdx links to `./language_and_recipes`, but `docs/source/language_and_recipes` 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. — docs/source/eo1.mdx:157
docs/source/evo1.mdx links to `./installation`, but `docs/source/installation` 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. — docs/source/evo1.mdx:22
docs/source/evo1.mdx names `train_config.json`, but no file or folder `train_config.json` exists. 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/evo1.mdx:180
docs/source/evo1.mdx documents the environment variable `VLM_DIR`, but no code, script or configuration file names it. 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/evo1.mdx:191
docs/source/fineart_vla.mdx links to `./pi05`, but `docs/source/pi05` 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. — docs/source/fineart_vla.mdx:5
docs/source/fineart_vla.mdx links to `./annotation_pipeline`, but `docs/source/annotation_pipeline` 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. — docs/source/fineart_vla.mdx:93
docs/source/fineart_vla.mdx links to `./language_and_recipes`, but `docs/source/language_and_recipes` 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. — docs/source/fineart_vla.mdx:94
docs/source/fineart_vla.mdx links to `./inference#interactive-language-control`, but `docs/source/inference` 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. — docs/source/fineart_vla.mdx:229
docs/source/groot.mdx links to `./libero`, but `docs/source/libero` 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. — docs/source/groot.mdx:110
docs/source/hardware_guide.mdx links to `./hilserl`, but `docs/source/hilserl` 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. — docs/source/hardware_guide.mdx:18
docs/source/hardware_guide.mdx links to `./multi_gpu_training`, but `docs/source/multi_gpu_training` 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. — docs/source/hardware_guide.mdx:55
docs/source/hardware_guide.mdx links to `./il_robots#train-using-hugging-face-jobs`, but `docs/source/il_robots` 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. — docs/source/hardware_guide.mdx:102
What to do
Reconcile the README with reality: docs/source/act.mdx links to `./installation`, but `docs/source/installation` does not exist; docs/source/action_representations.mdx links to `./introduction_processors`, but `docs/source/introduction_processors` does not exist; docs/source/annotation_pipeline.mdx links to `./language_and_recipes`, but `docs/source/language_and_recipes` does not exist; docs/source/annotation_pipeline.mdx links to `./tools`, but `docs/source/tools` does not exist; docs/source/annotation_pipeline.mdx documents the environment variable `TOOL_REGISTRY`, but no code, script or configuration file names it.
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 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 105471 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.
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 `pip` — 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.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
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.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
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 664 (`struct.unpack_from(">II")`), then used to size a `np.empty` at line 668 — 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:668
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.7 / 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.
`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
`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
`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
`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
`unwrap_scalar` is public and takes `value: Any` from its caller, and it calls itself at line 185 (`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:185
`flatten_dict` is public and takes `d: dict[str, Any]` from its caller, and it calls itself at line 250 (`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:250
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 a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.
Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.
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.
`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. (×11) — REDACTED:468, src/lerobot/cameras/realsense/camera_realsense.py:472, src/lerobot/datasets/pyav_utils.py:68, …
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/cameras/camera.py:75, src/lerobot/robots/robot.py:91, src/lerobot/teleoperators/teleoperator.py:87
`except (AttributeError, 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. — src/lerobot/envs/utils.py:176
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 (caught, then discarded)
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.
`exception` at line 191 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.exception("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.exception("order moved", order_id=order_id, status=status)` with structlog. — src/lerobot/cameras/opencv/camera_opencv.py:191
`info` at line 195 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/cameras/opencv/camera_opencv.py:195
`warning` at line 281 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/cameras/opencv/camera_opencv.py:281
`warning` at line 402 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/cameras/opencv/camera_opencv.py:402
`debug` at line 413 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/cameras/opencv/camera_opencv.py:413
`warning` at line 490 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/cameras/opencv/camera_opencv.py:490
`warning` at line 512 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/cameras/opencv/camera_opencv.py:512
`warning` at line 540 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/cameras/opencv/camera_opencv.py:540
`info` at line 634 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/cameras/opencv/camera_opencv.py:634
`info` at line 119 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/cameras/reachy2_camera/reachy2_camera.py:119
`warning` at line 146 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/cameras/reachy2_camera/reachy2_camera.py:146
`debug` at line 184 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/cameras/reachy2_camera/reachy2_camera.py:184
`info` at line 247 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/cameras/reachy2_camera/reachy2_camera.py:247
`info` at line 186 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/cameras/realsense/camera_realsense.py:186
`warning` at line 190 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/cameras/realsense/camera_realsense.py:190
`exception` at line 248 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.exception("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.exception("order moved", order_id=order_id, status=status)` with structlog. — src/lerobot/cameras/realsense/camera_realsense.py:248
`info` at line 276 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/cameras/realsense/camera_realsense.py:276
`info` at line 298 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/cameras/realsense/camera_realsense.py:298
`warning` at line 301 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/cameras/realsense/camera_realsense.py:301
`info` at line 514 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/cameras/realsense/camera_realsense.py:514
`warning` at line 516 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/cameras/realsense/camera_realsense.py:516
`info` at line 523 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/cameras/realsense/camera_realsense.py:523
`info` at line 527 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/cameras/realsense/camera_realsense.py:527
`info` at line 534 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/cameras/realsense/camera_realsense.py:534
`warning` at line 536 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/cameras/realsense/camera_realsense.py:536
`info` at line 543 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/cameras/realsense/camera_realsense.py:543
`warning` at line 562 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/cameras/realsense/camera_realsense.py:562
`warning` at line 605 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/cameras/realsense/camera_realsense.py:605
`warning` at line 610 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/cameras/realsense/camera_realsense.py:610
`debug` at line 620 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/cameras/realsense/camera_realsense.py:620
`warning` at line 718 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/cameras/realsense/camera_realsense.py:718
`warning` at line 739 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/cameras/realsense/camera_realsense.py:739
`warning` at line 769 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/cameras/realsense/camera_realsense.py:769
`info` at line 916 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/cameras/realsense/camera_realsense.py:916
`warning` at line 82 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/cameras/zmq/image_server.py:82
`info` 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.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/cameras/zmq/image_server.py:111
`info` at line 124 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. (×2) — src/lerobot/cameras/zmq/image_server.py:124, src/lerobot/cameras/zmq/camera_zmq.py:124
`info` at line 140 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/cameras/zmq/image_server.py:140
`debug` at line 163 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/cameras/zmq/image_server.py:163
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 — 25 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.
AC7 A11y enforcement — 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
AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
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 — docker build failed (exit 1) — DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
Install the buildx component to build images with BuildKit:
https://docs.docker.com/go/bui…; 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 — ~85736 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.
D12 Dependency Hygiene — Dependency currency not established — no declaration carries an exact pin to grade
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.
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. 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 — No inline comments to assess — comment value is not applicable here.
D25 ADR Conformance — no ADRs to check
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.py), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D32 Data Compliance (PII/GDPR) — 7 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
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 (185 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 and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the 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 — no coverage report found on disk — produce a coverage report in a standard format (`coverage run -m pytest` then `coverage xml`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for a pytest-benchmark or pytest-codspeed dependency with tests taking the `benchmark` fixture, an asv.conf.json with its `time_`/`mem_`/`peakmem_` benchmarks, or a pyperf Runner, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
PF2 Allocation hygiene — Not applicable: Python runs on a garbage-collected runtime that gives a program no allocation-control idiom to choose on a hot path — no pools, stack allocation or value types — so allocation awareness is not something this code can be rated on.
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.
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.
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.
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.)
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.
TodoComment examples/lekiwi/evaluate.py:82— # TODO(Steven): Update this example to use pipelines — 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 examples/port_datasets/slurm_upload.py:137— # TODO: every 100 chunks super_squach_commits() — 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/cameras/utils.py:29— # TODO(Steven): Consider just using the make_device_from_device_class for all types — 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/robots/utils.py:28— # TODO(Steven): Consider just using the make_device_from_device_class for all types — 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/teleoperators/utils.py:37— # TODO(Steven): Consider just using the make_device_from_device_class for all types — 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/common/wandb_utils.py:106— # TODO(rcadene): try set to True — 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/common/wandb_utils.py:108— # TODO(rcadene): split train and eval, and run async eval with job_type="eval" — 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/configs/video.py:95— # TODO(CarolinePascal): add torchcodec support + find a way to unify the — 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/configs/policies.py:74— # TODO: rename; shadows HubMixin.push_to_hub() — 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/datasets/video_utils.py:205— # TODO(rcadene): also load audio stream at the same time — 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/datasets/video_utils.py:1154— # TODO(rcadene, lhoestq): move to Hugging Face `datasets` repo — 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/datasets/multi_dataset.py:97— # TODO(rcadene, aliberts): We should not perform this aggregation for datasets — 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/datasets/image_writer.py:79— # TODO(CarolinePascal): 4 dimensions RGB-D images — 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/datasets/feature_utils.py:435— # TODO(aliberts): Add option to use existing episode_index — 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/datasets/factory.py:204— # TODO(aliberts): add proper support for multi dataset — 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/datasets/dataset_tools.py:1683— # TODO: enable image and video stats re-computation — 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/datasets/aggregate.py:115— # TODO(CarolinePascal): make this variable once we have support for other video backends. — 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/datasets/aggregate.py:554— # TODO(CarolinePascal): Move the check before the loop to avoid failing in the middle + add possibility to re-encode the video if the check fails — 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/envs/utils.py:69— # TODO(jadechoghari, imstevenpmwork): refactor this to use features from the environment (no hardcoding) — 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/envs/utils.py:85— # TODO(aliberts, rcadene): use transforms.ToTensor()? — 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/envs/utils.py:153— # TODO(jadechoghari, imstevenpmwork): remove this hardcoding of keys and just use the nested keys as is — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment src/lerobot/envs/factory.py:90— # TODO: (jadechoghari): deprecate string API and remove this check — 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/motors/robstride/robstride.py:15— # TODO(Virgile) : Robustify mode control , only the MIT protocole is implemented for now — 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/policies/utils.py:101— # TODO(Steven): Move this function to a proper preprocessor step — 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/policies/utils.py:201— # TODO(Steven): Check if these steps are already in all postprocessor policies — 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 — 3812 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3312 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 — 1919 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1419 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: molmoact2/modeling_molmoact2.py src/lerobot/policies/molmoact2/modeling_molmoact2.py— FileTooLong — 1683 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1183 over it, 3.37× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: wan/modular.py src/lerobot/policies/fastwam/wan/modular.py— FileTooLong — 1564 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1064 over it, 3.13× 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 — 1436 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 936 over it, 2.87× 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 — 1222 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 722 over it, 2.44× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED REDACTED— FileTooLong — 1200 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 700 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: datasets/dataset_tools.py src/lerobot/datasets/dataset_tools.py— FileTooLong — 1195 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 695 over it, 2.39× 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 — 1174 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 674 over it, 2.35× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: 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 — 854 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 354 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 — 825 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 325 over it, 1.65× 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 — 799 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 299 over it, 1.60× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: scripts/lerobot_train.py src/lerobot/scripts/lerobot_train.py— FileTooLong — 785 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 285 over it, 1.57× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: pi0_fast/modeling_pi0_fast.py src/lerobot/policies/pi0_fast/modeling_pi0_fast.py— FileTooLong — 776 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 276 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: datasets/video_utils.py src/lerobot/datasets/video_utils.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: 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.
FileTooLong: robstride/robstride.py src/lerobot/motors/robstride/robstride.py— FileTooLong — 710 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 210 over it, 1.42× 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: streaming/mp4.py src/lerobot/streaming/mp4.py— FileTooLong — 696 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 196 over it, 1.39× 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: envs/configs.py src/lerobot/envs/configs.py— FileTooLong — 661 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 161 over it, 1.32× 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: motors/motors_bus.py src/lerobot/motors/motors_bus.py— FileTooLong — 654 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 154 over it, 1.31× 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:545— src/lerobot/scripts/lerobot_train.py changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 107 in lerobot_train.train at line 545. 6 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-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 16:32:12 +02:00' --until='2026-10-20 16:32:12 +02: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:432— src/lerobot/rollout/context.py changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in context.build_rollout_context at line 432. 8 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-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 16:32:12 +02:00' --until='2026-10-20 16:32:12 +02: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/policies/factory.py src/lerobot/policies/factory.py:221— src/lerobot/policies/factory.py changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 37 in factory.make_policy at line 221. 6 of those changes were fix/bug commits, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 16:32:12 +02:00' --until='2026-10-20 16:32:12 +02: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: src/lerobot/scripts/lerobot_eval.py src/lerobot/scripts/lerobot_eval.py:168— src/lerobot/scripts/lerobot_eval.py changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in lerobot_eval.rollout at line 168. 4 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-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 16:32:12 +02:00' --until='2026-10-20 16:32:12 +02: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/rollout/configs.py src/lerobot/rollout/configs.py:348— src/lerobot/rollout/configs.py changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in RolloutConfig.__post_init__ at line 348. 3 of those changes were fix/bug commits, and the other 7 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 16:32:12 +02:00' --until='2026-10-20 16:32:12 +02: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/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 32 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-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 16:32:12 +02:00' --until='2026-10-20 16:32:12 +02: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/configs/train.py src/lerobot/configs/train.py:262— src/lerobot/configs/train.py changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in TrainPipelineConfig.validate at line 262. 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-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 16:32:12 +02:00' --until='2026-10-20 16:32:12 +02: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/policies/wall_x/modeling_wall_x.py src/lerobot/policies/wall_x/modeling_wall_x.py:1052— src/lerobot/policies/wall_x/modeling_wall_x.py changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 46 in Qwen2_5_VLMoEForAction.predict at line 1052. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 16:32:12 +02:00' --until='2026-10-20 16:32:12 +02: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/policies/vla_jepa/modeling_vla_jepa.py src/lerobot/policies/vla_jepa/modeling_vla_jepa.py:440— src/lerobot/policies/vla_jepa/modeling_vla_jepa.py changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in VLAJEPAPolicy._prepare_model_inputs at line 440. 4 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-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 16:32:12 +02:00' --until='2026-10-20 16:32:12 +02:00' --full-history --no-merges -- src/lerobot/policies/vla_jepa/modeling_vla_jepa.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/configs/default.py src/lerobot/configs/default.py:80— src/lerobot/configs/default.py changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in DatasetConfig.__post_init__ at line 80. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 16:32:12 +02:00' --until='2026-10-20 16:32:12 +02:00' --full-history --no-merges -- src/lerobot/configs/default.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:481— src/lerobot/datasets/streaming_dataset.py changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in StreamingLeRobotDataset._iter_once at line 481. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 16:32:12 +02:00' --until='2026-10-20 16:32:12 +02: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/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-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 16:32:12 +02:00' --until='2026-10-20 16:32:12 +02: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:1104— 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 1104. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 16:32:12 +02:00' --until='2026-10-20 16:32:12 +02: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/factory.py src/lerobot/datasets/factory.py:39— src/lerobot/datasets/factory.py changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in factory.resolve_delta_timestamps at line 39. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 16:32:12 +02:00' --until='2026-10-20 16:32:12 +02: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/episodic.py src/lerobot/rollout/strategies/episodic.py:107— 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 107. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 16:32:12 +02:00' --until='2026-10-20 16:32:12 +02: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/datasets/dataset_tools.py src/lerobot/datasets/dataset_tools.py:1725— src/lerobot/datasets/dataset_tools.py changed 6 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 1725. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 16:32:12 +02:00' --until='2026-10-20 16:32:12 +02: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/rollout/strategies/dagger.py src/lerobot/rollout/strategies/dagger.py:348— src/lerobot/rollout/strategies/dagger.py changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in DAggerStrategy._run_continuous at line 348. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 16:32:12 +02:00' --until='2026-10-20 16:32:12 +02: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/scripts/lerobot_record.py src/lerobot/scripts/lerobot_record.py:386— 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 386. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 16:32:12 +02:00' --until='2026-10-20 16:32:12 +02: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/dataset_writer.py src/lerobot/datasets/dataset_writer.py:271— src/lerobot/datasets/dataset_writer.py changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in DatasetWriter.save_episode at line 271. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 16:32:12 +02:00' --until='2026-10-20 16:32:12 +02:00' --full-history --no-merges -- src/lerobot/datasets/dataset_writer.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/robots/unitree_g1/unitree_g1.py src/lerobot/robots/unitree_g1/unitree_g1.py:381— src/lerobot/robots/unitree_g1/unitree_g1.py changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in UnitreeG1.connect at line 381. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 16:32:12 +02:00' --until='2026-10-20 16:32:12 +02:00' --full-history --no-merges -- src/lerobot/robots/unitree_g1/unitree_g1.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:827— src/lerobot/datasets/video_utils.py changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in _CameraEncoderThread.run at line 827. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 16:32:12 +02:00' --until='2026-10-20 16:32:12 +02: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/eo1/processor_eo1.py src/lerobot/policies/eo1/processor_eo1.py:90— 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 90. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 16:32:12 +02:00' --until='2026-10-20 16:32:12 +02: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/datasets/lance_backend.py src/lerobot/datasets/lance_backend.py:132— src/lerobot/datasets/lance_backend.py changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in LanceDatasetReader.__init__ at line 132. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 16:32:12 +02:00' --until='2026-10-20 16:32:12 +02: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/policies/molmoact2/processor_molmoact2.py src/lerobot/policies/molmoact2/processor_molmoact2.py:938— src/lerobot/policies/molmoact2/processor_molmoact2.py changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in MolmoAct2PackInputsProcessorStep.__call__ at line 938. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 16:32:12 +02:00' --until='2026-10-20 16:32:12 +02:00' --full-history --no-merges -- src/lerobot/policies/molmoact2/processor_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.
Hotspot: src/lerobot/policies/molmoact2/configuration_molmoact2.py src/lerobot/policies/molmoact2/configuration_molmoact2.py:399— src/lerobot/policies/molmoact2/configuration_molmoact2.py changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in MolmoAct2Config.__post_init__ at line 399. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 16:32:12 +02:00' --until='2026-10-20 16:32:12 +02:00' --full-history --no-merges -- src/lerobot/policies/molmoact2/configuration_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 (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:595— src/lerobot/datasets/dataset_tools.py:595-602 | src/lerobot/datasets/dataset_tools.py:610-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 (8 lines × 2) src/lerobot/datasets/dataset_tools.py:807— src/lerobot/datasets/dataset_tools.py:807-814 | src/lerobot/datasets/dataset_tools.py:842-849 — both copies are in the same file, so extract the block into 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:1634— src/lerobot/policies/molmoact2/modeling_molmoact2.py:1634-1641 | src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:4040-4047 — 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 549 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 549 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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/rewards/sarm/modeling_sarm.py:157— src/lerobot/rewards/sarm/modeling_sarm.py:157-164 | src/lerobot/rewards/sarm/modeling_sarm.py:308-315 — both copies are in the same file, so extract the block into 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/robots/so_follower/robot_kinematic_processor.py:360— src/lerobot/robots/so_follower/robot_kinematic_processor.py:360-367 | src/lerobot/robots/so_follower/robot_kinematic_processor.py:640-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 (8 lines × 2) src/lerobot/rollout/context.py:407— src/lerobot/rollout/context.py:407-415 | src/lerobot/scripts/lerobot_record.py:469-476 — 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:407` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 lines × 2) 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 9 separate duplicated blocks between them, totalling at least 155 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/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 11 separate duplicated blocks between them, totalling at least 157 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 11 separate duplicated blocks between them, totalling at least 157 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 (8 lines × 2) src/lerobot/policies/pretrained.py:100— src/lerobot/policies/pretrained.py:100-107 | src/lerobot/rewards/pretrained.py:46-53 — 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/envs/configs.py:365— src/lerobot/envs/configs.py:365-370 | src/lerobot/envs/configs.py:372-377 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (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/diffusion/modeling_diffusion.py:550— src/lerobot/policies/diffusion/modeling_diffusion.py:550-555 | src/lerobot/policies/vqbet/modeling_vqbet.py:705-710 — 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 (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:401-406 — 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/rl/actor.py:253— src/lerobot/rl/actor.py:253-258 | src/lerobot/rl/learner.py:318-323 — 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/robots/robot.py:58— src/lerobot/robots/robot.py:58-63 | src/lerobot/teleoperators/teleoperator.py:54-59 — before extracting anything, compare `src/lerobot/robots/robot.py` and `src/lerobot/teleoperators/teleoperator.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/robots/robot.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 (6 lines × 2) src/lerobot/scripts/lerobot_dataset_viz.py:241— src/lerobot/scripts/lerobot_dataset_viz.py:241-246 | src/lerobot/utils/foxglove_visualization.py:470-475 — 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/teleoperators/homunculus/homunculus_arm.py:82— src/lerobot/teleoperators/homunculus/homunculus_arm.py:82-87 | src/lerobot/teleoperators/homunculus/homunculus_glove.py:108-113 — 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 9 separate duplicated blocks between them, totalling at least 155 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) 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:85— src/lerobot/scripts/lerobot_calibrate.py:85-90 | 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 (9 lines × 2) src/lerobot/policies/eo1/modeling_eo1.py:348— src/lerobot/policies/eo1/modeling_eo1.py:348-356 | src/lerobot/policies/eo1/modeling_eo1.py:358-366 — both copies are in the same file, so extract the block into 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/fastwam/wan/modular.py:1139— src/lerobot/policies/fastwam/wan/modular.py:1139-1147 | src/lerobot/policies/fastwam/wan/modular.py:1151-1159 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:1139` it begins part-way through the construct above it, so those exact lines 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:439— src/lerobot/policies/groot/configuration_groot.py:439-447 | src/lerobot/policies/groot/modeling_groot.py:276-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.
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:2295-2303 — both copies are in the same file, so extract the 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/smolvla/modeling_smolvla.py:357— src/lerobot/policies/smolvla/modeling_smolvla.py:357-365 | src/lerobot/policies/xvla/modeling_xvla.py:296-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.
Duplicated block (9 lines × 2) src/lerobot/policies/wall_x/modeling_wall_x.py:837— src/lerobot/policies/wall_x/modeling_wall_x.py:837-845 | src/lerobot/policies/wall_x/modeling_wall_x.py:1233-1241 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:837` it does not close everything it opens, so those exact lines 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/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:616— src/lerobot/scripts/lerobot_eval.py:616-625 | src/lerobot/scripts/lerobot_eval.py:648-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/scripts/lerobot_eval.py:616` it does not close everything it opens, so those exact lines 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/teleoperators/bi_openarm_leader/bi_openarm_leader.py:97— src/lerobot/teleoperators/bi_openarm_leader/bi_openarm_leader.py:97-105 | src/lerobot/teleoperators/bi_so_leader/bi_so_leader.py:90-98 — 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) 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 11 separate duplicated blocks between them, totalling at least 157 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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:159— src/lerobot/robots/robot.py:159-167 | src/lerobot/teleoperators/teleoperator.py:153-161 — before extracting anything, compare `src/lerobot/robots/robot.py` and `src/lerobot/teleoperators/teleoperator.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) src/lerobot/robots/robot.py:170— src/lerobot/robots/robot.py:170-178 | src/lerobot/teleoperators/teleoperator.py:164-172 — before extracting anything, compare `src/lerobot/robots/robot.py` and `src/lerobot/teleoperators/teleoperator.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
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 (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 11 separate duplicated blocks between them, totalling at least 157 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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/fastwam/modeling_fastwam.py:245— src/lerobot/policies/fastwam/modeling_fastwam.py:245-249 | src/lerobot/policies/pi0/modeling_pi0.py:1086-1094 — 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/pi0/modeling_pi0.py:1082` calls `_rtc_enabled` and `src/lerobot/policies/fastwam/modeling_fastwam.py:244` 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 × 2) src/lerobot/policies/fastwam/wan/modular.py:1174— src/lerobot/policies/fastwam/wan/modular.py:1174-1178 | src/lerobot/policies/fastwam/wan/modular.py:1649-1653 — both copies are in the same file, so extract the block into 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/policies/fastwam/wan/video_dit.py:557— src/lerobot/policies/fastwam/wan/video_dit.py:557-561 | src/lerobot/policies/lawam/vlas/lawam.py:203-208 — 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/lawam/vlas/lawam.py:203` it begins part-way through the construct above it, so those exact lines 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/modeling_lawam.py:320— src/lerobot/policies/lawam/modeling_lawam.py:320-324 | src/lerobot/policies/vla_jepa/modeling_vla_jepa.py:559-563 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) 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/pi05/processor_pi05.py:78— src/lerobot/policies/pi05/processor_pi05.py:78-82 | src/lerobot/policies/pi0_fast/processor_pi0_fast.py:72-76 — `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 88 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (5 lines × 2) src/lerobot/rewards/sarm/compute_rabc_weights.py:681— src/lerobot/rewards/sarm/compute_rabc_weights.py:681-685 | src/lerobot/rewards/sarm/compute_rabc_weights.py:688-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.
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 11 separate duplicated blocks between them, totalling at least 157 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 549 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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/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 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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/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 (11 lines × 2) src/lerobot/motors/motors_bus.py:1008— src/lerobot/motors/motors_bus.py:1008-1018 | src/lerobot/motors/motors_bus.py:1037-1047 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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/eo1/processor_eo1.py:419— src/lerobot/policies/eo1/processor_eo1.py:419-429 | 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 both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) src/lerobot/policies/lawam/lam_core/core/utils/lam_decoder.py:202— src/lerobot/policies/lawam/lam_core/core/utils/lam_decoder.py:202-212 | src/lerobot/policies/lawam/lam_core/core/utils/lam_encoder.py:129-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 both call sites, so a change lands once.
Duplicated block (11 lines × 2) src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:1266— src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:1266-1276 | src/lerobot/policies/molmoact2/processor_molmoact2.py:332-342 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) 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/policies/xvla/processor_xvla.py:116— src/lerobot/policies/xvla/processor_xvla.py:116-126 | src/lerobot/processor/env_processor.py:59-69 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) src/lerobot/robots/earthrover_mini_plus/robot_earthrover_mini_plus.py:404— src/lerobot/robots/earthrover_mini_plus/robot_earthrover_mini_plus.py:404-414 | src/lerobot/robots/earthrover_mini_plus/robot_earthrover_mini_plus.py:428-438 — both copies are in the same file, so extract the block into 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:365— src/lerobot/rollout/strategies/dagger.py:365-375 | src/lerobot/rollout/strategies/dagger.py:554-564 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
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:392— src/lerobot/scripts/lerobot_record.py:392-402 | src/lerobot/scripts/lerobot_teleoperate.py:254-264 — 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:384— src/lerobot/streaming/mp4.py:384-394 | src/lerobot/streaming/mp4.py:417-427 — both copies are in the same file, so extract the block into 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/lawam/modeling_lawam.py:222— src/lerobot/policies/lawam/modeling_lawam.py:222-232 | src/lerobot/policies/vla_jepa/modeling_vla_jepa.py:408-419 — 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:236` calls `validate_features` and `src/lerobot/policies/vla_jepa/modeling_vla_jepa.py:423` 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.
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.
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) 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/envs/utils.py:176— `except (AttributeError, 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/policies/groot/modeling_groot.py:227— `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/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/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/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/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.
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:418-431 — 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:481— src/lerobot/cameras/opencv/camera_opencv.py:481-492 | 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 11 separate duplicated blocks between them, totalling at least 157 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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/molmoact2/modeling_molmoact2.py:1822— src/lerobot/policies/molmoact2/modeling_molmoact2.py:1822-1834 | src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:3120-3131 — 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:1822` it begins part-way through the construct above it, so those exact lines 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 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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:463— src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:463-474 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:555-566 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) src/lerobot/policies/wall_x/modeling_wall_x.py:1716— src/lerobot/policies/wall_x/modeling_wall_x.py:1716-1727 | src/lerobot/policies/wall_x/modeling_wall_x.py:1729-1740 — both copies are in the same file, so extract the block into 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/strategies/dagger.py:826— src/lerobot/rollout/strategies/dagger.py:826-837 | src/lerobot/rollout/strategies/sentry.py:324-335 — 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 9 separate duplicated blocks between them, totalling at least 155 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (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:676— src/lerobot/policies/lingbot_va/modeling_lingbot_va.py:676-693 | src/lerobot/policies/lingbot_va/modeling_lingbot_va.py:694-712 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
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:2996-3013 — 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:197— src/lerobot/rl/actor.py:197-214 | src/lerobot/rl/learner.py:242-259 — 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/rl/actor.py:197` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) src/lerobot/rl/actor.py:506— src/lerobot/rl/actor.py:506-523 | src/lerobot/rl/actor.py:622-639 — both copies are in the same file, so extract the 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:502` calls `info` and `src/lerobot/rl/actor.py:616` 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 9 separate duplicated blocks between them, totalling at least 155 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (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:648-662 — `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 549 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 88 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (15 lines × 2) src/lerobot/policies/smolvla/modeling_smolvla.py:367— src/lerobot/policies/smolvla/modeling_smolvla.py:367-381 | src/lerobot/policies/xvla/modeling_xvla.py:306-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. Note first that the copies are not typed on the same thing: the declarations holding them bind `supplied` to `"SmolVLA requires all nonvisual inputs and only known camera features.") if not any(expected[name].type == FeatureType.VISUAL for name in` in one and `"XVLA requires all nonvisual inputs and only known camera features.") if not any(expected[name].type == FeatureType.VISUAL for name in` 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/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:349— src/lerobot/rollout/strategies/dagger.py:349-363 | src/lerobot/rollout/strategies/dagger.py:535-549 — both copies are in the same file, so extract the 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:552` calls `RuntimeError` and `src/lerobot/rollout/strategies/dagger.py:365` 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/scripts/lerobot_eval.py:907— src/lerobot/scripts/lerobot_eval.py:907-921 | src/lerobot/scripts/lerobot_eval.py:1067-1081 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:907` it begins part-way through the construct above it, so those exact lines 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/teleoperators/homunculus/homunculus_arm.py:49— src/lerobot/teleoperators/homunculus/homunculus_arm.py:49-63 | src/lerobot/teleoperators/homunculus/homunculus_glove.py:75-98 — 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 9 separate duplicated blocks between them, totalling at least 155 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `config` to `HomunculusArmConfig` in one and `HomunculusGloveConfig` 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.
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:123— 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: MolmoAct2ForConditionalGeneration src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:3663— 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) · ×7
Members sharing a duplicated core (4 members, 50+ identical tokens) src/lerobot/envs/libero.py:457— src/lerobot/envs/libero.py:457-532 | src/lerobot/envs/robocasa.py:365-438 | src/lerobot/envs/robomme.py:233-278 | src/lerobot/envs/robotwin.py:591-653 — 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:123— REDACTED:123-185 | REDACTED:1009-1068 | src/lerobot/policies/pi0/modeling_pi0.py:614-660 | src/lerobot/policies/pi05/modeling_pi05.py:885-933 — 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:194— REDACTED:194-225 | src/lerobot/policies/pi0/modeling_pi0.py:734-764 | src/lerobot/policies/pi05/modeling_pi05.py:1032-1062 | src/lerobot/policies/smolvla/modeling_smolvla.py:833-861 — 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/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.
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/pi05/configuration_pi05.py:155— src/lerobot/policies/pi05/configuration_pi05.py:155-171 | src/lerobot/policies/pi0_fast/configuration_pi0_fast.py:120-136 — `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 53 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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:155` it does not close everything it opens, so those exact lines 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:820— src/lerobot/policies/wall_x/modeling_wall_x.py:820-836 | src/lerobot/policies/wall_x/modeling_wall_x.py:1215-1231 — both copies are in the same file, so extract the block into 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 9 separate duplicated blocks between them, totalling at least 155 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) 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/molmoact2/molmoact2_hf_model/image_processing_molmoact2.py:236— src/lerobot/policies/molmoact2/molmoact2_hf_model/image_processing_molmoact2.py:236-249 | src/lerobot/policies/molmoact2/molmoact2_hf_model/video_processing_molmoact2.py:144-157 — 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 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (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/robots/robot.py:181— src/lerobot/robots/robot.py:181-194 | src/lerobot/teleoperators/teleoperator.py:175-188 — before extracting anything, compare `src/lerobot/robots/robot.py` and `src/lerobot/teleoperators/teleoperator.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) src/lerobot/rollout/strategies/episodic.py:273— src/lerobot/rollout/strategies/episodic.py:273-286 | src/lerobot/rollout/strategies/sentry.py:136-149 — 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 (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/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.
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:444-453 — 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:443` 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/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:3592— src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:3592-3601 | 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:109— src/lerobot/policies/pi0/configuration_pi0.py:109-118 | src/lerobot/policies/pi0_fast/configuration_pi0_fast.py:105-114 — 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 46 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:121` calls `ValueError` and `src/lerobot/policies/pi0_fast/configuration_pi0_fast.py:116` 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:115— src/lerobot/policies/pi0/configuration_pi0.py:115-124 | src/lerobot/policies/pi05/configuration_pi05.py:136-145 — `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 46 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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:115` it begins part-way through the construct above it, so those exact lines 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/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.
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/molmoact2/molmoact2_hf_model/image_processing_molmoact2.py:262— src/lerobot/policies/molmoact2/molmoact2_hf_model/image_processing_molmoact2.py:262-268 | src/lerobot/policies/molmoact2/molmoact2_hf_model/video_processing_molmoact2.py:170-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 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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:262` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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/smolvla/modeling_smolvla.py:620— src/lerobot/policies/smolvla/modeling_smolvla.py:620-626 | src/lerobot/policies/smolvla/modeling_smolvla.py:649-655 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/smolvla/modeling_smolvla.py:620` it begins part-way through the construct above it, so those exact lines 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/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/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.
X17 · Uncapped recursion over a caller-supplied document· Recursive walk over a caller-supplied document has no depth cap · ×6
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.
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/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/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/utils/utils.py:185— `unwrap_scalar` is public and takes `value: Any` from its caller, and it calls itself at line 185 (`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:250— `flatten_dict` is public and takes `d: dict[str, Any]` from its caller, and it calls itself at line 250 (`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.
HackComment src/lerobot/configs/rewards.py:153— # 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.
HackComment src/lerobot/configs/eval.py:46— # 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/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 tests/policies/test_policies.py:454— # 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 tests/training/test_visual_validation.py:153— # 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.
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/lawam/vlas/flowmatching_expert.py:451— src/lerobot/policies/lawam/vlas/flowmatching_expert.py:451-457 | src/lerobot/policies/lawam/vlas/flowmatching_expert.py:672-679 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 (7–8 lines × 2) src/lerobot/policies/molmoact2/modeling_molmoact2.py:1200— src/lerobot/policies/molmoact2/modeling_molmoact2.py:1200-1207 | src/lerobot/policies/molmoact2/modeling_molmoact2.py:1213-1219 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–8 lines × 2) src/lerobot/rewards/sarm/modeling_sarm.py:776— src/lerobot/rewards/sarm/modeling_sarm.py:776-783 | src/lerobot/rewards/sarm/modeling_sarm.py:789-795 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
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:506— src/lerobot/rl/actor.py:506-511 | src/lerobot/rl/actor.py:622-627 | src/lerobot/rl/learner.py:501-506 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/lerobot/rl/actor.py:502` calls `info` and `src/lerobot/rl/actor.py:616` 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 549 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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:479— src/lerobot/policies/pi0/modeling_pi0.py:479-484 | src/lerobot/policies/pi05/modeling_pi05.py:720-725 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:277-282 — `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 549 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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:727` calls `_prepare_attention_masks_4d`, `prepare_attention_masks_4d` and `src/lerobot/policies/pi0/modeling_pi0.py:486` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 3) 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 — 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 `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.
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 63% of the time (12 of the 19 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `44831848` feat(robots): add bi manual openarm follower and leader (#2835); `bf337e71` feat(robots): add OpenArm robot & teleoperator (#2795); `b8ec1152` fix(robots): add reachy2 fixes (#2783) — 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: factory.py ↔ lerobot_eval.py src/lerobot/envs/factory.py:1— `src/lerobot/envs/factory.py` and `src/lerobot/scripts/lerobot_eval.py` change together 50% of the time (19 of the 38 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 19 shared commits counted here, the most recent 3 are `5de7aa5a` refactor(envs): move benchmark dispatch into EnvConfig subclasses (#3…; `fc296548` feat(envs): Add NVIDIA IsaacLab-Arena Lerobot (#2699); `6e86a69d` feat(envs): add envs pre-post processor (#2474) — run `git show` on any of them.
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:530— src/lerobot/policies/pi0/modeling_pi0.py:530-548 | src/lerobot/policies/pi05/modeling_pi05.py:806-824 — `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 549 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 116 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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/envs/robocasa.py:421— src/lerobot/envs/robocasa.py:421-438 | src/lerobot/envs/robotwin.py:637-653 — 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/envs/robocasa.py:421` it begins part-way through the construct above it, so those 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/lerobot/envs/robotwin.py:636` calls `list` and `src/lerobot/envs/robocasa.py:420` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17–18 lines × 2) 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 11 separate duplicated blocks between them, totalling at least 157 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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:280— src/lerobot/policies/fastwam/wan/modular.py:280-297 | src/lerobot/policies/fastwam/wan/video_dit.py:297-313 — 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:310— src/lerobot/rollout/strategies/dagger.py:310-327 | src/lerobot/rollout/strategies/highlight.py:211-227 — 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 (14–15 lines × 2) src/lerobot/envs/robocasa.py:400— src/lerobot/envs/robocasa.py:400-414 | src/lerobot/envs/robotwin.py:622-635 — 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/envs/robocasa.py:400` it begins part-way through the construct above it, so those 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/envs/robotwin.py:636` calls `list` and `src/lerobot/envs/robocasa.py:415` 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–15 lines × 2) src/lerobot/motors/damiao/damiao.py:379— src/lerobot/motors/damiao/damiao.py:379-392 | src/lerobot/motors/robstride/robstride.py:465-479 — `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 11 separate duplicated blocks between them, totalling at least 157 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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/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 11 separate duplicated blocks between them, totalling at least 157 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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:176— src/lerobot/policies/pretrained.py:176-189 | src/lerobot/policies/xvla/modeling_xvla.py:493-507 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (13 lines × 2) src/lerobot/policies/fastwam/configuration_fastwam.py:250— src/lerobot/policies/fastwam/configuration_fastwam.py:250-262 | src/lerobot/policies/vla_jepa/configuration_vla_jepa.py:145-157 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (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 8 separate duplicated blocks between them, totalling at least 152 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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:818— src/lerobot/rollout/strategies/dagger.py:818-830 | src/lerobot/rollout/strategies/highlight.py:270-282 — 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:831` calls `clear` and `src/lerobot/rollout/strategies/highlight.py:283` 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:506— src/lerobot/cameras/opencv/camera_opencv.py:506-517 | 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:606— src/lerobot/cameras/opencv/camera_opencv.py:606-617 | 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:150— REDACTED:150-161 | src/lerobot/policies/pi0/modeling_pi0.py:622-633 | src/lerobot/policies/pi05/modeling_pi05.py:895-906 — `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 549 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 8 separate duplicated blocks between them, totalling at least 152 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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.
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.
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/robots/robot.py:91— 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/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.
Repeated repair: src/lerobot/cameras/realsense/camera_realsense.py src/lerobot/cameras/realsense/camera_realsense.py:478— src/lerobot/cameras/realsense/camera_realsense.py changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is RealSenseCamera._configure_sensor_options at line 478), 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(warmup): adding back the no-warmup path in the connect() method of the RealSense camera. (#4301)”; “fix(cameras): D405 RealSense connection timeout on startup (#3894)”; “fix(RGB only): remove the stereo module fallback when setting colors parameters on RealSense cameras (#4225)”; “fix(cameras): release device handle when connect() setup fails (#4187)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 16:32:12 +02:00' --until='2026-10-20 16:32:12 +02:00' --full-history --no-merges -- src/lerobot/cameras/realsense/camera_realsense.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/robots/so_follower/robot_kinematic_processor.py src/lerobot/robots/so_follower/robot_kinematic_processor.py:79— src/lerobot/robots/so_follower/robot_kinematic_processor.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 13 (its worst body is EEReferenceAndDelta.action at line 79), 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: fix phone teleop enable signal, clarify the controls (#4730)”; “fix(so_follower): check the observation for None before copying it (#4255)”; “fix(robot): type FK-to-EE action features as ACTION not STATE (#4213)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 16:32:12 +02:00' --until='2026-10-20 16:32:12 +02:00' --full-history --no-merges -- src/lerobot/robots/so_follower/robot_kinematic_processor.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/datasets/aggregate.py src/lerobot/datasets/aggregate.py:186— src/lerobot/datasets/aggregate.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 13 (its worst body is aggregate.update_meta_data at line 186), 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): validate aggregate root count (#4488)”; “fix(legacy depth markers): unifying legacy depth markers across the codebase (#4428)”; “fix(aggregate stats): fix episode statistics aggregation. Frames and episodes index statistics are offseted and tastk index statistics recomputed from the new labels. (#4276)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 16:32:12 +02:00' --until='2026-10-20 16:32:12 +02:00' --full-history --no-merges -- src/lerobot/datasets/aggregate.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 (19–20 lines × 2) src/lerobot/envs/metaworld.py:292— src/lerobot/envs/metaworld.py:292-310 | src/lerobot/envs/vlabench.py:532-551 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (19–20 lines × 2) src/lerobot/policies/pi0/modeling_pi0.py:674— src/lerobot/policies/pi0/modeling_pi0.py:674-693 | src/lerobot/policies/pi05/modeling_pi05.py:948-966 — `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 549 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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:674` it does not close everything it opens, so those 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 (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:459-476 | 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:210— src/lerobot/policies/xvla/processor_xvla.py:210-227 | src/lerobot/policies/xvla/processor_xvla.py:266-283 | src/lerobot/policies/xvla/processor_xvla.py:339-356 — all 3 copies are in the same file, so extract the block into one function there and call 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 (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:749— src/lerobot/policies/pi0/modeling_pi0.py:749-764 | src/lerobot/policies/pi05/modeling_pi05.py:1047-1062 — `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 549 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 (11–13 lines × 2) src/lerobot/policies/evo1/modeling_evo1.py:521— src/lerobot/policies/evo1/modeling_evo1.py:521-531 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:1202-1214 — 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–13 lines × 2) src/lerobot/policies/lawam/vlas/flowmatching_expert.py:458— src/lerobot/policies/lawam/vlas/flowmatching_expert.py:458-468 | src/lerobot/policies/lawam/vlas/flowmatching_expert.py:680-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.
Duplicated block (11–13 lines × 2) src/lerobot/policies/xvla/processor_xvla.py:144— src/lerobot/policies/xvla/processor_xvla.py:144-154 | 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 (11–12 lines × 2) src/lerobot/envs/metaworld.py:330— src/lerobot/envs/metaworld.py:330-341 | src/lerobot/envs/vlabench.py:579-589 — 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 (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.
FixmeComment src/lerobot/policies/wall_x/modeling_wall_x.py:1567— # 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.
FixmeComment src/lerobot/scripts/lerobot_eval.py:590— # 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.
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:512— 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.
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 11 separate duplicated blocks between them, totalling at least 157 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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:1023— src/lerobot/policies/pi0/modeling_pi0.py:1023-1063 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:991-1032 — 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 280 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:1023` it begins part-way through the construct above it, so those exact lines 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 549 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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:857— src/lerobot/policies/wall_x/modeling_wall_x.py:857-886 | src/lerobot/policies/wall_x/modeling_wall_x.py:1167-1197 — both copies are in the same file, so extract the 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:888` calls `any` and `src/lerobot/policies/wall_x/modeling_wall_x.py:1198` 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:386— src/lerobot/rollout/strategies/dagger.py:386-415 | src/lerobot/rollout/strategies/dagger.py:576-604 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/rollout/strategies/dagger.py:576` it begins part-way through the construct above it, so those 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 8 separate duplicated blocks between them, totalling at least 152 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 lines × 2) src/lerobot/cameras/opencv/camera_opencv.py:586— src/lerobot/cameras/opencv/camera_opencv.py:586-613 | 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:586` it does not close everything it opens, so those 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/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 (24 lines × 2) src/lerobot/policies/pi0/modeling_pi0.py:637— src/lerobot/policies/pi0/modeling_pi0.py:637-660 | src/lerobot/policies/pi05/modeling_pi05.py:910-933 — `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 549 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 (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 116 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 (22 lines × 2) src/lerobot/robots/so_follower/robot_kinematic_processor.py:318— src/lerobot/robots/so_follower/robot_kinematic_processor.py:318-339 | src/lerobot/robots/so_follower/robot_kinematic_processor.py:594-615 — both copies are in the same file, so extract the block into 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 549 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 549 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 × 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:614-634 — `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 549 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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:613` 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 (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 (20 lines × 2) src/lerobot/teleoperators/homunculus/homunculus_arm.py:180— src/lerobot/teleoperators/homunculus/homunculus_arm.py:180-199 | src/lerobot/teleoperators/homunculus/homunculus_glove.py:211-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 9 separate duplicated blocks between them, totalling at least 155 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (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 116 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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:60— src/lerobot/rollout/strategies/base.py:60-76 | src/lerobot/rollout/strategies/highlight.py:114-130 | src/lerobot/rollout/strategies/sentry.py:122-138 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (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 116 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 × 3) src/lerobot/policies/pi0/configuration_pi0.py:134— src/lerobot/policies/pi0/configuration_pi0.py:134-149 | src/lerobot/policies/pi05/configuration_pi05.py:163-178 | src/lerobot/policies/pi0_fast/configuration_pi0_fast.py:128-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 46 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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:134` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 3) src/lerobot/policies/pi0/modeling_pi0.py:872— src/lerobot/policies/pi0/modeling_pi0.py:872-887 | src/lerobot/policies/pi05/modeling_pi05.py:1223-1238 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:871-886 — `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 549 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 × 3) src/lerobot/envs/libero.py:509— src/lerobot/envs/libero.py:509-522 | src/lerobot/envs/robocasa.py:418-432 | src/lerobot/envs/robomme.py:260-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 all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/envs/libero.py:509` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–15 lines × 3) 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 (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 549 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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:329— src/lerobot/rollout/strategies/dagger.py:329-342 | src/lerobot/rollout/strategies/highlight.py:229-242 | src/lerobot/rollout/strategies/sentry.py:284-297 — 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 8 separate duplicated blocks between them, totalling at least 152 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 (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 549 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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:886— src/lerobot/policies/wall_x/modeling_wall_x.py:886-897 | src/lerobot/policies/wall_x/modeling_wall_x.py:921-930 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code 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 × 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 (10–11 lines × 4) src/lerobot/rollout/strategies/dagger.py:463— src/lerobot/rollout/strategies/dagger.py:463-472 | src/lerobot/rollout/strategies/dagger.py:679-688 | src/lerobot/rollout/strategies/highlight.py:124-134 | src/lerobot/rollout/strategies/sentry.py:132-142 — 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:473` calls `robot_action_processor` and `src/lerobot/rollout/strategies/sentry.py:146` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 3) src/lerobot/policies/pi0/modeling_pi0.py:1057— src/lerobot/policies/pi0/modeling_pi0.py:1057-1067 | src/lerobot/policies/pi05/modeling_pi05.py:1432-1442 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:1026-1036 — `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 549 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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:1069` calls `prepare_state`, `pad_vector` and `src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:1038` 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.
Low cohesion: PreTrainedPolicy (LCOM4 4) src/lerobot/policies/pretrained.py:71— 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:51— 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 107) src/lerobot/scripts/lerobot_train.py:545— lerobot_train.train has cyclomatic complexity 107 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
lerobot_train.make_dataloaders (cyclomatic 47) src/lerobot/scripts/lerobot_train.py:342— 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.
Qwen2_5_VLMoEForAction.predict (cyclomatic 46) src/lerobot/policies/wall_x/modeling_wall_x.py:1052— Qwen2_5_VLMoEForAction.predict has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
compute_rabc_weights.compute_sarm_progress (cyclomatic 42) src/lerobot/rewards/sarm/compute_rabc_weights.py:466— compute_rabc_weights.compute_sarm_progress has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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.
lerobot_eval.rollout (cyclomatic 40) src/lerobot/scripts/lerobot_eval.py:168— lerobot_eval.rollout 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:497— 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.
GrootN17ActionDecodeStep.__call__ (cyclomatic 38) src/lerobot/policies/groot/processor_groot.py:2290— 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.
factory.make_policy (cyclomatic 37) src/lerobot/policies/factory.py:221— factory.make_policy 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.
GrootN17PackInputsStep.__call__ (cyclomatic 37) src/lerobot/policies/groot/processor_groot.py:1751— GrootN17PackInputsStep.__call__ 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.
Qwen2_5_VLMoEForAction.train_step_forward (cyclomatic 37) src/lerobot/policies/wall_x/modeling_wall_x.py:742— 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:675— 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.
lerobot_eval.eval_policy (cyclomatic 37) src/lerobot/scripts/lerobot_eval.py:432— lerobot_eval.eval_policy 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.
MolmoAct2ForConditionalGeneration.predict_action (cyclomatic 35) src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:4317— 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.
EO1PrepareModelMessagesStep.complementary_data (cyclomatic 34) src/lerobot/policies/eo1/processor_eo1.py:90— 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.
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.
RolloutConfig.__post_init__ (cyclomatic 33) src/lerobot/rollout/configs.py:348— RolloutConfig.__post_init__ 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.
LeRobotDataset.__init__ (cyclomatic 32) src/lerobot/datasets/lerobot_dataset.py:53— LeRobotDataset.__init__ 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.
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.
context.build_rollout_context (cyclomatic 32) src/lerobot/rollout/context.py:432— context.build_rollout_context 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.
lerobot_record.record (cyclomatic 32) src/lerobot/scripts/lerobot_record.py:386— 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.
codec._encode_value (cyclomatic 30) src/lerobot/remote_inference/codec.py:147— codec._encode_value 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:271— 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.
lerobot_dataset_viz.visualize_dataset (cyclomatic 30) src/lerobot/scripts/lerobot_dataset_viz.py:160— lerobot_dataset_viz.visualize_dataset 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:1109— 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.
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:4075— 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.
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.
TrainPipelineConfig.validate (cyclomatic 27) src/lerobot/configs/train.py:262— TrainPipelineConfig.validate 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.
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.
DatasetConfig.__post_init__ (cyclomatic 26) src/lerobot/configs/default.py:80— DatasetConfig.__post_init__ 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.
StreamingLeRobotDataset._iter_once (cyclomatic 25) src/lerobot/datasets/streaming_dataset.py:481— StreamingLeRobotDataset._iter_once 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.
DM05Policy._prepare_model_inputs (cyclomatic 25) src/lerobot/policies/dm05/modeling_dm05.py:396— 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:83— 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:381— 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:324— 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:1725— 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.
_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.
dataset_tools.recompute_stats (cyclomatic 23) src/lerobot/datasets/dataset_tools.py:1616— 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:144— 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:513— 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:255— 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:142— 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.
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.
SARMRewardModel.calculate_rewards (cyclomatic 22) src/lerobot/rewards/sarm/modeling_sarm.py:491— SARMRewardModel.calculate_rewards 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:693— 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_record.record_loop (cyclomatic 22) src/lerobot/scripts/lerobot_record.py:228— lerobot_record.record_loop 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.
dataset_tools._copy_and_reindex_episodes_metadata (cyclomatic 21) src/lerobot/datasets/dataset_tools.py:882— 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.
_CameraEncoderThread.run (cyclomatic 21) src/lerobot/datasets/video_utils.py:827— _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.
prediction.predict_chunk (cyclomatic 21) src/lerobot/inference/prediction.py:100— prediction.predict_chunk 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.
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:765— 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:440— 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.
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.
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.
LanceDatasetReader.__init__ (cyclomatic 20) src/lerobot/datasets/lance_backend.py:132— LanceDatasetReader.__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.
utils.preprocess_observation (cyclomatic 20) src/lerobot/envs/utils.py:68— utils.preprocess_observation 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.
RTCInferenceEngine.__init__ (cyclomatic 20) src/lerobot/inference/rtc.py:112— RTCInferenceEngine.__init__ 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.
GrootPolicy._prepare_n1_7_rtc_inputs (cyclomatic 20) src/lerobot/policies/groot/modeling_groot.py:369— 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.
Qwen2_5_VLMoEForAction.get_rope_index (cyclomatic 20) src/lerobot/policies/wall_x/modeling_wall_x.py:552— 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.
DAggerStrategy._run_continuous (cyclomatic 20) src/lerobot/rollout/strategies/dagger.py:348— 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:534— 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.
lerobot_train.update_policy (cyclomatic 20) src/lerobot/scripts/lerobot_train.py:201— lerobot_train.update_policy 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.
foxglove_visualization._log_foxglove_image (cyclomatic 20) src/lerobot/utils/foxglove_visualization.py:182— 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.
StreamingLeRobotDataset.__init__ (cyclomatic 19) src/lerobot/datasets/streaming_dataset.py:210— StreamingLeRobotDataset.__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.
DM05ForCausalLM.inference_action (cyclomatic 19) src/lerobot/policies/dm05/core/modeling.py:1661— 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:347— 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.
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:1366— 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:107— 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:206— 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.
rerun_visualization.log_rerun_data (cyclomatic 19) src/lerobot/utils/rerun_visualization.py:112— rerun_visualization.log_rerun_data 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.
dataset_tools.modify_tasks (cyclomatic 18) src/lerobot/datasets/dataset_tools.py:1466— dataset_tools.modify_tasks 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.
ChunkRuntime.accept (cyclomatic 18) src/lerobot/inference/execution.py:429— ChunkRuntime.accept 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.
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:803— 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:802— 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.
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:1486— 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/remote_inference/codec.py:229— 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.
deployment.load_deployment (cyclomatic 18) src/lerobot/remote_inference/deployment.py:115— deployment.load_deployment 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.
learner.add_actor_information_and_train (cyclomatic 18) src/lerobot/rl/learner.py:271— learner.add_actor_information_and_train 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.
ZenohTransport.query (cyclomatic 18) src/lerobot/transport/zenoh.py:379— ZenohTransport.query 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.
FeatureSpec.__post_init__ (cyclomatic 17) src/lerobot/policies/chunk.py:40— FeatureSpec.__post_init__ 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.
EO1VisionFlowMatchingModel.forward (cyclomatic 17) src/lerobot/policies/eo1/modeling_eo1.py:438— 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:1310— 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:27— 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:93— 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.
TrainPipelineConfig._validate_distributed (cyclomatic 16) src/lerobot/configs/train.py:339— TrainPipelineConfig._validate_distributed 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.
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.
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:1473— 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.
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:234— 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.
PI05Policy.from_pretrained (cyclomatic 16) src/lerobot/policies/pi05/modeling_pi05.py:1104— 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.
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:473— 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:709— 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.
lerobot_train.train (cognitive 208) src/lerobot/scripts/lerobot_train.py:545— lerobot_train.train has cognitive complexity 208 (threshold 15). Drivers by points: if/else 79 (159 pts), boolean chains 22, ternaries 7 (16 pts), loops 3 (8 pts), error handling 1 (3 pts) (nesting depth added 96). 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.
EO1PrepareModelMessagesStep.complementary_data (cognitive 90) src/lerobot/policies/eo1/processor_eo1.py:90— 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.
compute_rabc_weights.compute_sarm_progress (cognitive 88) src/lerobot/rewards/sarm/compute_rabc_weights.py:466— compute_rabc_weights.compute_sarm_progress has cognitive complexity 88 (threshold 15). Drivers by points: if/else 26 (55 pts), ternaries 7 (19 pts), loops 4 (6 pts), boolean chains 5, error handling 1 (3 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.
lerobot_eval.rollout (cognitive 86) src/lerobot/scripts/lerobot_eval.py:168— lerobot_eval.rollout has cognitive complexity 86 (threshold 15). Drivers by points: if/else 23 (46 pts), loops 6 (14 pts), ternaries 4 (13 pts), error handling 3 (7 pts), boolean chains 6 (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Qwen2_5_VLMoEForAction.predict (cognitive 84) src/lerobot/policies/wall_x/modeling_wall_x.py:1052— Qwen2_5_VLMoEForAction.predict has cognitive complexity 84 (threshold 15). Drivers by points: if/else 36 (66 pts), boolean chains 8, ternaries 5 (8 pts), loops 1 (2 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
lerobot_train.make_dataloaders (cognitive 79) src/lerobot/scripts/lerobot_train.py:342— 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:497— 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:675— 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.
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:742— 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.
lerobot_eval.eval_policy (cognitive 70) src/lerobot/scripts/lerobot_eval.py:432— lerobot_eval.eval_policy has cognitive complexity 70 (threshold 15). Drivers by points: if/else 27 (51 pts), ternaries 4 (9 pts), boolean chains 5, loops 3 (5 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent 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.
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.
GrootN17PackInputsStep.__call__ (cognitive 62) src/lerobot/policies/groot/processor_groot.py:1751— GrootN17PackInputsStep.__call__ has cognitive complexity 62 (threshold 15). Drivers by points: if/else 27 (53 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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:552— 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:882— 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.
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.
lerobot_dataset_viz.visualize_dataset (cognitive 57) src/lerobot/scripts/lerobot_dataset_viz.py:160— lerobot_dataset_viz.visualize_dataset has cognitive complexity 57 (threshold 15). Drivers by points: if/else 14 (29 pts), ternaries 6 (14 pts), loops 5 (9 pts), boolean chains 3, error handling 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.
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:2290— 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.
factory.make_policy (cognitive 52) src/lerobot/policies/factory.py:221— factory.make_policy has cognitive complexity 52 (threshold 15). Drivers by points: if/else 28 (40 pts), boolean chains 8, ternaries 2 (4 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.
rerun_visualization.log_rerun_data (cognitive 52) src/lerobot/utils/rerun_visualization.py:112— rerun_visualization.log_rerun_data has cognitive complexity 52 (threshold 15). Drivers by points: if/else 11 (29 pts), ternaries 4 (18 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 34). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
HighlightStrategy.run (cognitive 51) src/lerobot/rollout/strategies/highlight.py:93— 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.
MolmoAct2ForConditionalGeneration.predict_action (cognitive 49) src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:4317— 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.
MolmoAct2ForConditionalGeneration._generate_depth_prefix (cognitive 45) src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:4075— 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:381— 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.
codec._encode_value (cognitive 43) src/lerobot/remote_inference/codec.py:147— codec._encode_value has cognitive complexity 43 (threshold 15). Drivers by points: if/else 22 (34 pts), boolean chains 5, error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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:348— 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.
StreamingLeRobotDataset._iter_once (cognitive 40) src/lerobot/datasets/streaming_dataset.py:481— StreamingLeRobotDataset._iter_once has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (19 pts), error handling 3 (8 pts), loops 4 (6 pts), ternaries 4, boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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:271— 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:386— 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:1616— 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.
LeRobotDataset.__init__ (cognitive 39) src/lerobot/datasets/lerobot_dataset.py:53— LeRobotDataset.__init__ has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 11, ternaries 4 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
WanVideoDiT._validate_forward_inputs (cognitive 39) src/lerobot/policies/fastwam/wan/video_dit.py:513— 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.
LingBotVAPolicy._infer (cognitive 38) src/lerobot/policies/lingbot_va/modeling_lingbot_va.py:765— 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.
DAggerStrategy._run_corrections_only (cognitive 38) src/lerobot/rollout/strategies/dagger.py:534— 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.
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:324— 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:827— _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:1366— 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.
context.build_rollout_context (cognitive 36) src/lerobot/rollout/context.py:432— context.build_rollout_context has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 8, ternaries 4, error handling 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
EpisodicStrategy.run (cognitive 36) src/lerobot/rollout/strategies/episodic.py:107— 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.
lerobot_record.record_loop (cognitive 36) src/lerobot/scripts/lerobot_record.py:228— lerobot_record.record_loop has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (29 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DatasetConfig.__post_init__ (cognitive 35) src/lerobot/configs/default.py:80— DatasetConfig.__post_init__ has cognitive complexity 35 (threshold 15). Drivers by points: if/else 21 (31 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.
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:1109— 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.
RolloutConfig.__post_init__ (cognitive 35) src/lerobot/rollout/configs.py:348— RolloutConfig.__post_init__ has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19 (22 pts), boolean chains 13 (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.
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.
dataset_tools._copy_data_with_feature_changes (cognitive 33) src/lerobot/datasets/dataset_tools.py:1035— 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:1725— 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.
utils.preprocess_observation (cognitive 32) src/lerobot/envs/utils.py:68— utils.preprocess_observation has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (28 pts), loops 2 (3 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.
_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:748— 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:803— 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:802— 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:440— 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.
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:206— 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:182— 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.
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:27— 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.
foxglove_visualization.log_foxglove_data (cognitive 30) src/lerobot/utils/foxglove_visualization.py:289— foxglove_visualization.log_foxglove_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:614— 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.
DM05Policy._prepare_model_inputs (cognitive 29) src/lerobot/policies/dm05/modeling_dm05.py:396— 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.
deployment.load_deployment (cognitive 29) src/lerobot/remote_inference/deployment.py:115— deployment.load_deployment has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 3 (9 pts), boolean chains 3, 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.
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.
prediction.predict_chunk (cognitive 28) src/lerobot/inference/prediction.py:100— prediction.predict_chunk has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 8, 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 28) src/lerobot/inference/rtc.py:112— RTCInferenceEngine.__init__ has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (21 pts), ternaries 4, boolean chains 3 (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.
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.
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:83— 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.
learner.add_actor_information_and_train (cognitive 28) src/lerobot/rl/learner.py:271— learner.add_actor_information_and_train has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 2, 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.
UnitreeG1.disconnect (cognitive 28) src/lerobot/robots/unitree_g1/unitree_g1.py:473— 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.
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:1104— 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.
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 18 (21 pts), ternaries 4 (5 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
lerobot_eval._build_raw_frame (cognitive 27) src/lerobot/scripts/lerobot_eval.py:124— 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.
TrainPipelineConfig.validate (cognitive 26) src/lerobot/configs/train.py:262— TrainPipelineConfig.validate has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 12 (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.
LanceDatasetReader._fetch_rows (cognitive 26) src/lerobot/datasets/lance_backend.py:447— 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:255— 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.
processor_fineart_vla._vqa_answer_to_loc (cognitive 25) src/lerobot/policies/fineart_vla/processor_fineart_vla.py:183— 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.
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.
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:438— 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.
actor.act_with_policy (cognitive 24) src/lerobot/rl/actor.py:230— actor.act_with_policy has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (22 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.
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.
factory.make_train_eval_datasets (cognitive 23) src/lerobot/datasets/factory.py:225— 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:144— 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.
DM05ForCausalLM.inference_action (cognitive 23) src/lerobot/policies/dm05/core/modeling.py:1661— 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.
WallXPolicy.forward (cognitive 23) src/lerobot/policies/wall_x/modeling_wall_x.py:1873— 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:693— 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.
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.
dataset_tools._keep_episodes_from_video_with_av (cognitive 22) src/lerobot/datasets/dataset_tools.py:639— dataset_tools._keep_episodes_from_video_with_av has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (11 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.
FastWAMConfig.validate_features (cognitive 22) src/lerobot/policies/fastwam/configuration_fastwam.py:347— 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.
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.
MolmoAct2Policy._continue_discrete_generation_from_output (cognitive 22) src/lerobot/policies/molmoact2/modeling_molmoact2.py:1610— 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.
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.
lerobot_eval.eval_policy_all (cognitive 22) src/lerobot/scripts/lerobot_eval.py:1004— lerobot_eval.eval_policy_all has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 4 (7 pts), ternaries 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.
lerobot_train.update_policy (cognitive 22) src/lerobot/scripts/lerobot_train.py:201— lerobot_train.update_policy has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 6, 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.
ZenohTransport.query (cognitive 22) src/lerobot/transport/zenoh.py:379— ZenohTransport.query has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (15 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.
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:289— 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.
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.
LanceDatasetReader.__init__ (cognitive 21) src/lerobot/datasets/lance_backend.py:132— LanceDatasetReader.__init__ has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 5, error handling 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.
libero.create_libero_envs (cognitive 21) src/lerobot/envs/libero.py:445— libero.create_libero_envs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
codec._decode_record (cognitive 21) src/lerobot/remote_inference/codec.py:229— 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.
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.
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.
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:211— 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:1121— 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:155— 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.
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:1255— 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.
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.
UnitreeG1.connect (cognitive 20) src/lerobot/robots/unitree_g1/unitree_g1.py:381— UnitreeG1.connect has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 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.
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:480— 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.
TrainPipelineConfig._validate_distributed (cognitive 19) src/lerobot/configs/train.py:339— TrainPipelineConfig._validate_distributed has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (15 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.
dataset_tools._copy_and_reindex_data (cognitive 19) src/lerobot/datasets/dataset_tools.py:543— 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.modify_tasks (cognitive 19) src/lerobot/datasets/dataset_tools.py:1466— dataset_tools.modify_tasks has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, 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.
dataset_tools.reencode_dataset (cognitive 19) src/lerobot/datasets/dataset_tools.py:1990— 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.
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.
ChunkRuntime.accept (cognitive 19) src/lerobot/inference/execution.py:429— ChunkRuntime.accept has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, boolean chains 5, 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.
modeling_dm05.prepare_compiled_suffix_inputs (cognitive 19) src/lerobot/policies/dm05/modeling_dm05.py:62— 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:234— 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:1310— 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:1707— 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:605— 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:1486— 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.
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.
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_checkpoint (cognitive 18) src/lerobot/common/train_utils.py:204— train_utils.save_checkpoint has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, 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.
WandBLogger.log_dict (cognitive 18) src/lerobot/common/wandb_utils.py:165— WandBLogger.log_dict has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 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.
dataset_tools.split_dataset (cognitive 18) src/lerobot/datasets/dataset_tools.py:177— dataset_tools.split_dataset has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 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.
StreamingLeRobotDataset.__init__ (cognitive 18) src/lerobot/datasets/streaming_dataset.py:210— StreamingLeRobotDataset.__init__ has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8, ternaries 8, boolean chains 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
metaworld.create_metaworld_envs (cognitive 18) src/lerobot/envs/metaworld.py:286— metaworld.create_metaworld_envs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
vlabench.create_vlabench_envs (cognitive 18) src/lerobot/envs/vlabench.py:526— vlabench.create_vlabench_envs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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:1473— 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.
ActionDiT.pre_dit (cognitive 18) src/lerobot/policies/fastwam/wan/modular.py:132— ActionDiT.pre_dit has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
FastWAM.infer_joint (cognitive 18) src/lerobot/policies/fastwam/wan/modular.py:1683— 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:369— 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:920— 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.
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.
DataProcessorPipeline._resolve_artifact_paths (cognitive 18) src/lerobot/processor/pipeline.py:1060— DataProcessorPipeline._resolve_artifact_paths has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (9 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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:142— 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:507— 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:261— 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.
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:89— 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:721— 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.
sidecar_utils._read_metadata (cognitive 18) src/lerobot/streaming/sidecar_utils.py:176— sidecar_utils._read_metadata has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
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.
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.
StreamingLeRobotDataset._worker_share (cognitive 17) src/lerobot/datasets/streaming_dataset.py:666— 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.
robomme.create_robomme_envs (cognitive 17) src/lerobot/envs/robomme.py:222— robomme.create_robomme_envs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (3 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.
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.
GrootConfig.__post_init__ (cognitive 17) src/lerobot/policies/groot/configuration_groot.py:381— 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.
MolmoAct2Policy._generate_actions_from_inputs_with_rtc (cognitive 17) src/lerobot/policies/molmoact2/modeling_molmoact2.py:1795— 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:1111— 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.
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.
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.
RemoteClient.connect (cognitive 17) src/lerobot/remote_inference/client.py:126— RemoteClient.connect has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, error handling 3, 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.
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:709— 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:180— 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:754— 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.
VLABenchEnv._get_obs (cognitive 16) src/lerobot/envs/vlabench.py:270— 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.
ChunkRuntime.begin (cognitive 16) src/lerobot/inference/execution.py:381— 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.
hf.submit_to_hf (cognitive 16) src/lerobot/jobs/hf.py:371— hf.submit_to_hf 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.
FeatureSpec.__post_init__ (cognitive 16) src/lerobot/policies/chunk.py:40— FeatureSpec.__post_init__ has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 8. 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.
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:1144— 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:458— 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:2434— 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.
VLAJEPAPolicy._load_as_safetensor (cognitive 16) src/lerobot/policies/vla_jepa/modeling_vla_jepa.py:568— VLAJEPAPolicy._load_as_safetensor 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.
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:265— 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:835— 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:136— 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:321— 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:445— RemoteClient._exchange has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 2 (4 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.
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:640— 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.
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.
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, 10 shared lines) · ×1
Near-duplicate member family (7 members, 10 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 10 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 27 shared lines) · ×1
Near-duplicate member family (3 members, 27 shared lines) src/lerobot/configs/policies.py:213— src/lerobot/configs/policies.py:213-264 | src/lerobot/configs/rewards.py:125-168 | src/lerobot/rl/algorithms/configs.py:101-141 — These 3 members are variants of one another: a block of 27 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
Near-duplicate member pair (106 shared lines) src/lerobot/rollout/strategies/dagger.py:349— src/lerobot/rollout/strategies/dagger.py:349-528 | src/lerobot/rollout/strategies/dagger.py:535-703 — These two members are variants of one another: 106 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 (96 shared lines) src/lerobot/policies/pi0/modeling_pi0.py:818— src/lerobot/policies/pi0/modeling_pi0.py:818-918 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:817-917 — These two members are variants of one another: 96 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.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×1
Edited copy of a member (17 corresponding lines) 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 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (24 corresponding lines) · ×1
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.
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:294-301 — 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· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (6 members, 50+ identical tokens) src/lerobot/rl/actor.py:237— src/lerobot/rl/actor.py:237-427 | src/lerobot/rl/actor.py:493-537 | src/lerobot/rl/actor.py:547-593 | src/lerobot/rl/actor.py:603-652 | src/lerobot/rl/learner.py:279-476 | src/lerobot/rl/learner.py:486-546 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
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 88 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The `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 (51 lines × 3) src/lerobot/policies/pi0/modeling_pi0.py:819— src/lerobot/policies/pi0/modeling_pi0.py:819-869 | src/lerobot/policies/pi05/modeling_pi05.py:1135-1185 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:818-868 — `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 549 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 (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 (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:536-582 — `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 549 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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:1441— src/lerobot/policies/fastwam/wan/modular.py:1441-1481 | src/lerobot/policies/fastwam/wan/modular.py:1506-1545 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:1441` it begins part-way through the construct above it, so those exact lines 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:923— src/lerobot/policies/pi0/modeling_pi0.py:923-959 | src/lerobot/policies/pi05/modeling_pi05.py:1258-1294 — `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 549 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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:1296` calls `startswith`, `warning` and `src/lerobot/policies/pi0/modeling_pi0.py:962` 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–35 lines × 2) src/lerobot/cameras/opencv/camera_opencv.py:381— src/lerobot/cameras/opencv/camera_opencv.py:381-415 | 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:465— src/lerobot/policies/groot/configuration_groot.py:465-499 | 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:544— src/lerobot/cameras/opencv/camera_opencv.py:544-575 | 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:1005— src/lerobot/policies/pi0/modeling_pi0.py:1005-1034 | src/lerobot/policies/pi05/modeling_pi05.py:1367-1397 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:973-1003 — `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 549 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 (29–31 lines × 2) src/lerobot/policies/fastwam/wan/modular.py:1334— src/lerobot/policies/fastwam/wan/modular.py:1334-1362 | src/lerobot/policies/fastwam/wan/modular.py:1455-1485 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/fastwam/wan/modular.py:1334` it begins part-way through the construct above it, so those 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 (31 lines × 2) src/lerobot/teleoperators/homunculus/homunculus_arm.py:147— src/lerobot/teleoperators/homunculus/homunculus_arm.py:147-177 | src/lerobot/teleoperators/homunculus/homunculus_glove.py:178-208 — 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 9 separate duplicated blocks between them, totalling at least 155 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (29 lines × 3) src/lerobot/policies/pi0/modeling_pi0.py:890— src/lerobot/policies/pi0/modeling_pi0.py:890-918 | src/lerobot/policies/pi05/modeling_pi05.py:1190-1218 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:889-917 — `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 549 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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:3274— src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:3274-3301 | src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:3419-3444 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:3274` it begins part-way through the construct above it, so those 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 8 separate duplicated blocks between them, totalling at least 152 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 (27 lines × 3) src/lerobot/configs/policies.py:213— src/lerobot/configs/policies.py:213-239 | src/lerobot/configs/rewards.py:125-151 | src/lerobot/rl/algorithms/configs.py:101-127 — 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:155` calls `config_type`, `parse` and `src/lerobot/configs/policies.py:241` 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 (26–27 lines × 2) src/lerobot/rollout/strategies/dagger.py:417— src/lerobot/rollout/strategies/dagger.py:417-442 | src/lerobot/rollout/strategies/dagger.py:631-657 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26 lines × 2) 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 8 separate duplicated blocks between them, totalling at least 152 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 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 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (24–25 lines × 2) src/lerobot/rollout/strategies/dagger.py:450— src/lerobot/rollout/strategies/dagger.py:450-473 | src/lerobot/rollout/strategies/dagger.py:665-689 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/rollout/strategies/dagger.py:665` it begins part-way through the construct above it, so those 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 (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 (21–22 lines × 2) examples/dataset/create_progress_videos.py:643— examples/dataset/create_progress_videos.py:643-664 | src/lerobot/scripts/lerobot_dataset_viz.py:312-332 — 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/create_progress_videos.py:643` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (2–22 lines × 3) src/lerobot/policies/dm05/core/modeling.py:1042— src/lerobot/policies/dm05/core/modeling.py:1042-1043 | 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 549 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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:1042` 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–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 (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 11 separate duplicated blocks between them, totalling at least 157 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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:270— src/lerobot/policies/xvla/processor_xvla.py:270-287 | src/lerobot/policies/xvla/processor_xvla.py:343-361 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 8 separate duplicated blocks between them, totalling at least 152 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 9 separate duplicated blocks between them, totalling at least 155 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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:530-545 | 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 549 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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:547-568 | src/lerobot/rl/actor.py:603-623 | src/lerobot/rl/learner.py:486-502 — 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:631` calls `ProcessSignalHandler` and `src/lerobot/rl/actor.py:574` 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–17 lines × 2) src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:3262— src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:3262-3275 | src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:3394-3410 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:3262` it does not close everything it opens, so those exact lines 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:495— src/lerobot/policies/xvla/modeling_xvla.py:495-509 | 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:495` it begins part-way through the construct above it, so those exact lines 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:1621— src/lerobot/policies/dm05/core/modeling.py:1621-1632 | src/lerobot/policies/dm05/core/modeling.py:1766-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. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/dm05/core/modeling.py:1621` it begins part-way through the construct above it, so those 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:536— src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:536-548 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:643-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. ★ 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:550` calls `zeros` and `src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:659` 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:284— src/lerobot/policies/pretrained.py:284-297 | src/lerobot/policies/vla_jepa/modeling_vla_jepa.py:422-430 — 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:140-152 | src/lerobot/policies/pi05/configuration_pi05.py:169-181 | src/lerobot/policies/pi0_fast/configuration_pi0_fast.py:134-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 46 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13 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:1756— src/lerobot/policies/dm05/core/modeling.py:1756-1767 | src/lerobot/policies/dm05/core/modeling.py:1852-1864 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:1756` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–13 lines × 2) src/lerobot/processor/pipeline.py:779— src/lerobot/processor/pipeline.py:779-791 | src/lerobot/processor/pipeline.py:819-827 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/processor/pipeline.py:779` it begins part-way through the construct above it, so those 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:830` calls `load_state_dict` and `src/lerobot/processor/pipeline.py:792` 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–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 34 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 (10–11 lines × 2) src/lerobot/policies/molmoact2/modeling_molmoact2.py:1939— src/lerobot/policies/molmoact2/modeling_molmoact2.py:1939-1949 | src/lerobot/policies/molmoact2/modeling_molmoact2.py:1967-1976 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:1939` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 7) src/lerobot/robots/hope_jr/hope_jr_arm.py:140— src/lerobot/robots/hope_jr/hope_jr_arm.py:140-149 | src/lerobot/robots/hope_jr/hope_jr_hand.py:167-176 | src/lerobot/robots/koch_follower/koch_follower.py:161-170 | src/lerobot/robots/omx_follower/omx_follower.py:175-184 | src/lerobot/robots/openarm_follower/openarm_follower.py:248-257 | src/lerobot/robots/rebot_b601_follower/rebot_b601_follower.py:298-307 | src/lerobot/robots/so_follower/so_follower.py:172-181 — 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 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 4) REDACTED:197— REDACTED:197-206 | src/lerobot/policies/pi0/modeling_pi0.py:737-746 | src/lerobot/policies/pi05/modeling_pi05.py:1035-1044 | src/lerobot/policies/smolvla/modeling_smolvla.py:836-845 — `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 549 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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:208` calls `_prepare_attention_masks_4d` and `src/lerobot/policies/smolvla/modeling_smolvla.py:847` 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:565— src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:565-574 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:672-680 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:727-735 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:565` it begins part-way through the construct above it, so those exact lines 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:156— src/lerobot/policies/fastwam/wan/modular.py:156-164 | src/lerobot/policies/fastwam/wan/video_dit.py:571-580 — 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:156` it begins part-way through the construct above it, so those exact lines 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–9 lines × 2) src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:972— src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:972-976 | src/lerobot/policies/molmoact2/molmoact2_hf_model/modeling_molmoact2.py:978-986 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:978` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 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:294-301 — 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 34 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–8 lines × 2) src/lerobot/datasets/factory.py:215— src/lerobot/datasets/factory.py:215-222 | src/lerobot/datasets/factory.py:306-311 — both copies are in the same file, so extract the 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–7 lines × 4) REDACTED:154— REDACTED:154-160 | REDACTED:1023-1028 | src/lerobot/policies/pi0/modeling_pi0.py:626-632 | src/lerobot/policies/pi05/modeling_pi05.py:899-905 — `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 549 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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:426-432 | 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 (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 × 10) src/lerobot/policies/eo1/configuration_eo1.py:242— 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:155-161 | src/lerobot/policies/pi0/configuration_pi0.py:155-161 | src/lerobot/policies/pi05/configuration_pi05.py:184-190 | src/lerobot/policies/pi0_fast/configuration_pi0_fast.py:149-155 | src/lerobot/policies/smolvla/configuration_smolvla.py:135-141 | src/lerobot/policies/vla_jepa/configuration_vla_jepa.py:238-244 | src/lerobot/policies/wall_x/configuration_wall_x.py:206-212 — `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 46 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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/policies/eo1/modeling_eo1.py:315— src/lerobot/policies/eo1/modeling_eo1.py:315-322 | src/lerobot/policies/pi0/modeling_pi0.py:490-497 | src/lerobot/policies/pi05/modeling_pi05.py:735-742 — `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 549 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 (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:989-999 | src/lerobot/policies/pi0_fast/modeling_pi0_fast.py:957-967 | src/lerobot/policies/smolvla/modeling_smolvla.py:179-192 — 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 280 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 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 8 separate duplicated blocks between them, totalling at least 152 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 34 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 (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 116 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
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 (51 corresponding lines) · ×1
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.
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:224-268 — 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:189-218 — 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:668— `sample_count` is read from the bytes being parsed at line 664 (`struct.unpack_from(">II")`), then used to size a `np.empty` at line 668 — 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.
README/code drift docs/source/act.mdx:49— docs/source/act.mdx links to `./installation`, but `docs/source/installation` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/source/action_representations.mdx:228— docs/source/action_representations.mdx links to `./introduction_processors`, but `docs/source/introduction_processors` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/source/annotation_pipeline.mdx:6— docs/source/annotation_pipeline.mdx links to `./language_and_recipes`, but `docs/source/language_and_recipes` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/source/annotation_pipeline.mdx:99— docs/source/annotation_pipeline.mdx links to `./tools`, but `docs/source/tools` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/source/annotation_pipeline.mdx:107— docs/source/annotation_pipeline.mdx documents the environment variable `TOOL_REGISTRY`, but no code, script or configuration file names it. 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/annotation_pipeline.mdx:107— docs/source/annotation_pipeline.mdx names `src/lerobot/tools/`, but no file or folder `src/lerobot/tools` exists. 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/bring_your_own_policies.mdx:167— docs/source/bring_your_own_policies.mdx links to `./multi_gpu_training#sharded-training-fsdp`, but `docs/source/multi_gpu_training` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/source/bring_your_own_policies.mdx:407— docs/source/bring_your_own_policies.mdx links to `./contributing`, but `docs/source/contributing` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/source/bring_your_own_policies.mdx:474— docs/source/bring_your_own_policies.mdx links to `./libero`, but `docs/source/libero` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/source/cameras.mdx:179— docs/source/cameras.mdx links to `./video_encoding_parameters#depth-streams`, but `docs/source/video_encoding_parameters` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/source/dm05.mdx:20— docs/source/dm05.mdx names `lerobot/dm05_base`, but no file or folder `lerobot/dm05_base` exists. 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/dm05.mdx:63— docs/source/dm05.mdx names `lerobot/libero`, but no file or folder `lerobot/libero` exists. 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/dm05.mdx:84— docs/source/dm05.mdx links to `./action_representations#using-relative-actions-in-lerobot`, but `docs/source/action_representations` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/source/dm05.mdx:88— docs/source/dm05.mdx names `lerobot/dm05_libero`, but no file or folder `lerobot/dm05_libero` exists. 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/earthrover_mini_plus.mdx:40— docs/source/earthrover_mini_plus.mdx documents the environment variable `MAP_ZOOM_LEVEL`, but no code, script or configuration file names it. 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/earthrover_mini_plus.mdx:44— docs/source/earthrover_mini_plus.mdx documents the environment variable `IMAGE_QUALITY`, but no code, script or configuration file names it. 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/earthrover_mini_plus.mdx:47— docs/source/earthrover_mini_plus.mdx documents the environment variable `IMAGE_FORMAT`, but no code, script or configuration file names it. 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/earthrover_mini_plus.mdx:67— docs/source/earthrover_mini_plus.mdx links to `./installation`, but `docs/source/installation` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/source/envhub_isaaclab_arena.mdx:44— docs/source/envhub_isaaclab_arena.mdx documents the environment variable `PRIVACY_CONSENT`, but no code, script or configuration file names it. 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_isaaclab_arena.mdx:50— docs/source/envhub_isaaclab_arena.mdx runs `./isaaclab.sh -i`, but `isaaclab.sh` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/source/envhub_isaaclab_arena.mdx:122— docs/source/envhub_isaaclab_arena.mdx documents the environment variable `TORCH_COMPILE_DISABLE`, but no code, script or configuration file names it. 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_isaaclab_arena.mdx:122— docs/source/envhub_isaaclab_arena.mdx documents the environment variable `TORCHINDUCTOR_DISABLE`, but no code, script or configuration file names it. 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_isaaclab_arena.mdx:194— docs/source/envhub_isaaclab_arena.mdx links to `./smolvla`, but `docs/source/smolvla` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/source/envhub_isaaclab_arena.mdx:195— docs/source/envhub_isaaclab_arena.mdx links to `./pi05`, but `docs/source/pi05` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/source/envhub_isaaclab_arena.mdx:196— docs/source/envhub_isaaclab_arena.mdx links to `./groot`, but `docs/source/groot` 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.
Interpolated log message defeats structured logging src/lerobot/cameras/opencv/camera_opencv.py:191— `exception` at line 191 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.exception("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.exception("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging src/lerobot/cameras/opencv/camera_opencv.py:195— `info` at line 195 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/cameras/opencv/camera_opencv.py:281— `warning` at line 281 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/cameras/opencv/camera_opencv.py:402— `warning` at line 402 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/cameras/opencv/camera_opencv.py:413— `debug` at line 413 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/cameras/opencv/camera_opencv.py:490— `warning` at line 490 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/cameras/opencv/camera_opencv.py:512— `warning` at line 512 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/cameras/opencv/camera_opencv.py:540— `warning` at line 540 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/cameras/opencv/camera_opencv.py:634— `info` at line 634 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/cameras/reachy2_camera/reachy2_camera.py:119— `info` at line 119 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/cameras/reachy2_camera/reachy2_camera.py:146— `warning` at line 146 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/cameras/reachy2_camera/reachy2_camera.py:184— `debug` at line 184 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/cameras/reachy2_camera/reachy2_camera.py:247— `info` at line 247 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/cameras/realsense/camera_realsense.py:186— `info` at line 186 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/cameras/realsense/camera_realsense.py:190— `warning` at line 190 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/cameras/realsense/camera_realsense.py:248— `exception` at line 248 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.exception("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.exception("order moved", order_id=order_id, status=status)` with structlog.
Interpolated log message defeats structured logging src/lerobot/cameras/realsense/camera_realsense.py:276— `info` at line 276 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/cameras/realsense/camera_realsense.py:298— `info` at line 298 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/cameras/realsense/camera_realsense.py:301— `warning` at line 301 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/cameras/realsense/camera_realsense.py:514— `info` at line 514 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/cameras/realsense/camera_realsense.py:516— `warning` at line 516 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/cameras/realsense/camera_realsense.py:523— `info` at line 523 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/cameras/realsense/camera_realsense.py:527— `info` at line 527 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/cameras/realsense/camera_realsense.py:534— `info` at line 534 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/cameras/realsense/camera_realsense.py:536— `warning` at line 536 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.
Duplicated predicate src/lerobot/policies/fastwam/modeling_fastwam.py:173— `"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 41 files — src/lerobot/policies/common/vla_utils.py, src/lerobot/policies/dm05/processor_dm05.py, src/lerobot/policies/eo1/configuration_eo1.py, src/lerobot/policies/eo1/modeling_eo1.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:424— `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:225— `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/remote_inference/client.py:526— `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:129— `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:64— `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:349— `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:446— `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 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/envs/libero.py:467— `env_cls is None or not callable(env_cls)` appears character-identically in 6 files — src/lerobot/envs/libero.py, src/lerobot/envs/metaworld.py, src/lerobot/envs/robocasa.py, src/lerobot/envs/robomme.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:260— `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:252— `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:440— `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.
Duplicated predicate src/lerobot/policies/pi0/modeling_pi0.py:355— `hasattr(self.gemma_expert.model, "gradient_checkpointing") and self.gemma_expert.model.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.
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/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/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 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/teleoperators/homunculus/joints_translation.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.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 21 significant file(s) lose their only recent owner: src/lerobot/utils/cycle_timer.py, src/lerobot/rollout/strategies/core.py, src/lerobot/policies/evo1/modeling_evo1.py, src/lerobot/utils/keyboard_input.py, src/lerobot/rollout/strategies/sentry.py, src/lerobot/rollout/strategies/highlight.py, src/lerobot/scripts/lerobot_setup_can.py, src/lerobot/robots/reachy2/robot_reachy2.py (+13 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 6 significant file(s) lose their only recent owner: src/lerobot/annotations/steerable_pipeline/modules/plan_subtasks_memory.py, src/lerobot/datasets/language_render.py, src/lerobot/annotations/steerable_pipeline/writer.py, src/lerobot/annotations/steerable_pipeline/executor.py, src/lerobot/envs/robomme.py, src/lerobot/datasets/language.py. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 3 significant file(s) lose their only recent owner: src/lerobot/configs/accelerator.py, src/lerobot/distributed/checkpoint.py, src/lerobot/distributed/factory.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) — 5 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 (38 single-owned of 415 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 415 of the 576 production source files in this repository met that bar). They are anonymized user #4 (3 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)) — 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/robots/unitree_g1/run_g1_server.py, src/lerobot/robots/unitree_g1/controllers/gr00t_locomotion.py, src/lerobot/robots/unitree_g1/controllers/holosoma_locomotion.py, src/lerobot/policies/multi_task_dit/configuration_multi_task_dit.py, src/lerobot/policies/multi_task_dit/processor_multi_task_dit.py, src/lerobot/configs/video.py, src/lerobot/utils/rotation.py, src/lerobot/utils/eval_stats.py.
Documentation: no project overview src/lerobot/policies/fastwam/README.md— The FastWAM README is a research-paper stub with no context for the model or results. Describe what FastWAM does and summarize the key results (e.g. 96.4% success rate on LIBERO) so readers understand its value.
No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 1 of 1 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. The most over is `(repository root)` (159881 LoC, 1374 module-visible types across 131 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D34 · Knowledge Freshness· Further orphaned files (smaller) · ×1
Further orphaned files (smaller) — 13 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/policies/xvla/soft_transformer.py, src/lerobot/policies/tdmpc/configuration_tdmpc.py, src/lerobot/policies/rtc/debug_tracker.py, src/lerobot/policies/act/configuration_act.py, src/lerobot/processor/observation_processor.py, src/lerobot/rl/joint_observations_processor.py, src/lerobot/rl/learner_service.py, src/lerobot/robots/reachy2/configuration_reachy2.py (and 5 more) (14 orphaned of 415 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 415 of the 576 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 — 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 105471 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.
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.)
Dependency hygiene PARTLY measured — Python dependencies read, no exact pin to grade for currency — This repository's Python dependencies were read: 19 shipped distribution(s) across 1 manifest(s) (60 development or optional declaration(s) excluded, because a consumer does not install them). Whether any of them is behind its current release is the dependency-CURRENCY question, and no declaration here carries an EXACT pin to ask it about — every one is a floor or a range, which installs the newest release it admits and therefore cannot be behind one. That is a healthy declaration style, NOT a defect and NOT a gap in this analyzer; there is simply no currency question to answer. This is NOT a finding that these dependencies are current or healthy. Lockfiles are deliberately not read (poetry.lock, REDACTED, Pipfile.lock, pdm.lock): the four disagree about dev/optional membership, and misreading one would charge a test-only package a consumer never receives. Known CVEs in the same dependency graph are a separate question, reported under D30.
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 7 file(s) — `src/lerobot/datasets/aggregate.py`, `src/lerobot/datasets/lance_backend.py`, `src/lerobot/motors/motors_bus.py`, `src/lerobot/processor/pipeline.py`, `src/lerobot/rewards/sarm/sarm_utils.py`, … (+2 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 01a15a7c-75e5-7ef7-83db-328446c720ed · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 12 · Warnings: 1074 · Recommendations: 135 · Info: 1 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 20-10-2026 @ 18:04 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.