Public report of ZSeven-W/openpencil, published 14 November 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 14 November 2026, 18:27 UTC · Survey ID cd_4bb445ccd0464f8ea909fdb8d5616785
ZSeven-W/openpencil
Measured 14 November 2026, 18:25 UTC, at code version 2bbc658
CAI scoreAt riskNo change since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A very large codebase: 814,347 lines of product code in 60 projects, tests not counted · Estimated rebuild effort: about 7.3 person-years · Weakest lens: Accessibility, 46
Findings by how serious they are
92 critical4318 serious144 minor
18 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
14 November 2026, 18:25 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.
The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
76of 76 dimensions measured by tools.
4515of 4554 findings point to an exact file and line, so you can open each one in the code. The other 39 concern the repository as a whole, such as missing documentation.
76dimensions across 9 lenses, read from 814,347 lines of product code in 60 projects.
ZSeven-W/openpencil is rated At risk because critical security findings are open. It scores 57 out of 100, which the At risk rating leaves unchanged. We judged it as a preview release, against a lower bar.
Accessibility, at 46, is the weakest lens and counts most in the score. The best first step is adding text alternatives, worth about 7 points. Structuring the pages comes next, worth about 4 points. Raising Accessibility to 65 would lift the score to about 64.
Thirty-six known security holes in the packages the code depends on can be used by attackers. Thirty-six pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with, and fifteen sets of files in separate parts keep changing together, which points to hidden dependencies. Updating the vulnerable packages, pinning each tool to an exact version and making the hidden dependencies explicit would close these risks. The two unsafe settings in infrastructure or container files need changing to safe values. The form field without a label needs a label.
The product code is 814,347 lines, about €1,100,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 Accessibility rose from 46 to 65, the lowest score rated Strong, the score would rise from 57 to about 64.
Code composition: what the lines of code are
Product code 71%Tests 29%
New since the last survey: 1744 findings
These 1744 critical or serious findings weren't in the previous survey, on 27 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
We compare every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 419 findings
These 419 critical or serious findings were in the previous survey, on 27 October 2026, and are gone from this one. The first 100 are listed here.
€350,000 to €1,800,000, for 5,902 to 18,723 hours of work, about 7.3 person-years for 4 to 14 engineers
Difficulty of the problem
Low, 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 57. 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
Very large: 814,347 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Raises the score by about 7 points · Medium effort · Text alternatives
2
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
Raises the score by about 4 points · Medium effort · Page structure
3
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Where the investment is most exposed · Value at risk
This code would cost about €1,100,000 to build again, about 7.3 person-years of work. Its weakest lens is Accessibility, at 46 (Weak). Accessibility is about whether the interface is built so that everyone can use it, including people who can't see the screen or can't use a mouse. Because the weakest lens counts most in the score, work on Accessibility also moves the score most.
Based on: the rebuild estimate · the Accessibility grade · how much each lens counts
What to do: Start with the Accessibility actions in Top priorities.
If you do one thing first · First action
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video. Of all the actions in this report, it raises the score most for the work it takes: about 7 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.6 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 4% to 8% on every change. The history of the code shows how much it changes: about 638,738 lines over the last 90 days, which is about 2,590,437 lines a year. At that pace, the extra work comes to an estimated 232.7 to 1396.5 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
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.
2285 modules, with 4075 dependencies between them. 27 loops run through 101 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 2245 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.
op_collab_host.runtime.relay uses op_collab.protocol, so a change to op_collab.protocol can break op_collab_host.runtime.relay, while a change to op_collab_host.runtime.relay can't break op_collab.protocol.
Position
Below the diagonal: op_collab_host.runtime.relay uses a module listed above it, which is the healthy direction.
op_collab_host.runtime.relay uses op_collab_relay_protocol.locator, so a change to op_collab_relay_protocol.locator can break op_collab_host.runtime.relay, while a change to op_collab_host.runtime.relay can't break op_collab_relay_protocol.locator.
Position
Below the diagonal: op_collab_host.runtime.relay uses a module listed above it, which is the healthy direction.
17→26 op_editor_core.agent_settings.config_types uses op_editor_core.agent_settingspart of a loop✕
Connections
1 pair of types, where a type in op_editor_core.agent_settings.config_types uses a type in op_editor_core.agent_settings.
op_editor_core.agent_settings.config_types uses op_editor_core.agent_settings, so a change to op_editor_core.agent_settings can break op_editor_core.agent_settings.config_types, while a change to op_editor_core.agent_settings.config_types can't break op_editor_core.agent_settings.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
op_editor_core.chat uses op_ai.chat_provider, so a change to op_ai.chat_provider can break op_editor_core.chat, while a change to op_editor_core.chat can't break op_ai.chat_provider.
Position
Below the diagonal: op_editor_core.chat uses a module listed above it, which is the healthy direction.
op_editor_core.scene_vars uses op_editor_core.node_id, so a change to op_editor_core.node_id can break op_editor_core.scene_vars, while a change to op_editor_core.scene_vars can't break op_editor_core.node_id.
Position
Below the diagonal: op_editor_core.scene_vars uses a module listed above it, which is the healthy direction.
op_editor_core.ui_draft uses op_editor_core.node_id, so a change to op_editor_core.node_id can break op_editor_core.ui_draft, while a change to op_editor_core.ui_draft can't break op_editor_core.node_id.
Position
Below the diagonal: op_editor_core.ui_draft uses a module listed above it, which is the healthy direction.
op_editor_ui.widgets.home_surface_palette uses op_editor_core.editor_ui_state.chrome, so a change to op_editor_core.editor_ui_state.chrome can break op_editor_ui.widgets.home_surface_palette, while a change to op_editor_ui.widgets.home_surface_palette can't break op_editor_core.editor_ui_state.chrome.
Position
Below the diagonal: op_editor_ui.widgets.home_surface_palette uses a module listed above it, which is the healthy direction.
op_editor_ui.widgets.property_panel_snapshot uses op_editor_core.property_panel_state, so a change to op_editor_core.property_panel_state can break op_editor_ui.widgets.property_panel_snapshot, while a change to op_editor_ui.widgets.property_panel_snapshot can't break op_editor_core.property_panel_state.
Position
Below the diagonal: op_editor_ui.widgets.property_panel_snapshot uses a module listed above it, which is the healthy direction.
op_html.mapper uses op_html.css.cascade, so a change to op_html.css.cascade can break op_html.mapper, while a change to op_html.mapper can't break op_html.css.cascade.
Position
Below the diagonal: op_html.mapper uses a module listed above it, which is the healthy direction.
op_html.snapshot uses op_html.css.cascade, so a change to op_html.css.cascade can break op_html.snapshot, while a change to op_html.snapshot can't break op_html.css.cascade.
Position
Below the diagonal: op_html.snapshot uses a module listed above it, which is the healthy direction.
op_collab_host.runtime uses op_collab.protocol, so a change to op_collab.protocol can break op_collab_host.runtime, while a change to op_collab_host.runtime can't break op_collab.protocol.
Position
Below the diagonal: op_collab_host.runtime uses a module listed above it, which is the healthy direction.
op_collab_host.runtime uses op_collab_relay_protocol.locator, so a change to op_collab_relay_protocol.locator can break op_collab_host.runtime, while a change to op_collab_host.runtime can't break op_collab_relay_protocol.locator.
Position
Below the diagonal: op_collab_host.runtime uses a module listed above it, which is the healthy direction.
op_collab_host.runtime uses op_editor_core.collab_ui_state, so a change to op_editor_core.collab_ui_state can break op_collab_host.runtime, while a change to op_collab_host.runtime can't break op_editor_core.collab_ui_state.
Position
Below the diagonal: op_collab_host.runtime uses a module listed above it, which is the healthy direction.
op_collab_host.runtime uses op_collab_host.runtime.relay, so a change to op_collab_host.runtime.relay can break op_collab_host.runtime, while a change to op_collab_host.runtime can't break op_collab_host.runtime.relay.
Position
Below the diagonal: op_collab_host.runtime uses a module listed above it, which is the healthy direction.
op_editor_core.agent_settings uses op_editor_core.agent_settings.config_types, so a change to op_editor_core.agent_settings.config_types can break op_editor_core.agent_settings, while a change to op_editor_core.agent_settings can't break op_editor_core.agent_settings.config_types.
Position
Below the diagonal: op_editor_core.agent_settings uses a module listed above it, which is the healthy direction.
op_preview_core.session uses op_editor_core.scene_vars, so a change to op_editor_core.scene_vars can break op_preview_core.session, while a change to op_preview_core.session can't break op_editor_core.scene_vars.
Position
Below the diagonal: op_preview_core.session uses a module listed above it, which is the healthy direction.
op_preview_core.session uses op_html.snapshot, so a change to op_html.snapshot can break op_preview_core.session, while a change to op_preview_core.session can't break op_html.snapshot.
Position
Below the diagonal: op_preview_core.session uses a module listed above it, which is the healthy direction.
op_editor_core.editor_ui_state.state uses op_editor_core.collab_ui_state, so a change to op_editor_core.collab_ui_state can break op_editor_core.editor_ui_state.state, while a change to op_editor_core.editor_ui_state.state can't break op_editor_core.collab_ui_state.
Position
Below the diagonal: op_editor_core.editor_ui_state.state uses a module listed above it, which is the healthy direction.
op_editor_core.editor_ui_state.state uses op_editor_core.editor_ui_state.chrome, so a change to op_editor_core.editor_ui_state.chrome can break op_editor_core.editor_ui_state.state, while a change to op_editor_core.editor_ui_state.state can't break op_editor_core.editor_ui_state.chrome.
Position
Below the diagonal: op_editor_core.editor_ui_state.state uses a module listed above it, which is the healthy direction.
op_editor_core.editor_ui_state.state uses op_editor_core.editor_ui_state.home, so a change to op_editor_core.editor_ui_state.home can break op_editor_core.editor_ui_state.state, while a change to op_editor_core.editor_ui_state.state can't break op_editor_core.editor_ui_state.home.
Position
Below the diagonal: op_editor_core.editor_ui_state.state uses a module listed above it, which is the healthy direction.
op_editor_core.editor_ui_state.state uses op_editor_core.node_id, so a change to op_editor_core.node_id can break op_editor_core.editor_ui_state.state, while a change to op_editor_core.editor_ui_state.state can't break op_editor_core.node_id.
Position
Below the diagonal: op_editor_core.editor_ui_state.state uses a module listed above it, which is the healthy direction.
op_editor_core.editor_ui_state.state uses op_editor_core.property_panel_state, so a change to op_editor_core.property_panel_state can break op_editor_core.editor_ui_state.state, while a change to op_editor_core.editor_ui_state.state can't break op_editor_core.property_panel_state.
Position
Below the diagonal: op_editor_core.editor_ui_state.state uses a module listed above it, which is the healthy direction.
op_editor_core.editor_ui_state.state uses op_i18n.locale, so a change to op_i18n.locale can break op_editor_core.editor_ui_state.state, while a change to op_editor_core.editor_ui_state.state can't break op_i18n.locale.
Position
Below the diagonal: op_editor_core.editor_ui_state.state uses a module listed above it, which is the healthy direction.
op_editor_core.editor_ui_state.state uses op_editor_core.ui_draft, so a change to op_editor_core.ui_draft can break op_editor_core.editor_ui_state.state, while a change to op_editor_core.editor_ui_state.state can't break op_editor_core.ui_draft.
Position
Below the diagonal: op_editor_core.editor_ui_state.state uses a module listed above it, which is the healthy direction.
op_editor_core.editor_ui_state.state uses op_editor_core.agent_settings, so a change to op_editor_core.agent_settings can break op_editor_core.editor_ui_state.state, while a change to op_editor_core.editor_ui_state.state can't break op_editor_core.agent_settings.
Position
Below the diagonal: op_editor_core.editor_ui_state.state uses a module listed above it, which is the healthy direction.
op_editor_core.state uses op_editor_core.command, so a change to op_editor_core.command can break op_editor_core.state, while a change to op_editor_core.state can't break op_editor_core.command.
Position
Below the diagonal: op_editor_core.state uses a module listed above it, which is the healthy direction.
op_editor_core.state uses op_editor_core.editor_ui_state.home, so a change to op_editor_core.editor_ui_state.home can break op_editor_core.state, while a change to op_editor_core.state can't break op_editor_core.editor_ui_state.home.
Position
Below the diagonal: op_editor_core.state uses a module listed above it, which is the healthy direction.
op_editor_core.state uses op_editor_core.node_id, so a change to op_editor_core.node_id can break op_editor_core.state, while a change to op_editor_core.state can't break op_editor_core.node_id.
Position
Below the diagonal: op_editor_core.state uses a module listed above it, which is the healthy direction.
op_editor_core.state uses op_editor_core.property_panel_state, so a change to op_editor_core.property_panel_state can break op_editor_core.state, while a change to op_editor_core.state can't break op_editor_core.property_panel_state.
Position
Below the diagonal: op_editor_core.state uses a module listed above it, which is the healthy direction.
op_editor_core.state uses op_editor_core.scene_vars, so a change to op_editor_core.scene_vars can break op_editor_core.state, while a change to op_editor_core.state can't break op_editor_core.scene_vars.
Position
Below the diagonal: op_editor_core.state uses a module listed above it, which is the healthy direction.
op_editor_core.state uses op_editor_core.ui_draft, so a change to op_editor_core.ui_draft can break op_editor_core.state, while a change to op_editor_core.state can't break op_editor_core.ui_draft.
Position
Below the diagonal: op_editor_core.state uses a module listed above it, which is the healthy direction.
op_editor_core.state uses op_editor_core.editor_ui_state.state, so a change to op_editor_core.editor_ui_state.state can break op_editor_core.state, while a change to op_editor_core.state can't break op_editor_core.editor_ui_state.state.
Position
Below the diagonal: op_editor_core.state uses a module listed above it, which is the healthy direction.
op_editor_ui.widgets.property_panel_sections uses op_editor_core.property_panel_state, so a change to op_editor_core.property_panel_state can break op_editor_ui.widgets.property_panel_sections, while a change to op_editor_ui.widgets.property_panel_sections can't break op_editor_core.property_panel_state.
Position
Below the diagonal: op_editor_ui.widgets.property_panel_sections uses a module listed above it, which is the healthy direction.
op_editor_ui.widgets.property_panel_sections uses op_editor_ui.theme, so a change to op_editor_ui.theme can break op_editor_ui.widgets.property_panel_sections, while a change to op_editor_ui.widgets.property_panel_sections can't break op_editor_ui.theme.
Position
Below the diagonal: op_editor_ui.widgets.property_panel_sections uses a module listed above it, which is the healthy direction.
op_editor_ui.widgets.property_panel_sections uses op_editor_ui.widgets, so a change to op_editor_ui.widgets can break op_editor_ui.widgets.property_panel_sections, while a change to op_editor_ui.widgets.property_panel_sections can't break op_editor_ui.widgets.
Position
Below the diagonal: op_editor_ui.widgets.property_panel_sections uses a module listed above it, which is the healthy direction.
op_editor_ui.widgets.property_panel_sections uses op_editor_core.ui_draft, so a change to op_editor_core.ui_draft can break op_editor_ui.widgets.property_panel_sections, while a change to op_editor_ui.widgets.property_panel_sections can't break op_editor_core.ui_draft.
Position
Below the diagonal: op_editor_ui.widgets.property_panel_sections uses a module listed above it, which is the healthy direction.
op_editor_ui.widgets.property_panel_sections uses op_editor_ui.widgets.property_panel_snapshot, so a change to op_editor_ui.widgets.property_panel_snapshot can break op_editor_ui.widgets.property_panel_sections, while a change to op_editor_ui.widgets.property_panel_sections can't break op_editor_ui.widgets.property_panel_snapshot.
Position
Below the diagonal: op_editor_ui.widgets.property_panel_sections uses a module listed above it, which is the healthy direction.
op_editor_ui.widgets.property_panel_sections uses op_editor_core.editor_ui_state.state, so a change to op_editor_core.editor_ui_state.state can break op_editor_ui.widgets.property_panel_sections, while a change to op_editor_ui.widgets.property_panel_sections can't break op_editor_core.editor_ui_state.state.
Position
Below the diagonal: op_editor_ui.widgets.property_panel_sections uses a module listed above it, which is the healthy direction.
op_editor_ui.widgets.home_surface uses op_editor_core.editor_ui_state.home, so a change to op_editor_core.editor_ui_state.home can break op_editor_ui.widgets.home_surface, while a change to op_editor_ui.widgets.home_surface can't break op_editor_core.editor_ui_state.home.
Position
Below the diagonal: op_editor_ui.widgets.home_surface uses a module listed above it, which is the healthy direction.
op_editor_ui.widgets.home_surface uses op_editor_ui.theme, so a change to op_editor_ui.theme can break op_editor_ui.widgets.home_surface, while a change to op_editor_ui.widgets.home_surface can't break op_editor_ui.theme.
Position
Below the diagonal: op_editor_ui.widgets.home_surface uses a module listed above it, which is the healthy direction.
op_editor_ui.widgets.home_surface uses op_editor_ui.widgets, so a change to op_editor_ui.widgets can break op_editor_ui.widgets.home_surface, while a change to op_editor_ui.widgets.home_surface can't break op_editor_ui.widgets.
Position
Below the diagonal: op_editor_ui.widgets.home_surface uses a module listed above it, which is the healthy direction.
op_editor_ui.widgets.home_surface uses op_editor_core.editor_ui_state.state, so a change to op_editor_core.editor_ui_state.state can break op_editor_ui.widgets.home_surface, while a change to op_editor_ui.widgets.home_surface can't break op_editor_core.editor_ui_state.state.
Position
Below the diagonal: op_editor_ui.widgets.home_surface uses a module listed above it, which is the healthy direction.
op_editor_ui.widgets.home_surface uses op_editor_core.state, so a change to op_editor_core.state can break op_editor_ui.widgets.home_surface, while a change to op_editor_ui.widgets.home_surface can't break op_editor_core.state.
Position
Below the diagonal: op_editor_ui.widgets.home_surface uses a module listed above it, which is the healthy direction.
op_editor_ui.widgets.property_panel uses op_editor_core.property_panel_state, so a change to op_editor_core.property_panel_state can break op_editor_ui.widgets.property_panel, while a change to op_editor_ui.widgets.property_panel can't break op_editor_core.property_panel_state.
Position
Below the diagonal: op_editor_ui.widgets.property_panel uses a module listed above it, which is the healthy direction.
op_editor_ui.widgets.property_panel uses op_editor_ui.theme, so a change to op_editor_ui.theme can break op_editor_ui.widgets.property_panel, while a change to op_editor_ui.widgets.property_panel can't break op_editor_ui.theme.
Position
Below the diagonal: op_editor_ui.widgets.property_panel uses a module listed above it, which is the healthy direction.
op_editor_ui.widgets.property_panel uses op_editor_ui.widgets, so a change to op_editor_ui.widgets can break op_editor_ui.widgets.property_panel, while a change to op_editor_ui.widgets.property_panel can't break op_editor_ui.widgets.
Position
Below the diagonal: op_editor_ui.widgets.property_panel uses a module listed above it, which is the healthy direction.
op_editor_ui.widgets.property_panel uses op_i18n.locale, so a change to op_i18n.locale can break op_editor_ui.widgets.property_panel, while a change to op_editor_ui.widgets.property_panel can't break op_i18n.locale.
Position
Below the diagonal: op_editor_ui.widgets.property_panel uses a module listed above it, which is the healthy direction.
op_editor_ui.widgets.property_panel uses op_editor_core.ui_draft, so a change to op_editor_core.ui_draft can break op_editor_ui.widgets.property_panel, while a change to op_editor_ui.widgets.property_panel can't break op_editor_core.ui_draft.
Position
Below the diagonal: op_editor_ui.widgets.property_panel uses a module listed above it, which is the healthy direction.
op_editor_ui.widgets.property_panel uses op_editor_ui.widgets.property_panel_snapshot, so a change to op_editor_ui.widgets.property_panel_snapshot can break op_editor_ui.widgets.property_panel, while a change to op_editor_ui.widgets.property_panel can't break op_editor_ui.widgets.property_panel_snapshot.
Position
Below the diagonal: op_editor_ui.widgets.property_panel uses a module listed above it, which is the healthy direction.
op_editor_ui.widgets.property_panel uses op_editor_ui.widgets.property_panel_sections, so a change to op_editor_ui.widgets.property_panel_sections can break op_editor_ui.widgets.property_panel, while a change to op_editor_ui.widgets.property_panel can't break op_editor_ui.widgets.property_panel_sections.
Position
Below the diagonal: op_editor_ui.widgets.property_panel uses a module listed above it, which is the healthy direction.
op_host_services.web_canvas_server uses op_editor_core.command, so a change to op_editor_core.command can break op_host_services.web_canvas_server, while a change to op_host_services.web_canvas_server can't break op_editor_core.command.
Position
Below the diagonal: op_host_services.web_canvas_server uses a module listed above it, which is the healthy direction.
op_host_services.web_canvas_server uses op_editor_core.agent_settings, so a change to op_editor_core.agent_settings can break op_host_services.web_canvas_server, while a change to op_host_services.web_canvas_server can't break op_editor_core.agent_settings.
Position
Below the diagonal: op_host_services.web_canvas_server uses a module listed above it, which is the healthy direction.
op_host_services.web_canvas_server uses op_editor_core.state, so a change to op_editor_core.state can break op_host_services.web_canvas_server, while a change to op_host_services.web_canvas_server can't break op_editor_core.state.
Position
Below the diagonal: op_host_services.web_canvas_server uses a module listed above it, which is the healthy direction.
op_orchestrator.types uses op_editor_core.command, so a change to op_editor_core.command can break op_orchestrator.types, while a change to op_orchestrator.types can't break op_editor_core.command.
Position
Below the diagonal: op_orchestrator.types uses a module listed above it, which is the healthy direction.
op_orchestrator.types uses op_editor_core.node_id, so a change to op_editor_core.node_id can break op_orchestrator.types, while a change to op_orchestrator.types can't break op_editor_core.node_id.
Position
Below the diagonal: op_orchestrator.types uses a module listed above it, which is the healthy direction.
op_orchestrator.types uses op_editor_core.state, so a change to op_editor_core.state can break op_orchestrator.types, while a change to op_orchestrator.types can't break op_editor_core.state.
Position
Below the diagonal: op_orchestrator.types uses a module listed above it, which is the healthy direction.
34→37 op_orchestrator.types uses op_orchestrator.planpart of a loop✕
Connections
1 pair of types, where a type in op_orchestrator.types uses a type in op_orchestrator.plan.
op_orchestrator.types uses op_orchestrator.plan, so a change to op_orchestrator.plan can break op_orchestrator.types, while a change to op_orchestrator.types can't break op_orchestrator.plan.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
op_host_native.widget_host uses op_editor_core.command, so a change to op_editor_core.command can break op_host_native.widget_host, while a change to op_host_native.widget_host can't break op_editor_core.command.
Position
Below the diagonal: op_host_native.widget_host uses a module listed above it, which is the healthy direction.
op_host_native.widget_host uses op_editor_core.node_id, so a change to op_editor_core.node_id can break op_host_native.widget_host, while a change to op_host_native.widget_host can't break op_editor_core.node_id.
Position
Below the diagonal: op_host_native.widget_host uses a module listed above it, which is the healthy direction.
op_host_native.widget_host uses op_editor_core.property_panel_state, so a change to op_editor_core.property_panel_state can break op_host_native.widget_host, while a change to op_host_native.widget_host can't break op_editor_core.property_panel_state.
Position
Below the diagonal: op_host_native.widget_host uses a module listed above it, which is the healthy direction.
op_host_native.widget_host uses op_editor_ui.theme, so a change to op_editor_ui.theme can break op_host_native.widget_host, while a change to op_host_native.widget_host can't break op_editor_ui.theme.
Position
Below the diagonal: op_host_native.widget_host uses a module listed above it, which is the healthy direction.
op_host_native.widget_host uses op_editor_ui.widgets, so a change to op_editor_ui.widgets can break op_host_native.widget_host, while a change to op_host_native.widget_host can't break op_editor_ui.widgets.
Position
Below the diagonal: op_host_native.widget_host uses a module listed above it, which is the healthy direction.
op_host_native.widget_host uses op_editor_core.scene_vars, so a change to op_editor_core.scene_vars can break op_host_native.widget_host, while a change to op_host_native.widget_host can't break op_editor_core.scene_vars.
Position
Below the diagonal: op_host_native.widget_host uses a module listed above it, which is the healthy direction.
op_host_native.widget_host uses op_editor_core.ui_draft, so a change to op_editor_core.ui_draft can break op_host_native.widget_host, while a change to op_host_native.widget_host can't break op_editor_core.ui_draft.
Position
Below the diagonal: op_host_native.widget_host uses a module listed above it, which is the healthy direction.
op_host_native.widget_host uses op_html.snapshot, so a change to op_html.snapshot can break op_host_native.widget_host, while a change to op_host_native.widget_host can't break op_html.snapshot.
Position
Below the diagonal: op_host_native.widget_host uses a module listed above it, which is the healthy direction.
op_host_native.widget_host uses op_editor_core.agent_settings, so a change to op_editor_core.agent_settings can break op_host_native.widget_host, while a change to op_host_native.widget_host can't break op_editor_core.agent_settings.
Position
Below the diagonal: op_host_native.widget_host uses a module listed above it, which is the healthy direction.
op_host_native.widget_host uses op_preview_core.session, so a change to op_preview_core.session can break op_host_native.widget_host, while a change to op_host_native.widget_host can't break op_preview_core.session.
Position
Below the diagonal: op_host_native.widget_host uses a module listed above it, which is the healthy direction.
op_host_native.widget_host uses op_editor_core.state, so a change to op_editor_core.state can break op_host_native.widget_host, while a change to op_host_native.widget_host can't break op_editor_core.state.
Position
Below the diagonal: op_host_native.widget_host uses a module listed above it, which is the healthy direction.
op_host_native.widget_host uses op_editor_ui.widgets.property_panel, so a change to op_editor_ui.widgets.property_panel can break op_host_native.widget_host, while a change to op_host_native.widget_host can't break op_editor_ui.widgets.property_panel.
Position
Below the diagonal: op_host_native.widget_host uses a module listed above it, which is the healthy direction.
op_host_web.widget_host uses op_editor_core.editor_ui_state.home, so a change to op_editor_core.editor_ui_state.home can break op_host_web.widget_host, while a change to op_host_web.widget_host can't break op_editor_core.editor_ui_state.home.
Position
Below the diagonal: op_host_web.widget_host uses a module listed above it, which is the healthy direction.
op_host_web.widget_host uses op_editor_core.node_id, so a change to op_editor_core.node_id can break op_host_web.widget_host, while a change to op_host_web.widget_host can't break op_editor_core.node_id.
Position
Below the diagonal: op_host_web.widget_host uses a module listed above it, which is the healthy direction.
op_host_web.widget_host uses op_editor_core.property_panel_state, so a change to op_editor_core.property_panel_state can break op_host_web.widget_host, while a change to op_host_web.widget_host can't break op_editor_core.property_panel_state.
Position
Below the diagonal: op_host_web.widget_host uses a module listed above it, which is the healthy direction.
op_host_web.widget_host uses op_editor_ui.theme, so a change to op_editor_ui.theme can break op_host_web.widget_host, while a change to op_host_web.widget_host can't break op_editor_ui.theme.
Position
Below the diagonal: op_host_web.widget_host uses a module listed above it, which is the healthy direction.
op_host_web.widget_host uses op_editor_ui.widgets, so a change to op_editor_ui.widgets can break op_host_web.widget_host, while a change to op_host_web.widget_host can't break op_editor_ui.widgets.
Position
Below the diagonal: op_host_web.widget_host uses a module listed above it, which is the healthy direction.
op_host_web.widget_host uses op_editor_core.scene_vars, so a change to op_editor_core.scene_vars can break op_host_web.widget_host, while a change to op_host_web.widget_host can't break op_editor_core.scene_vars.
Position
Below the diagonal: op_host_web.widget_host uses a module listed above it, which is the healthy direction.
op_host_web.widget_host uses op_editor_core.ui_draft, so a change to op_editor_core.ui_draft can break op_host_web.widget_host, while a change to op_host_web.widget_host can't break op_editor_core.ui_draft.
Position
Below the diagonal: op_host_web.widget_host uses a module listed above it, which is the healthy direction.
op_host_web.widget_host uses op_html.snapshot, so a change to op_html.snapshot can break op_host_web.widget_host, while a change to op_host_web.widget_host can't break op_html.snapshot.
Position
Below the diagonal: op_host_web.widget_host uses a module listed above it, which is the healthy direction.
op_host_web.widget_host uses op_editor_core.agent_settings, so a change to op_editor_core.agent_settings can break op_host_web.widget_host, while a change to op_host_web.widget_host can't break op_editor_core.agent_settings.
Position
Below the diagonal: op_host_web.widget_host uses a module listed above it, which is the healthy direction.
op_host_web.widget_host uses op_preview_core.session, so a change to op_preview_core.session can break op_host_web.widget_host, while a change to op_host_web.widget_host can't break op_preview_core.session.
Position
Below the diagonal: op_host_web.widget_host uses a module listed above it, which is the healthy direction.
op_host_web.widget_host uses op_editor_core.state, so a change to op_editor_core.state can break op_host_web.widget_host, while a change to op_host_web.widget_host can't break op_editor_core.state.
Position
Below the diagonal: op_host_web.widget_host uses a module listed above it, which is the healthy direction.
op_host_web.widget_host uses op_editor_ui.widgets.property_panel, so a change to op_editor_ui.widgets.property_panel can break op_host_web.widget_host, while a change to op_host_web.widget_host can't break op_editor_ui.widgets.property_panel.
Position
Below the diagonal: op_host_web.widget_host uses a module listed above it, which is the healthy direction.
op_orchestrator.plan uses op_orchestrator.types, so a change to op_orchestrator.types can break op_orchestrator.plan, while a change to op_orchestrator.plan can't break op_orchestrator.types.
Position
Below the diagonal: op_orchestrator.plan uses a module listed above it, which is the healthy direction.
op_orchestrator.repair_summary uses op_editor_core.command, so a change to op_editor_core.command can break op_orchestrator.repair_summary, while a change to op_orchestrator.repair_summary can't break op_editor_core.command.
Position
Below the diagonal: op_orchestrator.repair_summary uses a module listed above it, which is the healthy direction.
op_orchestrator.repair_summary uses op_editor_core.node_id, so a change to op_editor_core.node_id can break op_orchestrator.repair_summary, while a change to op_orchestrator.repair_summary can't break op_editor_core.node_id.
Position
Below the diagonal: op_orchestrator.repair_summary uses a module listed above it, which is the healthy direction.
op_orchestrator.repair_summary uses op_editor_core.state, so a change to op_editor_core.state can break op_orchestrator.repair_summary, while a change to op_orchestrator.repair_summary can't break op_editor_core.state.
Position
Below the diagonal: op_orchestrator.repair_summary uses a module listed above it, which is the healthy direction.
op_orchestrator.repair_summary uses op_orchestrator.types, so a change to op_orchestrator.types can break op_orchestrator.repair_summary, while a change to op_orchestrator.repair_summary can't break op_orchestrator.types.
Position
Below the diagonal: op_orchestrator.repair_summary uses a module listed above it, which is the healthy direction.
op_engine_ffi.lifecycle uses op_editor_core.state, so a change to op_editor_core.state can break op_engine_ffi.lifecycle, while a change to op_engine_ffi.lifecycle can't break op_editor_core.state.
Position
Below the diagonal: op_engine_ffi.lifecycle uses a module listed above it, which is the healthy direction.
op_engine_ffi.lifecycle uses op_host_native.widget_host, so a change to op_host_native.widget_host can break op_engine_ffi.lifecycle, while a change to op_engine_ffi.lifecycle can't break op_host_native.widget_host.
Position
Below the diagonal: op_engine_ffi.lifecycle uses a module listed above it, which is the healthy direction.
op_host_desktop uses op_editor_core.editor_ui_state.chrome, so a change to op_editor_core.editor_ui_state.chrome can break op_host_desktop, while a change to op_host_desktop can't break op_editor_core.editor_ui_state.chrome.
Position
Below the diagonal: op_host_desktop uses a module listed above it, which is the healthy direction.
op_host_desktop uses op_i18n.locale, so a change to op_i18n.locale can break op_host_desktop, while a change to op_host_desktop can't break op_i18n.locale.
Position
Below the diagonal: op_host_desktop uses a module listed above it, which is the healthy direction.
op_host_desktop uses op_host_native.widget_host, so a change to op_host_native.widget_host can break op_host_desktop, while a change to op_host_desktop can't break op_host_native.widget_host.
Position
Below the diagonal: op_host_desktop uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 60% · Adequate · gated by D2, R3 ·
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
A03:2025 — Software Supply Chain Failures
79
High / Critical
A05:2025 — Injection
50
High / Critical
A02:2025 — Security Misconfiguration
4
High / Critical
Roadmap
Top priorities: Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video; Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh; Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
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.
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 — 92
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 — 4318
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 — 144
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 18
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 76 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.
Every figure here is one of two kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.
What we checked — 76 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, 4515 of 4554 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the dependency install for packages/op-vscode/ failed in the analyzer sandbox (npm error code EUNSUPPORTEDPROTOCOL), so the suite never ran. Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo.
D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 215 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 1,349 test source file(s) (.rb, .swift, .rs) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT MEASURED: the JavaScript/TypeScript suite could not be re-run in the analyzer sandbox — the dependency install for packages/op-vscode/ failed in the analyzer sandbox (npm error code EUNSUPPORTEDPROTOCOL), so the suite never ran. This is OUR limitation, not a defect in the repo — it is excluded from the score.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the bun:test suite in packages/op-vscode/ was NOT MEASURED: the dependency install for packages/op-vscode/ failed in the analyzer sandbox (npm error code EUNSUPPORTEDPROTOCOL), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in packages/op-web-sdk/ was NOT MEASURED: the dependency install for packages/op-web-sdk/ failed in the analyzer sandbox (npm error code EUNSUPPORTEDPROTOCOL), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in packages/op-web-sdk-react/ was NOT MEASURED: the dependency install for packages/op-web-sdk-react/ failed in the analyzer sandbox (npm error code EUNSUPPORTEDPROTOCOL), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in packages/op-web-sdk-vue/ was NOT MEASURED: the dependency install for packages/op-web-sdk-vue/ failed in the analyzer sandbox (npm error code EUNSUPPORTEDPROTOCOL), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D12 Dependency Hygiene — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — a Gradle build resolved 152 artifact(s) across its subprojects (66 behind a shipped release, reported), but the currency signal was not established over the whole graph, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares REDACTED, but the licence verdict published here was taken over its crate dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their names are consistent.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
D27 Navigability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
D31 IaC & Container Security — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. REDACTED.web-rust.dockerignore carries no `FROM` instruction, so it declares no build stage and every REDACTED rule this engine owns — the runtime-hardening, key-material, mutable-clone, no-op-shim, build-context, trust-anchor, install-guard, setuid and world-writable-path rules — is outside its own premise there and returned nothing. That silence is deliberate and correct: with no base image there is no image to reason about. It is reported here because it is NOT the same fact as a clean file, and coverage is stated as 20 of 21 Infrastructure-as-Code manifest(s) fully judged rather than as 100%. The vendor scanners (trivy, checkov) do read these files and their findings above stand; only this engine's own stage-keyed rules are absent. No owner action: a build file with no FROM is a legitimate include fragment.
AX6 Interface segregation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Boot via AndroidApp (packaging/android/app). the Android app did not build — `./gradlew :app:assembleDebug` exited 1: uld not get resource 'https://artifact.bytedance.com/repository/AwemeOpenSDK/com/bytedance/ies/ugc/aweme/opensdk-common/0.2.0.10/opensdk-common-0.2.0.10.pom'.
> Could not GET 'https://arti…; runtime evidence skipped (launch chosen because packaging/android/app/build.gradle.kts applies the Android application plugin and packaging/android/gradlew builds it).
ED5 Idempotency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check decides whether a handler's mutation is safe to re-run by recognising its persistence writes (a database save, a repository write, an event publish) and its guards. Those markers are .NET member names, so in this repository's language a write such as `repository.save(order)` is not recognised and a same-named call on an unrelated library type could be. The handlers were found; their idempotency was neither confirmed nor ruled out.
GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Kotlin, Python, Rust, Swift, c is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Kotlin, Python, Rust, Swift, c is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 reads a prose claim (a path, a setting, a variable, a route, a version, a project, an install, a bare project name in a command) only in text identified as English: the cues that tell a claim from an absence, the past, a plan or an example are an English lexicon, and on other text they would let a false claim through. Links, image targets, fenced commands with an explicit path or a package-manager script, and env-fence variables are checked in every language. 'und' is text the identifier could not name (too short, mixed script, no function words).
M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
R10 Code Duplication — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 5 further occurrence(s) are not listed individually; the score already reflects all 45.
R2 Cyclomatic Complexity — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 5 further occurrence(s) are not listed individually; the score already reflects all 45.
X10 Duplicated predicate — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 185 further occurrence(s) are not listed individually; the score already reflects all 225.
X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X13 Undrained process stream — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X16 Unfloored truncation loop — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X17 Uncapped recursion over a caller-supplied document — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X18 Disposal-pattern correctness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X24 Document value interpolated into markup unescaped — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X26 Unsynchronised callback handoff — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X3 Exception handling — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X7 Silent fallback defaults — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 22 further occurrence(s) are not listed individually; the score already reflects all 62.
Repo exclusion declarations: 10 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
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 REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
DM4 Rich vs anemic domain model: Behaviour is detected as state mutation inside a method body — a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
489 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was EditorState::apply_with_allocator at 177. A further 166 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 op_i18n::i18n::en::lookup at 765 — they are counted neither in the figure above nor in this dimension's score. 101 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: crates/op-i18n/src/i18n/en.rs (op_i18n::i18n::en::lookup at 765), crates/op-i18n/src/i18n/zh_cn.rs (op_i18n::i18n::zh_cn::lookup at 765), crates/op-i18n/src/i18n/en_collab.rs (op_i18n::i18n::en_collab::lookup at 533), crates/op-i18n/src/i18n/zh_cn_collab.rs (op_i18n::i18n::zh_cn_collab::lookup at 533), crates/op-i18n/src/i18n/en_panel.rs (op_i18n::i18n::en_panel::lookup at 455), and 96 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.
+ 102 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 4 bodies over 120 down to 120 or less in Cyclomatic Complexity — start with EditorState::apply_with_allocator (cyclomatic 177), op_host_services::mcp_serve::registry::rebuild_registry (cyclomatic 151), WidgetHost::apply_cursor_move (cyclomatic 151). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 4 together lifts Cyclomatic Complexity from 5.4 to about 5.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
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.
+ 163 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 8 bodies over 120 down to 120 or less in Cognitive Complexity — start with WidgetHost::apply_cursor_move (cognitive 264), op_figma::instance::apply_instance_overrides_cached (cognitive 248), op_editor_ui::widgets::canvas_viewport_paint::paint_node_inner (cognitive 177). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 8 together lifts Cognitive Complexity from 3.6 to about 4.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.1 / 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.
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 153 FunctionTooLong finding(s) in God Classes — start with connection.rs (6), op_ck_bridge.js (3), op_host_web.js (2). — One of this dimension's main actionable groups (153 warning-level).
Resolve the 87 MethodTooLong finding(s) in God Classes — start with paint.rs (4), keyboard_escape.rs (2), overlay_cursor.rs (2). — One of this dimension's main actionable groups (87 warning-level).
Resolve the 68 FileTooLong finding(s) in God Classes — start with op_host_web.js (2), paint.rs (2), op_ck_bridge.js. — One of this dimension's main actionable groups (68 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.
1113 duplicated block group(s) detected. 6.4 % of the production lines (51,730 of 814,347) are in a reported copy. A further 961 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 19 of the 2074 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.
+ 321 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 95 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with anthropic.rs (2), layout_props.rs (2), online_run_loop.rs (2). — One of this dimension's main actionable groups (95 warning-level).
Resolve the 90 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with prompt_center_catalog.rs (2), preview_device_switcher.rs (2), mcp_integrations.rs (2). — One of this dimension's main actionable groups (90 warning-level).
Resolve the 84 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with codegen_html.rs (2), guest.rs (2), export_dialog.rs (2). — One of this dimension's main actionable groups (84 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling7.1 / 10Strong✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
59 production modules (Gradle+Cargo+npm+XcodeGen), 0 dependency cycle(s), 2 unstable depended-on module(s). Read from the build's own module declarations; edges a convention plugin adds from buildSrc or build-logic are not visible there; an XcodeGen target's dependency on a local Swift package or on a target of another project is not visible there; 20 module(s) off the main sequence, with abstractness counted on 57 of the 59 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).
Off the main sequence: @zseven-w/op-web-sdk · ×19
Unstable project op-engine-ffi
Unstable project op-host-web
Off the main sequence: op-preview-contracts
What to do
Resolve the 19 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (19 warning-level).
Resolve the 1 Unstable project op-engine-ffi finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Unstable project op-host-web finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
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 8 Low cohesion finding(s) in Cohesion (LCOM4) — start with chat.rs (2), skia.rs, agent_settings.rs. — One of this dimension's main actionable groups (8 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D10 · Test Quality10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
0 skipped, 0 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 215 tests. Measured on the JavaScript/TypeScript suite only — at least 1,349 test source file(s) (.rb, .swift, .rs) went unread, so its test quality is unmeasured and is not in these counts.
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 746 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's REDACTED closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. This repository publishes itself under MIT, which is its own choice and is not judged here. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate dependencies and nothing else. The repository also declares REDACTED, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
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: crates/op-orchestrator/src/prompt_subagent.rs (38×47=1786); crates/op-host-native/src/widget_host/paint.rs (20×86=1720); crates/op-editor-ui/src/widgets/home_surface.rs (26×54=1404) Repeated repair below the complexity floor: crates/op-orchestrator/src/lib.rs (35 of 52 changes were fixes); crates/op-orchestrator/src/geometry_validation.rs (23 of 25 changes were fixes); crates/op-orchestrator/src/run.rs (18 of 19 changes were fixes)
Resolve the 154 Hotspot finding(s) in Churn × Complexity Hotspots — start with paint.rs (3), connection.rs (2), main.rs (2). — One of this dimension's main actionable groups (154 warning-level).
Resolve the 98 Repeated repair finding(s) in Churn × Complexity Hotspots — start with lib.rs (2), retry.rs (2), geometry_validation.rs. — One of this dimension's main actionable groups (98 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 Factor6.6 / 10Adequate✓ 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.
877 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is crates/op-html/src/import_warning.rs. Counted over 2595 of the 2953 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 · ×2
Further sole-owners (lower concentration)
What to do
Resolve the 2 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (2 recommendation-level).
Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
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.
10 deducted task-comment markers across 814347 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
Resolve the 10 TodoComment finding(s) in Explicit Debt — start with validation_fixes_b3.rs (4), cleanup_nav_surface_tests.rs, cli_provider_probe.rs. — One of this dimension's main actionable groups (10 warning-level).
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
2 of 2 documentation facets pass in full. 64 document(s) read across 6 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.
No ADRs foundpackaging/android/app/build.gradle.kts:2
What to do
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with build.gradle.kts. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.
2 naming inconsistencies among 52 declarations measured against a convention their peers follow.
`avatarUrl` spells `Url` where 26 names in the project spell it `URL`packaging/ios/Sources/AccountCenterViewController.swift:9
`deviceId` spells `Id` where 24 names in the project spell it `ID`packaging/ios/Sources/AccountCenterViewController.swift:10
What to do
Resolve the 1 `avatarUrl` spells `Url` where 26 names in the project spell it `URL` finding(s) in Naming Consistency — start with AccountCenterViewController.swift. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 `deviceId` spells `Id` where 24 names in the project spell it `ID` finding(s) in Naming Consistency — start with AccountCenterViewController.swift. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d21_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).
Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.
8 of 60 build units (Cargo, Gradle, XcodeGen, npm) 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).
50 finding(s): 0 critical, 36 high, 5 medium, 9 low. 36 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 20 file(s) — `crates/op-editor-host-core/src/settings_io.rs` (line 487), `crates/op-editor-host-core/src/settings_payload.rs` (line 261), `crates/op-figma/examples/bench_memory.rs` (line 93, line 103), `crates/op-host-web/assets/canvaskit/canvaskit.js`, `crates/op-host-web/pkg-webgl/op_host_web.js`, … (+15 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 4 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3). — One of this dimension's main actionable groups (3 warning-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
No action in Static Analysis (SAST) — all 36 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (36 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
+ 5 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 30 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (16), REDACTED (13), REDACTED. — One of this dimension's main actionable groups (30 issue-level).
Resolve the 5 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (3), REDACTED (2). — One of this dimension's main actionable groups (5 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).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 2 High IaC finding(s) in IaC & Container Security — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
Resolve the 2 Low IaC finding(s) in IaC & Container Security — start with REDACTED (2). — One of this dimension's main actionable groups (2 recommendation-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.
2 of 2595 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is crates/op-host-native/src/backend/skia/shaped_text.rs. Counted over 2595 of the 2953 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
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 15 Boundary-crossing change coupling finding(s) in Change Coupling — start with hi_collab.rs, vi_collab.rs, tr_collab.rs. — One of this dimension's main actionable groups (15 issue-level).
Resolve the 14 Change coupling finding(s) in Change Coupling — start with main.rs (2), click.rs, agent_settings.rs. — One of this dimension's main actionable groups (14 warning-level).
Resolve the 6 Change-coupling hub finding(s) in Change Coupling — start with variables.rs, tool_schemas.rs, mcp_serve.rs. — One of this dimension's main actionable groups (6 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.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 6 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (6 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
1 end-of-life runtime(s) and 0 end-of-life framework(s), read from 3 platform declaration(s) and 11 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.
Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life — start with rust-toolchain.toml. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d44_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC1 · Text alternatives2.2 / 10Weak✓ Tool-verified
Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.
A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content. (×3) — crates/op-host-services/src/web_static/index.html:45, crates/op-host-web/smoke/step-1b.html:37, crates/op-web-sdk/smoke/index.html:22
What to do
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Do you agree with this assessment?
AC2 · Forms & labels5.4 / 10Adequate✓ Tool-verified
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label. — packages/op-chrome-extension/popup.html:86
What to do
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.
Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×3) — crates/op-host-services/src/web_static/missing_bundle.html:2, crates/op-web-sdk/smoke/index.html:2, packages/op-chrome-extension/popup.html:2
The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). — packages/op-chrome-extension/popup.html:2
A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>. — packages/op-chrome-extension/popup.html:2
What to do
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.
Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.
Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.
Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
`.btn-primary` sets color: #ffffff on background-color: #1b8fc4 — 3.6:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — packages/op-chrome-extension/popup.css:291
What to do
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.
Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.
Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.
Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.
Other · Domain Modelling — Whether an aggregate references another aggregate by identity rather than embedding it by object reference.
Method: Roslyn (DDD-gated): aggregate roots identified by convention; each aggregate field checked for direct references to other aggregates versus id-only. Deterministic, DDD-native.
Coverage: Population: aggregate roots identified by AggregateRoot/IAggregateRoot base/interface NAME convention; reference-by-identity then checked exhaustively within that set — a root not using those names is invisible.
Other · Domain Modelling — Whether domain identifiers are strongly typed (a newtype wrapper) rather than raw primitives — consistency once an idiom exists.
Method: Roslyn (DDD-gated): strongly-typed id adoption on domain entities/events; raw Guid/int/string ids counted versus wrapped types. An id wrapper is recognised by VALUE SEMANTICS, not by being a struct — a record struct, a record class (`record ApartmentId(Guid Value)`) or a class declared by a typed-id base (`class MemberId : TypedIdValueBase`) all count, while a plain mutable class (reference equality) and a verb-phrase query record (`GetCustomerById`) do not. Deterministic, adoption percentage.
Coverage: Population: id-like members by *Id/*Key NAME suffix; strongly-typed-ID shape then checked semantically — non-suffixed identifiers are not seen.
Do you agree with this assessment?
DM4 · Rich vs anemic domain model10.0 / 10Exemplary✓ Tool-verified
Other · Domain Modelling — Whether domain entities own their behaviour (invariant-enforcing commands) rather than being data-only structs driven by a foreign service.
Method: Roslyn (DDD-gated): entity method BODIES classified mutator-vs-query — only methods that mutate the entity's own declared state count as invariant-protecting behaviour, so a getter/passthrough doesn't rescue an anemic class. Deterministic, exhaustive over domain-layer entities.
Coverage: Population: entities by name/base convention; rich-vs-anemic judged by classifying each method body mutator-vs-query — logic-bearing domain types outside the convention are invisible.
Other · Domain Modelling — Whether a domain type's identity-bearing field stays immutable — a `pub` mutable field under a hand-rolled Hash/PartialEq breaks the value-identity invariant.
Method: Roslyn (DDD-gated): entities scanned for publicly writable state — public setters, and (C#/VB) own mutable collections handed out through an auto-property, a public field or a bare-field expression getter, where a computed/copying getter is never charged. One finding per entity; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.
Coverage: Population: entities by convention; encapsulation (setter shape) checked exhaustively within the set.
Other · Event Sourcing — Whether the recovery-replay fold is deterministic — state derived purely from each event's own fields, no clock/random/IO on the replay path.
Method: Roslyn syntax scan (event-sourcing gated): Apply/When folds checked for forbidden tokens (DateTime.Now, Guid.NewGuid, Random, IO), stripped of comments/strings. Deterministic, hard fact per fold.
Other · Event Sourcing — Whether domain events stay immutable (private fields, set once) rather than carrying mutable state.
Method: Roslyn scan (event-sourcing gated): persisted events checked for public setters; immutability verified per property/field. Deterministic, hard fact.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.
Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
Do you agree with this assessment?
P2 · Observability6.6 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 14/26 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `crates/op-chat-agent`, `crates/op-cli`, `crates/op-collab-host`, `crates/op-collab-relay-client` and 7 more.
`packages/op-vscode/src/extension.ts` reports through `console.*` at line 49 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/op-vscode/src/extension.ts:49
`packages/op-vscode/src/extension.ts` reports through `console.*` at line 53 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/op-vscode/src/extension.ts:53
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Route service-code `console.*` output through the module's structured logger (with named fields), so delivery outcomes and failures reach the log pipeline with a level.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
`REDACTED` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — REDACTED:121
What to do
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
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 outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.
Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
Do you agree with this assessment?
R1 · Type Safety7.1 / 10Strong✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
React / JS · Code Health — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.
13 of the duplicated blocks reported below have copies in at least two of the sibling directories pkg-ck, src under crates/op-host-web/. That concentration is one structural fact, not 13 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 13 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:41
crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:41 · crates/op-host-web/src/op_ck_bridge.js:367 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:41
crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:202 · crates/op-host-web/src/op_ck_bridge.js:838 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:202
crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:340 · crates/op-host-web/src/op_ck_bridge.js:1308 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:340
packages/op-chrome-extension/i18n.js:210 · packages/op-chrome-extension/i18n.js:255 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/op-chrome-extension/i18n.js:210
crates/op-host-web/src/op_ck_bridge.js:1266 · crates/op-host-web/src/op_ck_bridge.js:1285 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — crates/op-host-web/src/op_ck_bridge.js:1266
packages/op-chrome-extension/design-capture.js:606 · packages/op-chrome-extension/design-evidence.js:233 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/op-chrome-extension/design-capture.js:606
packages/op-vscode/src/vscode/configure-command.ts:52 · packages/op-vscode/src/vscode/configure-command.ts:102 — the two spans are one implementation copied and then locally edited — 109 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/op-vscode/src/vscode/configure-command.ts:52
crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:118 · crates/op-host-web/src/op_ck_bridge.js:444 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:118
packages/op-chrome-extension/capture.js:210 · packages/op-chrome-extension/picker.js:294 — the two spans are one implementation copied and then locally edited — 149 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/op-chrome-extension/capture.js:210
packages/op-chrome-extension/popup.js:187 · packages/op-chrome-extension/popup.js:214 — the two spans are one implementation copied and then locally edited — 80 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/op-chrome-extension/popup.js:187
crates/op-host-web/src/op_ck_image_cache.js:142 · crates/op-host-web/src/op_ck_image_cache.js: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. — crates/op-host-web/src/op_ck_image_cache.js:142
crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:380 · crates/op-host-web/src/op_ck_bridge.js:977 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:380
crates/op-host-web/src/op_ck_bridge.js:761 · crates/op-host-web/src/op_ck_bridge.js:783 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — crates/op-host-web/src/op_ck_bridge.js:761
packages/op-vscode/src/session/pen-session.ts:412 · packages/op-vscode/src/session/pen-session.ts:583 — the two spans are one implementation copied and then locally edited — 102 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/op-vscode/src/session/pen-session.ts:412
crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:253 · crates/op-host-web/src/op_ck_bridge.js:1124 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:253
crates/op-host-web/src/op_ck_bridge.js:1778 · crates/op-host-web/src/op_ck_bridge.js:1791 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — crates/op-host-web/src/op_ck_bridge.js:1778
packages/op-web-sdk-react/src/design-view.tsx:25 · packages/op-web-sdk-vue/src/design-view.ts:21 — the two spans are one implementation copied and then locally edited — 67 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/op-web-sdk-react/src/design-view.tsx:25
packages/scripts/sync-version.mjs:258 · packages/scripts/sync-version.mjs:281 — the two spans are one implementation copied and then locally edited — 90 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/scripts/sync-version.mjs:258
crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:168 · crates/op-host-web/src/op_ck_bridge.js:572 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:168
crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:241 · crates/op-host-web/src/op_ck_bridge.js:1013 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:241
crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:431 · crates/op-host-web/src/op_ck_bridge.js:1909 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:431
crates/op-host-web/src/op_ck_bridge.js:1517 · crates/op-host-web/src/op_ck_bridge.js:1636 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — crates/op-host-web/src/op_ck_bridge.js:1517
packages/op-chrome-extension/design-capture.js:61 · packages/op-chrome-extension/design-evidence.js:28 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — packages/op-chrome-extension/design-capture.js:61
packages/op-web-sdk-react/vitest.config.ts:1 · packages/op-web-sdk-vue/vitest.config.ts:2 — the two spans are one implementation copied and then locally edited — 80 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/op-web-sdk-react/vitest.config.ts:1
crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:9 · crates/op-host-web/src/op_ck_bridge.js:9 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:9
crates/op-html/assets/snapshot-extractor.js:420 · crates/op-html/assets/snapshot-extractor.js:765 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — crates/op-html/assets/snapshot-extractor.js:420
packages/op-chrome-extension/client.js:94 · packages/op-chrome-extension/client.js:452 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/op-chrome-extension/client.js:94
packages/op-vscode/src/vscode/shell-messages.ts:36 · packages/op-vscode/src/vscode/shell-messages.ts:87 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — packages/op-vscode/src/vscode/shell-messages.ts:36
crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:151 · crates/op-host-web/src/op_ck_bridge.js:544 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:151
crates/op-html/assets/snapshot-extractor.js:1071 · crates/op-html/assets/snapshot-extractor.js:1132 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — crates/op-html/assets/snapshot-extractor.js:1071
packages/op-chrome-extension/account.js:130 · packages/op-chrome-extension/client.js:432 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/op-chrome-extension/account.js:130
packages/op-chrome-extension/background.js:178 · packages/op-chrome-extension/design-md.js:34 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — packages/op-chrome-extension/background.js:178
packages/op-chrome-extension/capture.js:90 · packages/op-chrome-extension/capture.js:193 — the two spans are one implementation copied and then locally edited — 59 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/op-chrome-extension/capture.js:90
crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:409 · crates/op-host-web/src/op_ck_bridge.js:1761 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:409
packages/op-chrome-extension/background.js:223 · packages/op-chrome-extension/popup.js:316 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — packages/op-chrome-extension/background.js:223
packages/op-chrome-extension/design-capture.js:402 · packages/op-chrome-extension/design-capture.js:413 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/op-chrome-extension/design-capture.js:402
crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:312 · crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:324 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:312
crates/op-host-web/src/op_ck_bridge.js:182 · crates/op-host-web/src/op_ck_bridge.js:221 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — crates/op-host-web/src/op_ck_bridge.js:182
crates/op-host-web/src/op_ck_bridge.js:1557 · crates/op-host-web/src/op_ck_bridge.js:1648 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — crates/op-host-web/src/op_ck_bridge.js:1557
What to do
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.
Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.
collectDesignEvidenceInPage has cyclomatic complexity 47 and cognitive complexity 78; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/op-chrome-extension/design-capture.js:19
measureParagraph has cyclomatic complexity 39 and cognitive complexity 92; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — crates/op-host-web/src/op_ck_bridge.js:1609
vectorizeSvg has cyclomatic complexity 38 and cognitive complexity 49; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — crates/op-html/assets/snapshot-extractor.js:586
drawImageWithOptions has cyclomatic complexity 34 and cognitive complexity 53; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — crates/op-host-web/src/op_ck_bridge.js:1353
walkRules has cyclomatic complexity 31 and cognitive complexity 71; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/op-chrome-extension/design-capture.js:363
parseInboundFromPage has cyclomatic complexity 29 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/op-vscode/src/protocol/bridge.ts:58
generateDesignMd has cyclomatic complexity 23 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/op-chrome-extension/client.js:287
jpegFitsThumbnailBounds has cyclomatic complexity 23 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — crates/op-host-web/src/op_ck_image_cache.js:22
toHex has cyclomatic complexity 19 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/op-chrome-extension/design-capture.js:104
componentSample has cyclomatic complexity 19 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/op-chrome-extension/design-capture.js:311
capturePage has cyclomatic complexity 18 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/op-chrome-extension/capture.js:233
t has cyclomatic complexity 17 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/op-chrome-extension/i18n.js:242
opCkMakeRuntimeShader has cyclomatic complexity 17 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — crates/op-host-web/src/op_ck_bridge.js:178
textFirstBaseline has cyclomatic complexity 16 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — crates/op-host-web/src/op_ck_bridge.js:1504
buildImage has cyclomatic complexity 15 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — crates/op-html/assets/snapshot-extractor.js:776
buildInlineRun has cyclomatic complexity 15 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — crates/op-html/assets/snapshot-extractor.js:1054
shapeToPathData has cyclomatic complexity 15 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — crates/op-html/assets/snapshot-extractor.js:485
onDownload has cyclomatic complexity 15 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/op-chrome-extension/popup.js:308
buildTextLines has cyclomatic complexity 15 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — crates/op-html/assets/snapshot-extractor.js:359
readBoundedDesignResponse has cyclomatic complexity 15 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/op-chrome-extension/client.js:180
parseShellExternalUrl has cyclomatic complexity 15 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/op-vscode/src/vscode/shell-messages.ts:57
skipJsoncValue has cyclomatic complexity 14 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/scripts/sync-version.mjs:179
browserTextImage has cyclomatic complexity 14 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — crates/op-host-web/src/op_ck_bridge.js:530
stripComments has cyclomatic complexity 13 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/op-chrome-extension/scripts/check-sw-imports.mjs:44
deliver has cyclomatic complexity 13 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/op-chrome-extension/background.js:218
showPendingWorkerResult has cyclomatic complexity 13 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/op-chrome-extension/popup-worker-actions.js:24
opCkRuntimeEffectLocalMatrix has cyclomatic complexity 13 and cognitive complexity 9; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — crates/op-host-web/src/op_ck_bridge.js:211
pathsFromBody has cyclomatic complexity 12 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/scripts/generate-iconify-catalog.mjs:69
sdkVersionMatches has cyclomatic complexity 12 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/scripts/sync-version.mjs:44
(anonymous) has cyclomatic complexity 12 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — crates/op-html/assets/snapshot-extractor.js:1
buildText has cyclomatic complexity 12 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — crates/op-html/assets/snapshot-extractor.js:241
fitPathToRect has cyclomatic complexity 12 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — crates/op-host-web/src/op_ck_bridge.js:997
designFallbackReason has cyclomatic complexity 12 and cognitive complexity 9; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/op-chrome-extension/design-md.js:9
parseHandshake has cyclomatic complexity 12 and cognitive complexity 9; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/op-vscode/src/daemon/daemon-client.ts:234
registeredCoverageSegments has cyclomatic complexity 11 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — crates/op-host-web/src/op_ck_bridge.js:917
opCkParseFontFamilyStack has cyclomatic complexity 11 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — crates/op-host-web/src/op_ck_bridge.js:74
onDesignMd has cyclomatic complexity 11 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/op-chrome-extension/popup.js:395
configureMcpCommand has cyclomatic complexity 11 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/op-vscode/src/vscode/configure-command.ts:47
pointsToPathData has cyclomatic complexity 11 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — crates/op-html/assets/snapshot-extractor.js:466
addText has cyclomatic complexity 11 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — crates/op-html/assets/snapshot-extractor.js:971
Do you agree with this assessment?
R3 · Large Files3.4 / 10Weak✓ Tool-verified
React / JS · Code Health — How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
crates/op-host-web/src/op_ck_bridge.js has 1873 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — crates/op-host-web/src/op_ck_bridge.js:1
crates/op-html/assets/snapshot-extractor.js has 1193 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — crates/op-html/assets/snapshot-extractor.js:1
packages/op-chrome-extension/popup.js has 697 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/op-chrome-extension/popup.js:1
packages/op-chrome-extension/design-capture.js has 628 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/op-chrome-extension/design-capture.js:1
packages/op-vscode/src/vscode/pen-editor-provider.ts has 581 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/op-vscode/src/vscode/pen-editor-provider.ts:1
packages/op-vscode/src/session/pen-session.ts has 571 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/op-vscode/src/session/pen-session.ts:1
packages/op-chrome-extension/client.js has 496 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/op-chrome-extension/client.js:1
crates/op-host-web/src/figma_temp_worker.js has 465 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — crates/op-host-web/src/figma_temp_worker.js:1
packages/op-chrome-extension/background.js has 452 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/op-chrome-extension/background.js:1
crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js has 428 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:1
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
R4 · Test Coverage5.8 / 10Adequate✓ Tool-verified
React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.
Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.
No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×24) — crates/op-host-web/src/op_ck_bridge.js:1, crates/op-html/assets/snapshot-extractor.js:1, packages/op-chrome-extension/popup.js:1, …
What to do
Add tests that import the unreached modules (directly or through their public entry).
Do you agree with this assessment?
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified
React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each REDACTED script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: REDACTED scanned for test/lint/typecheck script wiring. Deterministic presence check.
Do you agree with this assessment?
R7 · Dead Code9.2 / 10Exemplary✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
20 file(s) (~6442 LoC) were excluded from dead-code analysis. This package's entry point(s) resolved, but the walk stopped one hop in: packages/op-chrome-extension/background.js imports './wasm/op_chrome_extension_core.js', which is not in the scanned tree. That is usually a generated or build-output module, so reachability cannot see past it and no dead-code claim is made about this package. Nothing is necessarily wrong here. — packages
Unreachable from the 19 application, 15 tooling and 35 test entry point(s) detected in this repo. Gate removals on `npm run build` — an undetected custom entry would make these reachable.
no import path from any entry point (19 application, 15 tooling, 35 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×3) — crates/op-host-web/src/op_ck_image_cache.js, packaging/harmony/entry/hvigorfile.ts, packaging/harmony/hvigorfile.ts
What to do
Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.
Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.
Declared in packages/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. (×3)
What to do
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
Other · Security — Read from this repository's Rust source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS (certificate validation, protocol version) — facts about code that hold whether or not it serves anything itself. This repository commits the configuration that serves its own HTTP surface, so that configuration was read in full for the security response headers it sets. This repository serves HTTP itself (`.serve_connection(` (crates/op-collab-relay-locator-server/src/http.rs:301)), so its Rust source was also read for the server controls: TLS served or HSTS set, security response headers, cookie flags and inbound validation — each credited where its Rust spelling appears in production source, not proven on every route. A Rocket 0.5 application is credited the headers Rocket's default `Shield` sends unless it attaches its own, and its cookie jar's SameSite=Strict default; a session middleware its default cookie flags.
Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.
None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `cn-federation-nginx.conf` is committed to this repository and declares the server that serves it, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.) — deploy/collab-relay-locator-edge/cn-federation-nginx.conf:32
This repository starts an HTTP server and nothing in its Rust source or committed `Rocket.toml` secures the transport: no TLS served (actix-web `bind_rustls`/`bind_openssl`, axum-server `bind_rustls` with a `RustlsConfig`, tonic `ServerTlsConfig`, a `TlsAcceptor`, Rocket's `[default.tls]`), no `Strict-Transport-Security` header, no `X-Forwarded-Proto` read from a TLS-terminating proxy — so its traffic may cross the network in clear text. (−2.0 on this card.) The server: `.serve_connection(` (crates/op-collab-relay-locator-server/src/http.rs:301).
What to do
Set security response headers on the surface this repository serves: an `add_header` directive per header in the nginx/Caddy/Apache config, a `_headers` / `vercel.json` / `netlify.toml` entry for a static host, or `helmet()` in the HTTP server. `Content-Security-Policy` is the one that pays for itself first — it is what contains an injected script once one reaches the page — followed by `X-Content-Type-Options: nosniff` and a frame policy (`X-Frame-Options: DENY`, or CSP `frame-ancestors`). Where the app is served from a build container, the header configuration belongs in the image beside the built assets, so it ships with them rather than depending on where it lands.
Secure the server's transport: serve TLS itself (`HttpServer::bind_rustls_0_23(addr, config)` in actix-web, `axum_server::bind_rustls(addr, RustlsConfig::from_pem_file(…))`, tonic's `Server::builder().tls_config(ServerTlsConfig::new().identity(…))`, Rocket's `[default.tls]`), or run it behind a TLS-terminating proxy and check `X-Forwarded-Proto`; send `Strict-Transport-Security` once it is HTTPS-only.
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 · 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 reader10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.
Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether async functions that make a cancellable request accept or pass on an AbortSignal (adoption curve).
Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. 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 question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.
Only 5/8 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
`loadCatalog` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/op-chrome-extension/i18n.js:122
`__wbg_init` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. (×2) — crates/op-host-web/pkg-webgl/op_host_web.js:1687, crates/op-host-web/pkg-ck/op_host_web.js:1206
What to do
Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
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.
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 `RefCell` it is walking alone — safe Rust rejects a body that changes the collection its loop borrows at compile time, except through interior mutability: a `RefCell` borrowed in the loop's header stays borrowed until the loop ends, so a `borrow_mut()` of it inside the body panics with `already borrowed: BorrowMutError` and the remaining elements are never seen. Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen. Whether a `for (x in c)` or `c.forEach { … }` leaves the collection it is walking alone — a `mutableListOf`/`ArrayList`, `mutableMapOf`/`HashMap` or `mutableSetOf`/`HashSet` is a `java.util` collection on the JVM and is walked by its own fail-fast iterator, so a body that adds to or removes from the very collection the loop is walking makes the next step throw `ConcurrentModificationException` and the remaining elements 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.
Do you agree with this assessment?
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
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 `REDACTED` 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.
Other · Code Health — Whether Kotlin's null safety is not undermined by not-null assertions — `String` cannot hold null and `String?` must be checked before use in every Kotlin module, and each `!!` is a run-time `NullPointerException` the author has told the compiler cannot happen.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
Do you agree with this assessment?
WCAG coverage — what static analysis assessed
Statically assessed 13 of 55 WCAG 2.2 Level A/AA success criteria (24%; ≈26% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 42 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).
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 — 4 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.
P12 CI test-gate honesty — 1 observation(s) recorded · Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X9 Subsumed condition operand — 19 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not included — 56 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.
AC4 Keyboard semantics — No interactive element found in the parsed markup — AC4 not applicable here.
AX1 Captive dependencies — Not applicable: this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Kotlin imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; Rust with no dependency-injection crate has no container to hand one lifetime's instance to another — every value is owned by the code that builds it, and the borrow checker rejects a longer-lived value keeping a borrow of a shorter-lived one; this repository's Swift imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's TypeScript 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 class in this Kotlin code is a Spring, JSR-330 or CDI singleton bean. 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. No Swift request handler (a Vapor, Hummingbird, Kitura, Swifter or Perfect route handler, as a method or a registered closure) is declared, so no state is shared between request threads. Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
AX4 Dependency direction — not applicable to a transaction-script/CRUD architecture (the inward-dependency rule is for layered/clean styles)
AX6 Interface segregation — AX6 reached only 2% of this repository's production lines — rust (767,588 lines), python (28,621 lines), swift (7,866 lines), kotlin (6,614 lines), c (466 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — no test/production split to check
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — the Android app did not build — `./gradlew :app:assembleDebug` exited 1: uld not get resource 'https://artifact.bytedance.com/repository/AwemeOpenSDK/com/bytedance/ies/ugc/aweme/opensdk-common/0.2.0.10/opensdk-common-0.2.0.10.pom'.
> Could not GET 'https://arti…; runtime evidence skipped (launch chosen because packaging/android/app/build.gradle.kts applies the Android application plugin and packaging/android/gradlew builds it) This is a statement about this run, not a statement about your application: nothing here says the app is inaccessible, only that it was never run.
C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no data at rest for these controls to protect.
C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data whose lifetime a retention limit would bound.
C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data for a data subject to erase, export or consent over.
D11 Test Reliability — Test reliability not measured — JavaScript/TypeScript suite did not run
D12 Dependency Hygiene — Not scored — a Gradle build resolved 152 artifact(s) across its subprojects (66 behind a shipped release, reported), but the currency signal was not established over the whole graph, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
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 — API consistency is measured on C# only; the exposed Rust surface was not measured.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Aggregate roots were found in only one source directory (op-orchestrator), which is a layered codebase, not two contexts. 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"]`.
D25 ADR Conformance — no ADRs to check
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D32 Data Compliance (PII/GDPR) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage not measured — JavaScript/TypeScript suite
DM3 Integration-event coupling — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
DM6 Domain ↔ infrastructure boundary — this Rust crate maps no type to a persistence framework (diesel/sea-orm/sqlx), so DM6's domain↔infrastructure fusion read has no population to be taken over
DM7 Repository granularity — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
ED5 Idempotency — Not assessed, and this one is on us: 2 command handler(s) or message consumer(s) were found here, but this check does not yet recognise persistence writes in this repository's language. Idempotency was neither confirmed nor ruled out — this is a limit of the analyzer, not a finding about your code.
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
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `#[bench]`, criterion's `bench_function`/`bench_with_input`, `#[divan::bench]` or `#[library_benchmark]` in any `.rs` file, or criterion, divan, iai or a `[[bench]]` target in a Cargo.toml, 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 scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
R5 Dependency Freshness — uses a bun lockfile — dependency freshness not measured here; JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
X12 Unreachable branch — X12 reached only 6% of this repository's production lines — rust (767,588 lines), swift (7,866 lines), c (466 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X13 Undrained process stream — X13 reached only 6% of this repository's production lines — rust (767,588 lines), swift (7,866 lines), c (466 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X16 Unfloored truncation loop — X16 reached only 3% of this repository's production lines — rust (767,588 lines), python (28,621 lines), swift (7,866 lines), c (466 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X17 Uncapped recursion over a caller-supplied document — X17 reached only 6% of this repository's production lines — rust (767,588 lines), swift (7,866 lines), c (466 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X18 Disposal-pattern correctness — X18 reached only 3% of this repository's production lines — rust (767,588 lines), python (28,621 lines), swift (7,866 lines), c (466 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X20 Mistyped argument guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X24 Document value interpolated into markup unescaped — X24 reached only 5% of this repository's production lines — rust (767,588 lines), swift (7,866 lines), kotlin (6,614 lines), c (466 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X26 Unsynchronised callback handoff — X26 reached only 5% of this repository's production lines — rust (767,588 lines), javascript (10,651 lines), typescript (3,585 lines), c (466 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X3 Exception handling — X3 reached only 7% of this repository's production lines — rust (767,588 lines), c (466 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
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.
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
Boundary-crossing change coupling: hi_collab.rs ↔ export-i18n-catalogs.py crates/op-i18n/src/i18n/hi_collab.rs:1— `crates/op-i18n/src/i18n/hi_collab.rs` (context crates) and `tools/export-i18n-catalogs.py` (context tools) sit in DIFFERENT parts of the tree yet change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `4a6bdf2a` fix(editor): make normal reader details and overlapping pages accessible; `09720f5f` feat(editor): let a generator run wait on a remote runtime; `a4b8f7cd` feat(i18n): add the Studio Home brand-kit strings — run `git show` on any of them.
Boundary-crossing change coupling: vi_collab.rs ↔ export-i18n-catalogs.py crates/op-i18n/src/i18n/vi_collab.rs:1— `crates/op-i18n/src/i18n/vi_collab.rs` (context crates) and `tools/export-i18n-catalogs.py` (context tools) sit in DIFFERENT parts of the tree yet change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `4a6bdf2a` fix(editor): make normal reader details and overlapping pages accessible; `09720f5f` feat(editor): let a generator run wait on a remote runtime; `a4b8f7cd` feat(i18n): add the Studio Home brand-kit strings — run `git show` on any of them.
Boundary-crossing change coupling: tr_collab.rs ↔ export-i18n-catalogs.py crates/op-i18n/src/i18n/tr_collab.rs:1— `crates/op-i18n/src/i18n/tr_collab.rs` (context crates) and `tools/export-i18n-catalogs.py` (context tools) sit in DIFFERENT parts of the tree yet change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `4a6bdf2a` fix(editor): make normal reader details and overlapping pages accessible; `09720f5f` feat(editor): let a generator run wait on a remote runtime; `a4b8f7cd` feat(i18n): add the Studio Home brand-kit strings — run `git show` on any of them.
Boundary-crossing change coupling: th_collab.rs ↔ export-i18n-catalogs.py crates/op-i18n/src/i18n/th_collab.rs:1— `crates/op-i18n/src/i18n/th_collab.rs` (context crates) and `tools/export-i18n-catalogs.py` (context tools) sit in DIFFERENT parts of the tree yet change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `4a6bdf2a` fix(editor): make normal reader details and overlapping pages accessible; `09720f5f` feat(editor): let a generator run wait on a remote runtime; `a4b8f7cd` feat(i18n): add the Studio Home brand-kit strings — run `git show` on any of them.
Boundary-crossing change coupling: ru_collab.rs ↔ export-i18n-catalogs.py crates/op-i18n/src/i18n/ru_collab.rs:1— `crates/op-i18n/src/i18n/ru_collab.rs` (context crates) and `tools/export-i18n-catalogs.py` (context tools) sit in DIFFERENT parts of the tree yet change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `4a6bdf2a` fix(editor): make normal reader details and overlapping pages accessible; `09720f5f` feat(editor): let a generator run wait on a remote runtime; `a4b8f7cd` feat(i18n): add the Studio Home brand-kit strings — run `git show` on any of them.
Boundary-crossing change coupling: pt_collab.rs ↔ export-i18n-catalogs.py crates/op-i18n/src/i18n/pt_collab.rs:1— `crates/op-i18n/src/i18n/pt_collab.rs` (context crates) and `tools/export-i18n-catalogs.py` (context tools) sit in DIFFERENT parts of the tree yet change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `4a6bdf2a` fix(editor): make normal reader details and overlapping pages accessible; `09720f5f` feat(editor): let a generator run wait on a remote runtime; `a4b8f7cd` feat(i18n): add the Studio Home brand-kit strings — run `git show` on any of them.
Boundary-crossing change coupling: ko_collab.rs ↔ export-i18n-catalogs.py crates/op-i18n/src/i18n/ko_collab.rs:1— `crates/op-i18n/src/i18n/ko_collab.rs` (context crates) and `tools/export-i18n-catalogs.py` (context tools) sit in DIFFERENT parts of the tree yet change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `4a6bdf2a` fix(editor): make normal reader details and overlapping pages accessible; `09720f5f` feat(editor): let a generator run wait on a remote runtime; `a4b8f7cd` feat(i18n): add the Studio Home brand-kit strings — run `git show` on any of them.
Boundary-crossing change coupling: ja_collab.rs ↔ export-i18n-catalogs.py crates/op-i18n/src/i18n/ja_collab.rs:1— `crates/op-i18n/src/i18n/ja_collab.rs` (context crates) and `tools/export-i18n-catalogs.py` (context tools) sit in DIFFERENT parts of the tree yet change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `4a6bdf2a` fix(editor): make normal reader details and overlapping pages accessible; `09720f5f` feat(editor): let a generator run wait on a remote runtime; `a4b8f7cd` feat(i18n): add the Studio Home brand-kit strings — run `git show` on any of them.
Boundary-crossing change coupling: id_collab.rs ↔ export-i18n-catalogs.py crates/op-i18n/src/i18n/id_collab.rs:1— `crates/op-i18n/src/i18n/id_collab.rs` (context crates) and `tools/export-i18n-catalogs.py` (context tools) sit in DIFFERENT parts of the tree yet change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `4a6bdf2a` fix(editor): make normal reader details and overlapping pages accessible; `09720f5f` feat(editor): let a generator run wait on a remote runtime; `a4b8f7cd` feat(i18n): add the Studio Home brand-kit strings — run `git show` on any of them.
Boundary-crossing change coupling: zh_cn_collab.rs ↔ export-i18n-catalogs.py crates/op-i18n/src/i18n/zh_cn_collab.rs:1— `crates/op-i18n/src/i18n/zh_cn_collab.rs` (context crates) and `tools/export-i18n-catalogs.py` (context tools) sit in DIFFERENT parts of the tree yet change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `4a6bdf2a` fix(editor): make normal reader details and overlapping pages accessible; `09720f5f` feat(editor): let a generator run wait on a remote runtime; `a4b8f7cd` feat(i18n): add the Studio Home brand-kit strings — run `git show` on any of them.
Boundary-crossing change coupling: fr_collab.rs ↔ export-i18n-catalogs.py crates/op-i18n/src/i18n/fr_collab.rs:1— `crates/op-i18n/src/i18n/fr_collab.rs` (context crates) and `tools/export-i18n-catalogs.py` (context tools) sit in DIFFERENT parts of the tree yet change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `4a6bdf2a` fix(editor): make normal reader details and overlapping pages accessible; `09720f5f` feat(editor): let a generator run wait on a remote runtime; `a4b8f7cd` feat(i18n): add the Studio Home brand-kit strings — run `git show` on any of them.
Boundary-crossing change coupling: es_collab.rs ↔ export-i18n-catalogs.py crates/op-i18n/src/i18n/es_collab.rs:1— `crates/op-i18n/src/i18n/es_collab.rs` (context crates) and `tools/export-i18n-catalogs.py` (context tools) sit in DIFFERENT parts of the tree yet change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `4a6bdf2a` fix(editor): make normal reader details and overlapping pages accessible; `09720f5f` feat(editor): let a generator run wait on a remote runtime; `a4b8f7cd` feat(i18n): add the Studio Home brand-kit strings — run `git show` on any of them.
Boundary-crossing change coupling: en_collab.rs ↔ export-i18n-catalogs.py crates/op-i18n/src/i18n/en_collab.rs:1— `crates/op-i18n/src/i18n/en_collab.rs` (context crates) and `tools/export-i18n-catalogs.py` (context tools) sit in DIFFERENT parts of the tree yet change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `4a6bdf2a` fix(editor): make normal reader details and overlapping pages accessible; `09720f5f` feat(editor): let a generator run wait on a remote runtime; `a4b8f7cd` feat(i18n): add the Studio Home brand-kit strings — run `git show` on any of them.
Boundary-crossing change coupling: de_collab.rs ↔ export-i18n-catalogs.py crates/op-i18n/src/i18n/de_collab.rs:1— `crates/op-i18n/src/i18n/de_collab.rs` (context crates) and `tools/export-i18n-catalogs.py` (context tools) sit in DIFFERENT parts of the tree yet change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `4a6bdf2a` fix(editor): make normal reader details and overlapping pages accessible; `09720f5f` feat(editor): let a generator run wait on a remote runtime; `a4b8f7cd` feat(i18n): add the Studio Home brand-kit strings — run `git show` on any of them.
Boundary-crossing change coupling: zh_tw_collab.rs ↔ export-i18n-catalogs.py crates/op-i18n/src/i18n/zh_tw_collab.rs:1— `crates/op-i18n/src/i18n/zh_tw_collab.rs` (context crates) and `tools/export-i18n-catalogs.py` (context tools) sit in DIFFERENT parts of the tree yet change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `4a6bdf2a` fix(editor): make normal reader details and overlapping pages accessible; `09720f5f` feat(editor): let a generator run wait on a remote runtime; `a4b8f7cd` feat(i18n): add the Studio Home brand-kit strings — run `git show` on any of them.
AC2 · Forms & labels· <input> without a programmatic label · ×1
<input> without a programmatic label packages/op-chrome-extension/popup.html:86— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
<html> without a lang packages/op-chrome-extension/popup.html:2— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
AC3 · Page structure· Document without a <title> · ×1
Document without a <title> packages/op-chrome-extension/popup.html:2— A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>.
D30 · Dependency Vulnerabilities· High vulnerability · ×1
op_orchestrator::validation_fixes_apply::apply_validation_fixes (cognitive 124) crates/op-orchestrator/src/validation_fixes_apply.rs:66— op_orchestrator::validation_fixes_apply::apply_validation_fixes has cognitive complexity 124 (threshold 15). Drivers by points: if/else 47 (116 pts), boolean chains 4, loops 2, match/switch 1 (2 pts) (nesting depth added 70). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_orchestrator::text_contrast_photo::visit (cognitive 110) crates/op-orchestrator/src/text_contrast_photo.rs:192— op_orchestrator::text_contrast_photo::visit has cognitive complexity 110 (threshold 15). Drivers by points: if/else 16 (82 pts), match/switch 3 (12 pts), loops 3 (11 pts), boolean chains 5 (nesting depth added 83). 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.
op_orchestrator::cleanup_equalize_siblings::plan_family_repairs (cognitive 97) crates/op-orchestrator/src/cleanup_equalize_siblings.rs:236— op_orchestrator::cleanup_equalize_siblings::plan_family_repairs has cognitive complexity 97 (threshold 15). Drivers by points: if/else 24 (57 pts), loops 16 (31 pts), match/switch 5 (8 pts), boolean chains 1 (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_orchestrator::plan_shared_context_diagnostics::collect_shapes (cognitive 67) crates/op-orchestrator/src/plan_shared_context_diagnostics.rs:129— op_orchestrator::plan_shared_context_diagnostics::collect_shapes has cognitive complexity 67 (threshold 15). Drivers by points: if/else 22 (60 pts), loops 3 (7 pts) (nesting depth added 42). 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.
op_orchestrator::geometry_row_fixes::collect_row_overfull_fixes_with_context (cognitive 65) crates/op-orchestrator/src/geometry_row_fixes.rs:412— op_orchestrator::geometry_row_fixes::collect_row_overfull_fixes_with_context has cognitive complexity 65 (threshold 15). Drivers by points: if/else 15 (55 pts), boolean chains 9, loops 1 (nesting depth added 40). 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.
op_orchestrator::editorial_column_gutters::collect (cognitive 60) crates/op-orchestrator/src/editorial_column_gutters.rs:84— op_orchestrator::editorial_column_gutters::collect has cognitive complexity 60 (threshold 15). Drivers by points: if/else 14 (44 pts), loops 4 (10 pts), boolean chains 6 (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.
op_orchestrator::geometry_diagnostics_collect::collect_diagnostics_with_context (cognitive 60) crates/op-orchestrator/src/geometry_diagnostics_collect.rs:172— op_orchestrator::geometry_diagnostics_collect::collect_diagnostics_with_context has cognitive complexity 60 (threshold 15). Drivers by points: if/else 19 (42 pts), boolean chains 7, loops 3 (6 pts), match/switch 1 (5 pts) (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
op_orchestrator::prompt_subagent::build_subagent_prompt_core_with_outcomes (cognitive 53) crates/op-orchestrator/src/prompt_subagent.rs:148— op_orchestrator::prompt_subagent::build_subagent_prompt_core_with_outcomes has cognitive complexity 53 (threshold 15). Drivers by points: if/else 39 (44 pts), boolean chains 6, match/switch 2 (3 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
op_orchestrator::role_post_pass::contrast::fix_button_foreground_contrast (cognitive 53) crates/op-orchestrator/src/role_post_pass/contrast.rs:6— op_orchestrator::role_post_pass::contrast::fix_button_foreground_contrast has cognitive complexity 53 (threshold 15). Drivers by points: if/else 20 (47 pts), match/switch 2 (3 pts), loops 2, boolean chains 1 (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.
op_orchestrator::geometry_overflow_fixes::collect_text_overflow_fixes_with_context (cognitive 52) crates/op-orchestrator/src/geometry_overflow_fixes.rs:124— op_orchestrator::geometry_overflow_fixes::collect_text_overflow_fixes_with_context has cognitive complexity 52 (threshold 15). Drivers by points: if/else 12 (41 pts), boolean chains 8, loops 2 (3 pts) (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
op_orchestrator::loop_finalize_record::record_same_id_shallow_patches (cognitive 49) crates/op-orchestrator/src/loop_finalize_record.rs:225— op_orchestrator::loop_finalize_record::record_same_id_shallow_patches has cognitive complexity 49 (threshold 15). Drivers by points: if/else 15 (34 pts), loops 7 (9 pts), boolean chains 6 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_orchestrator::spacing_repair::strip_in_value (cognitive 49) crates/op-orchestrator/src/spacing_repair.rs:94— op_orchestrator::spacing_repair::strip_in_value has cognitive complexity 49 (threshold 15). Drivers by points: if/else 10 (32 pts), boolean chains 12, loops 2 (5 pts) (nesting depth added 25). 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.
op_orchestrator::table_filter_contract::wire (cognitive 47) crates/op-orchestrator/src/table_filter_contract.rs:226— op_orchestrator::table_filter_contract::wire has cognitive complexity 47 (threshold 15). Drivers by points: if/else 15 (38 pts), loops 4 (7 pts), boolean chains 2 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_orchestrator::cleanup_slide_padding::enforce_slide_padding_floor (cognitive 45) crates/op-orchestrator/src/cleanup_slide_padding.rs:106— op_orchestrator::cleanup_slide_padding::enforce_slide_padding_floor has cognitive complexity 45 (threshold 15). Drivers by points: if/else 21 (31 pts), boolean chains 7, match/switch 2 (5 pts), loops 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.
op_orchestrator::hero_bleed::enforce (cognitive 45) crates/op-orchestrator/src/hero_bleed.rs:16— op_orchestrator::hero_bleed::enforce has cognitive complexity 45 (threshold 15). Drivers by points: if/else 23 (33 pts), boolean chains 6, loops 2 (6 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.
op_orchestrator::subtask_completeness::expected_count_with_map_markers (cognitive 44) crates/op-orchestrator/src/subtask_completeness.rs:31— op_orchestrator::subtask_completeness::expected_count_with_map_markers has cognitive complexity 44 (threshold 15). Drivers by points: if/else 16 (35 pts), boolean chains 5, loops 4 (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.
op_orchestrator::table_time_filter::wire (cognitive 44) crates/op-orchestrator/src/table_time_filter.rs:64— op_orchestrator::table_time_filter::wire has cognitive complexity 44 (threshold 15). Drivers by points: if/else 25 (34 pts), loops 4 (6 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.
op_orchestrator::plan_normalize::normalize (cognitive 43) crates/op-orchestrator/src/plan_normalize.rs:123— op_orchestrator::plan_normalize::normalize has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (27 pts), loops 5 (10 pts), boolean chains 6 (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.
op_orchestrator::run_initial_binding_feedback::repair_initial_bindings (cognitive 43) crates/op-orchestrator/src/run_initial_binding_feedback.rs:22— op_orchestrator::run_initial_binding_feedback::repair_initial_bindings has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (22 pts), match/switch 5 (16 pts), boolean chains 3, loops 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_orchestrator::subagent::run_subtask_with_reveal_at_and_outcomes (cognitive 43) crates/op-orchestrator/src/subagent.rs:133— op_orchestrator::subagent::run_subtask_with_reveal_at_and_outcomes has cognitive complexity 43 (threshold 15). Drivers by points: if/else 24 (29 pts), match/switch 5 (9 pts), loops 3 (4 pts), boolean chains 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.
op_orchestrator::geometry_buried_overlay::collect_with_context (cognitive 42) crates/op-orchestrator/src/geometry_buried_overlay.rs:633— op_orchestrator::geometry_buried_overlay::collect_with_context has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (27 pts), loops 4 (11 pts), boolean chains 4 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_orchestrator::mobile_content_rail::collect_repairs (cognitive 42) crates/op-orchestrator/src/mobile_content_rail.rs:298— op_orchestrator::mobile_content_rail::collect_repairs has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (31 pts), boolean chains 7, loops 2 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_orchestrator::subtask_completeness_named_options::inspect_siblings (cognitive 42) crates/op-orchestrator/src/subtask_completeness_named_options.rs:272— op_orchestrator::subtask_completeness_named_options::inspect_siblings has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (30 pts), boolean chains 8, loops 2 (4 pts) (nesting depth added 19). 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.
op_orchestrator::map_templates::children (cognitive 41) crates/op-orchestrator/src/map_templates.rs:78— op_orchestrator::map_templates::children has cognitive complexity 41 (threshold 15). Drivers by points: if/else 28 (37 pts), match/switch 2, boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
op_orchestrator::plan_coverage_extract::required_items (cognitive 40) crates/op-orchestrator/src/plan_coverage_extract.rs:90— op_orchestrator::plan_coverage_extract::required_items has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (35 pts), loops 5 (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.
Hotspot: crates/op-orchestrator/src/prompt_subagent.rs crates/op-orchestrator/src/prompt_subagent.rs:148— crates/op-orchestrator/src/prompt_subagent.rs changed 38 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in op_orchestrator::prompt_subagent::build_subagent_prompt_core_with_outcomes at line 148. 27 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-orchestrator/src/prompt_subagent.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/op-host-native/src/widget_host/paint.rs crates/op-host-native/src/widget_host/paint.rs:19— crates/op-host-native/src/widget_host/paint.rs changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 86 in WidgetHostNative::paint at line 19. 2 of those changes were fix/bug commits, and the other 18 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-host-native/src/widget_host/paint.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/op-editor-ui/src/widgets/home_surface.rs crates/op-editor-ui/src/widgets/home_surface.rs:405— crates/op-editor-ui/src/widgets/home_surface.rs changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 54 in HomeSurface::hit_test_layout at line 405. 9 of those changes were fix/bug commits, and the other 17 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-editor-ui/src/widgets/home_surface.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/op-host-services/src/mcp_serve/registry.rs crates/op-host-services/src/mcp_serve/registry.rs:9— crates/op-host-services/src/mcp_serve/registry.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 151 in op_host_services::mcp_serve::registry::rebuild_registry at line 9. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-host-services/src/mcp_serve/registry.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/op-host-desktop/src/keyboard_input.rs crates/op-host-desktop/src/keyboard_input.rs:15— crates/op-host-desktop/src/keyboard_input.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 143 in DesktopApp::handle_key_pressed at line 15. 4 of those changes were fix/bug commits, and the other 4 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-host-desktop/src/keyboard_input.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/op-host-native/src/widget_host/home.rs crates/op-host-native/src/widget_host/home.rs:79— crates/op-host-native/src/widget_host/home.rs changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in WidgetHostNative::press_home at line 79. 4 of those changes were fix/bug commits, and the other 16 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-host-native/src/widget_host/home.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/op-host-services/src/web_canvas_server/connection.rs crates/op-host-services/src/web_canvas_server/connection.rs:101— crates/op-host-services/src/web_canvas_server/connection.rs changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 59 in op_host_services::web_canvas_server::connection::dispatch at line 101. 9 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-host-services/src/web_canvas_server/connection.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/op-host-web/src/canvaskit/mount.rs crates/op-host-web/src/canvaskit/mount.rs:14— crates/op-host-web/src/canvaskit/mount.rs changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in op_host_web::canvaskit::mount::mount_ck at line 14. 3 of those changes were fix/bug commits, and the other 17 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-host-web/src/canvaskit/mount.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/op-smoke/src/main.rs crates/op-smoke/src/main.rs:202— crates/op-smoke/src/main.rs changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in op_smoke::main at line 202. 7 of those changes were fix/bug commits, and the other 11 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-smoke/src/main.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/op-host-services/src/chat_subprocess.rs crates/op-host-services/src/chat_subprocess.rs:294— crates/op-host-services/src/chat_subprocess.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 61 in SubprocessProvider::send_inner at line 294. 11 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-host-services/src/chat_subprocess.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/op-orchestrator/src/subagent.rs crates/op-orchestrator/src/subagent.rs:133— crates/op-orchestrator/src/subagent.rs changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in op_orchestrator::subagent::run_subtask_with_reveal_at_and_outcomes at line 133. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-orchestrator/src/subagent.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/op-host-native/src/widget_host/keyboard_escape.rs crates/op-host-native/src/widget_host/keyboard_escape.rs:13— crates/op-host-native/src/widget_host/keyboard_escape.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 71 in WidgetHostNative::apply_escape at line 13. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-host-native/src/widget_host/keyboard_escape.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/op-host-native/src/widget_host/press.rs crates/op-host-native/src/widget_host/press.rs:201— crates/op-host-native/src/widget_host/press.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 60 in WidgetHostNative::apply_press_inner at line 201. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-host-native/src/widget_host/press.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/op-host-desktop/src/app_handler/redraw.rs crates/op-host-desktop/src/app_handler/redraw.rs:35— crates/op-host-desktop/src/app_handler/redraw.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 85 in DesktopApp::on_redraw_requested at line 35. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-host-desktop/src/app_handler/redraw.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/op-host-services/src/mcp_serve.rs crates/op-host-services/src/mcp_serve.rs:440— crates/op-host-services/src/mcp_serve.rs changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in op_host_services::mcp_serve::read_http_request at line 440. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-host-services/src/mcp_serve.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/op-host-services/src/web_canvas_server.rs crates/op-host-services/src/web_canvas_server.rs:460— crates/op-host-services/src/web_canvas_server.rs changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in op_host_services::web_canvas_server::handle_web_canvas_request at line 460. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-host-services/src/web_canvas_server.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/op-orchestrator/src/run_orchestrator.rs crates/op-orchestrator/src/run_orchestrator.rs:23— crates/op-orchestrator/src/run_orchestrator.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in Orchestrator::run at line 23. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-orchestrator/src/run_orchestrator.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/op-host-web/src/widget_host/paint.rs crates/op-host-web/src/widget_host/paint.rs:49— crates/op-host-web/src/widget_host/paint.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 60 in WidgetHost::paint_editor at line 49. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-host-web/src/widget_host/paint.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/op-editor-ui/src/widgets/workspace_surface.rs crates/op-editor-ui/src/widgets/workspace_surface.rs:581— crates/op-editor-ui/src/widgets/workspace_surface.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in WorkspaceSurface::hit_test_layout at line 581. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-editor-ui/src/widgets/workspace_surface.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/op-editor-ui/src/widgets/ai_chat_panel_hit.rs crates/op-editor-ui/src/widgets/ai_chat_panel_hit.rs:63— crates/op-editor-ui/src/widgets/ai_chat_panel_hit.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 67 in AIChatPlaceholder::hit_test_with_canonical at line 63. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-editor-ui/src/widgets/ai_chat_panel_hit.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/op-engine-ffi/src/lib.rs crates/op-engine-ffi/src/lib.rs:451— crates/op-engine-ffi/src/lib.rs changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in op_engine_ffi::op_pointer at line 451. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-engine-ffi/src/lib.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/op-orchestrator/src/subtask_completeness.rs crates/op-orchestrator/src/subtask_completeness.rs:31— crates/op-orchestrator/src/subtask_completeness.rs changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in op_orchestrator::subtask_completeness::expected_count_with_map_markers at line 31. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-orchestrator/src/subtask_completeness.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/op-orchestrator/src/cleanup.rs crates/op-orchestrator/src/cleanup.rs:392— crates/op-orchestrator/src/cleanup.rs changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in op_orchestrator::cleanup::run_cleanup_passes_with_summary_and_policy at line 392. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-orchestrator/src/cleanup.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/op-editor-core/src/command_apply.rs crates/op-editor-core/src/command_apply.rs:55— crates/op-editor-core/src/command_apply.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 177 in EditorState::apply_with_allocator at line 55. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-editor-core/src/command_apply.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/op-host-native/src/widget_host/workspace.rs crates/op-host-native/src/widget_host/workspace.rs:124— crates/op-host-native/src/widget_host/workspace.rs changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in WidgetHostNative::run_workspace_action at line 124. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-host-native/src/widget_host/workspace.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
FunctionTooLong: op_ck_bridge.opCkInit crates/op-host-web/src/op_ck_bridge.js:308— FunctionTooLong — opCkInit runs 1167 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1067 over it, 11.67× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_host_web.__wbg_get_imports crates/op-host-web/pkg-webgl/op_host_web.js:66— FunctionTooLong — __wbg_get_imports runs 982 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 882 over it, 9.82× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_host_web.__wbg_get_imports crates/op-host-web/pkg-ck/op_host_web.js:31— FunctionTooLong — __wbg_get_imports runs 684 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 584 over it, 6.84× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_editor_ui::widgets::property_panel_dispatch::apply_property_action crates/op-editor-ui/src/widgets/property_panel_dispatch.rs:186— FunctionTooLong — op_editor_ui::widgets::property_panel_dispatch::apply_property_action runs 478 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 378 over it, 4.78× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_figma::instance::apply_instance_overrides_cached crates/op-figma/src/instance.rs:102— FunctionTooLong — op_figma::instance::apply_instance_overrides_cached runs 435 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 335 over it, 4.35× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_editor_ui::widgets::agent_settings_press_entries::apply_entry_hit crates/op-editor-ui/src/widgets/agent_settings_press_entries.rs:21— FunctionTooLong — op_editor_ui::widgets::agent_settings_press_entries::apply_entry_hit runs 385 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 285 over it, 3.85× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_editor_ui::widgets::canvas_viewport_paint::paint_node_inner crates/op-editor-ui/src/widgets/canvas_viewport_paint.rs:118— FunctionTooLong — op_editor_ui::widgets::canvas_viewport_paint::paint_node_inner runs 375 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 275 over it, 3.75× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_host_web::canvaskit::mount::mount_ck crates/op-host-web/src/canvaskit/mount.rs:14— FunctionTooLong — op_host_web::canvaskit::mount::mount_ck runs 366 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 266 over it, 3.66× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_orchestrator::prompt_subagent::build_subagent_prompt_core_with_outcomes crates/op-orchestrator/src/prompt_subagent.rs:148— FunctionTooLong — op_orchestrator::prompt_subagent::build_subagent_prompt_core_with_outcomes runs 349 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 249 over it, 3.49× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_editor_ui::widgets::home_surface_layout::wide_layout_for_scrolled crates/op-editor-ui/src/widgets/home_surface_layout.rs:263— FunctionTooLong — op_editor_ui::widgets::home_surface_layout::wide_layout_for_scrolled runs 347 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 247 over it, 3.47× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_ck_bridge.opCkInit crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:28— FunctionTooLong — opCkInit runs 344 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 244 over it, 3.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_smoke::main crates/op-smoke/src/main.rs:202— FunctionTooLong — op_smoke::main runs 330 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 230 over it, 3.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_host_services::web_canvas_server::connection::dispatch crates/op-host-services/src/web_canvas_server/connection.rs:101— FunctionTooLong — op_host_services::web_canvas_server::connection::dispatch runs 305 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 205 over it, 3.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_editor_ui::widgets::property_panel_layout::action_button_rects_with_fill_picker crates/op-editor-ui/src/widgets/property_panel_layout.rs:213— FunctionTooLong — op_editor_ui::widgets::property_panel_layout::action_button_rects_with_fill_picker runs 277 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 177 over it, 2.77× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_editor_ui::widgets::ai_chat_transcript::build_item crates/op-editor-ui/src/widgets/ai_chat_transcript.rs:179— FunctionTooLong — op_editor_ui::widgets::ai_chat_transcript::build_item runs 267 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 167 over it, 2.67× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_orchestrator::subagent::run_subtask_with_reveal_at_and_outcomes crates/op-orchestrator/src/subagent.rs:133— FunctionTooLong — op_orchestrator::subagent::run_subtask_with_reveal_at_and_outcomes runs 259 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 159 over it, 2.59× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_editor_ui::widgets::property_panel_fill_body::paint_fill_gradient_body crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:140— FunctionTooLong — op_editor_ui::widgets::property_panel_fill_body::paint_fill_gradient_body runs 248 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 148 over it, 2.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_editor_ui::widgets::ai_chat_panel_footer::paint_bottom_toolbar crates/op-editor-ui/src/widgets/ai_chat_panel_footer.rs:355— FunctionTooLong — op_editor_ui::widgets::ai_chat_panel_footer::paint_bottom_toolbar runs 240 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 140 over it, 2.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_host_services::chat_http_server::run_opencode_turn crates/op-host-services/src/chat_http_server.rs:246— FunctionTooLong — op_host_services::chat_http_server::run_opencode_turn runs 240 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 140 over it, 2.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_editor_ui::widgets::property_panel_input_layout::editable_input_rects crates/op-editor-ui/src/widgets/property_panel_input_layout.rs:53— FunctionTooLong — op_editor_ui::widgets::property_panel_input_layout::editable_input_rects runs 237 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 137 over it, 2.37× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_editor_ui::widgets::home_surface_layout_compact::compact_layout_for_scrolled crates/op-editor-ui/src/widgets/home_surface_layout_compact.rs:84— FunctionTooLong — op_editor_ui::widgets::home_surface_layout_compact::compact_layout_for_scrolled runs 236 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 136 over it, 2.36× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_editor_ui::widgets::home_surface_paint_panels::paint_composer crates/op-editor-ui/src/widgets/home_surface_paint_panels.rs:25— FunctionTooLong — op_editor_ui::widgets::home_surface_paint_panels::paint_composer runs 236 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 136 over it, 2.36× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_orchestrator::validation_fixes_apply::apply_validation_fixes crates/op-orchestrator/src/validation_fixes_apply.rs:66— FunctionTooLong — op_orchestrator::validation_fixes_apply::apply_validation_fixes runs 236 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 136 over it, 2.36× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_editor_ui::widgets::property_panel_fill::paint_one_fill crates/op-editor-ui/src/widgets/property_panel_fill.rs:358— FunctionTooLong — op_editor_ui::widgets::property_panel_fill::paint_one_fill runs 231 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 131 over it, 2.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: op_mcp::batch_layered_guidelines::generate_section_guidelines crates/op-mcp/src/batch_layered_guidelines.rs:7— FunctionTooLong — op_mcp::batch_layered_guidelines::generate_section_guidelines runs 229 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 129 over it, 2.29× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Repeated repair: crates/op-orchestrator/src/lib.rs crates/op-orchestrator/src/lib.rs:106— crates/op-orchestrator/src/lib.rs changed 52 times in last 90 days and 35 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2 (its worst body is op_orchestrator::cleanup_image_slots::materialize_empty_image_fill_slots at line 106), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ai): count a brief's quoted section titles as covered”; “fix(ai): keep declared screens apart when planning falls back”; “fix(ai): reject inert steppers and avoid invented card navigation”; “fix(ai): preserve interaction state across generated sections”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-orchestrator/src/lib.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-orchestrator/src/geometry_validation.rs crates/op-orchestrator/src/geometry_validation.rs:340— crates/op-orchestrator/src/geometry_validation.rs changed 25 times in last 90 days and 23 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is op_orchestrator::geometry_validation::geometry_validate_and_fix_for_form at line 340), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ai): narrow scaffold sidebars to the rail drawn inside them”; “fix(ai): fit calendar weeks whose identical day cells overrun the row”; “fix(ai): keep carousel controls above media backdrops”; “fix(ai): preserve full-width carousel media through cleanup”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-orchestrator/src/geometry_validation.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-orchestrator/src/run.rs crates/op-orchestrator/src/run.rs:171— crates/op-orchestrator/src/run.rs changed 19 times in last 90 days and 18 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 op_orchestrator::run::planning_loop at line 171), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ai): keep the modelled plan when only sharedContext is rejected”; “fix(ai): repair rejected plans without losing shared decisions”; “fix(ai): validate and repair missing initial binding state”; “fix(ai): validate a single shared planning contract before generation”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-orchestrator/src/run.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-orchestrator/src/prompt.rs crates/op-orchestrator/src/prompt.rs:173— crates/op-orchestrator/src/prompt.rs changed 14 times in last 90 days and 11 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is op_orchestrator::prompt::planning_suffix at line 173), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ai): fill requested concept fields with demo values instead of placeholders”; “fix(ai): gate source-facts contract on real brief source content”; “fix(ai): explain opaque handles when generated scripts fail”; “fix(ai): validate a single shared planning contract before generation”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-orchestrator/src/prompt.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-image-enrich/src/net/providers.rs crates/op-image-enrich/src/net/providers.rs:320— crates/op-image-enrich/src/net/providers.rs changed 13 times in last 90 days and 10 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is op_image_enrich::net::providers::run_first_search_with_judge at line 320), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ai): refine stock searches from authored image intent”; “fix(desktop): judge stock images in their visible slot crops”; “fix(ai): preserve visual subjects and bounded original image delivery”; “fix(ai): fence the unjudged image ladder with the slot's photo intent”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-image-enrich/src/net/providers.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-host-services/src/chat_subprocess_safety.rs crates/op-host-services/src/chat_subprocess_safety.rs:202— crates/op-host-services/src/chat_subprocess_safety.rs changed 11 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is IsolatedTurn::prepare_for at line 202), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(agent): filter recovered agy startup and telemetry noise”; “fix(agent): distinguish agy network failures from login errors”; “fix(agent): reuse agy login in isolated design turns”; “fix(ai): tell Antigravity generation turns to answer in text, not tools”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-host-services/src/chat_subprocess_safety.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-orchestrator/src/orchestration_self_check.rs crates/op-orchestrator/src/orchestration_self_check.rs:416— crates/op-orchestrator/src/orchestration_self_check.rs changed 10 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is op_orchestrator::orchestration_self_check::is_mobile_featured_card_split_badly at line 416), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ai): validate generated motion and honor multi-screen page counts”; “fix(ai): preserve mobile gutters and reject invalid static paint”; “fix(ai): preserve authored carousel widths and chart geometry”; “fix(ai): reject header-only generated cards”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-orchestrator/src/orchestration_self_check.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-image-enrich/src/net/providers/relevance.rs crates/op-image-enrich/src/net/providers/relevance.rs:394— crates/op-image-enrich/src/net/providers/relevance.rs changed 10 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is op_image_enrich::net::providers::relevance::fence_verdict at line 394), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ai): refine stock searches from authored image intent”; “fix(ai): retain relevant compound stock image subjects”; “fix(ai): preserve visual subjects and bounded original image delivery”; “fix(ai): stop the image fence emptying product slots on a prompt-only photo contract”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-image-enrich/src/net/providers/relevance.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-smoke/src/llm_clients.rs crates/op-smoke/src/llm_clients.rs:65— crates/op-smoke/src/llm_clients.rs changed 9 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is SmokeLlmClient::call at line 65), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ai): preserve always-on reasoning for GLM FlashX”; “fix(ai): ask OpenRouter reasoning models for low effort on design turns”; “fix(ai): ride out provider 429s in the headless smoke client”; “fix(agent): cap the whole non-streaming provider call in op-smoke”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-smoke/src/llm_clients.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-orchestrator/src/plan_coverage.rs crates/op-orchestrator/src/plan_coverage.rs:155— crates/op-orchestrator/src/plan_coverage.rs changed 8 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is op_orchestrator::plan_coverage::check_coverage at line 155), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ai): count a brief's quoted section titles as covered”; “fix(agent): stop the coverage gate reporting qualified sections as missing”; “fix(agent): cover a compound brief section part by part”; “fix(agent): let a detail of a planned section be covered inside it”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-orchestrator/src/plan_coverage.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-host-services/src/web_canvas_server/online_run_loop.rs crates/op-host-services/src/web_canvas_server/online_run_loop.rs:128— crates/op-host-services/src/web_canvas_server/online_run_loop.rs changed 10 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is op_host_services::web_canvas_server::online_run_loop::run_online_web_canvas at line 128), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(web): gate unix-only signal + test helpers off the windows build”; “fix(web): request-time epoch snapshots, AI write admission, drain without ceiling”; “fix(web): make the identity reset claims real and cover /mcp in the write barrier”; “fix(web): credential partition hygiene, shutdown write barrier, seed lifecycle”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-host-services/src/web_canvas_server/online_run_loop.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-orchestrator/src/plan_repair.rs crates/op-orchestrator/src/plan_repair.rs:147— crates/op-orchestrator/src/plan_repair.rs changed 8 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is op_orchestrator::plan_repair::allocate_section_heights at line 147), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ai): keep the modelled plan when only sharedContext is rejected”; “fix(ai): validate a single shared planning contract before generation”; “fix(ai): share subject identity across generated sections and retries”; “fix(ai): retain declared palettes during replanning”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-orchestrator/src/plan_repair.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-chat-agent/src/backoff.rs crates/op-chat-agent/src/backoff.rs:171— crates/op-chat-agent/src/backoff.rs changed 7 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is op_chat_agent::backoff::send_with_backoff at line 171), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ai): preserve always-on reasoning for GLM FlashX”; “fix(ai): distinguish model entitlement denial from throttling”; “fix(ai): ask OpenRouter reasoning models for low effort on design turns”; “fix(agent): route every Studio task family to the design pipeline”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-chat-agent/src/backoff.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-orchestrator/src/plan_coverage_text.rs crates/op-orchestrator/src/plan_coverage_text.rs:137— crates/op-orchestrator/src/plan_coverage_text.rs changed 6 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is op_orchestrator::plan_coverage_text::label_names_section at line 137), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ai): preserve business sections during plan normalization”; “fix(agent): stop the coverage gate reporting qualified sections as missing”; “fix(agent): cover a compound brief section part by part”; “fix(agent): count a page named by the brief as covered by its screen”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-orchestrator/src/plan_coverage_text.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-pen-loader/src/lib.rs crates/op-pen-loader/src/lib.rs:151— crates/op-pen-loader/src/lib.rs changed 9 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is op_pen_loader::editor_state_var_table at line 151), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(renderer): paint preview scenes with the runtime text backend”; “fix(renderer): expand normal-mode presentation without changing preview”; “fix(renderer): separate full-content design captures from viewports”; “fix(editor): align table reader and exports with initial preview state”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-pen-loader/src/lib.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-host-services/src/web_canvas_server/tenant.rs crates/op-host-services/src/web_canvas_server/tenant.rs:633— crates/op-host-services/src/web_canvas_server/tenant.rs changed 7 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is TenantRegistry::update_acl at line 633), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(web): request-time epoch snapshots, AI write admission, drain without ceiling”; “fix(web): credential partition hygiene, shutdown write barrier, seed lifecycle”; “fix(web): wire the review remedies end to end”; “fix(web): close the review's high-severity online gaps”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-host-services/src/web_canvas_server/tenant.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-host-services/src/chat_subprocess_quirks.rs crates/op-host-services/src/chat_subprocess_quirks.rs:239— crates/op-host-services/src/chat_subprocess_quirks.rs changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is op_host_services::chat_subprocess_quirks::parse_codex_line at line 239), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ai): let codex keep reconnecting after a stream hiccup”; “fix(agent): match the Codex env allowlist case-insensitively (#232)”; “fix(agent): deflake the subprocess, http-server, and probe tests”; “fix(agent): upgrade Copilot SDK and CLI lifecycles”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-host-services/src/chat_subprocess_quirks.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-orchestrator/src/plan_fallback_card.rs crates/op-orchestrator/src/plan_fallback_card.rs:22— crates/op-orchestrator/src/plan_fallback_card.rs changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is op_orchestrator::plan_fallback_card::explicit_card_count at line 22), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ai): share subject identity across generated sections and retries”; “fix(ai): preserve brief palettes and resized map geometry”; “fix(ai): preserve requested board counts and fixed delivery layouts”; “fix(agent): repair generation defects measured in the motion and image runs”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-orchestrator/src/plan_fallback_card.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-orchestrator/src/retry_subtask.rs crates/op-orchestrator/src/retry_subtask.rs:96— crates/op-orchestrator/src/retry_subtask.rs changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is op_orchestrator::retry_subtask::retry_subtask at line 96), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ai): share subject identity across generated sections and retries”; “fix(ai): preserve brief palettes and resized map geometry”; “fix(agent): stop structure-drift self-check from dropping whole sections”; “fix(agent): retry a failed section back into its planned position”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-orchestrator/src/retry_subtask.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-host-web/src/widget_host/studio_home_input.rs crates/op-host-web/src/widget_host/studio_home_input.rs:184— crates/op-host-web/src/widget_host/studio_home_input.rs changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is WidgetHost::home_escape at line 184), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(editor): navigate home briefs by displayed text rows”; “fix(editor): make home briefs and references easier to edit”; “fix(editor): complete reliable normal-mode creation and document workflows”; “fix(editor): lay out Studio Home in the UI locale”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-host-web/src/widget_host/studio_home_input.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-orchestrator/src/model_profile.rs crates/op-orchestrator/src/model_profile.rs:459— crates/op-orchestrator/src/model_profile.rs changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is op_orchestrator::model_profile::resolve_model_profile at line 459), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ai): preserve always-on reasoning for GLM FlashX”; “fix(agent): turn thinking off for GLM-5.3-Flash, which accepts it”; “fix(agent): treat the Claude Code CLI model aliases as full-tier models”; “fix(ai): stop sending thinking:disabled to GLM-5.3”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-orchestrator/src/model_profile.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-editor-ui/src/widgets/home_works_list.rs crates/op-editor-ui/src/widgets/home_works_list.rs:191— crates/op-editor-ui/src/widgets/home_works_list.rs changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is op_editor_ui::widgets::home_works_list::paint_works_page at line 191), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(editor): distinguish same-named recent works by folder”; “fix(editor): preserve declared work types across reopen”; “fix(editor): retain scoped edits for failure recovery”; “fix(panels): fit mobile work names with rendered font metrics”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-editor-ui/src/widgets/home_works_list.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-editor-ui/src/widgets/works_reader_paint.rs crates/op-editor-ui/src/widgets/works_reader_paint.rs:372— crates/op-editor-ui/src/widgets/works_reader_paint.rs changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is op_editor_ui::widgets::works_reader_paint::paint_status_line at line 372), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(editor): preserve declared work types across reopen”; “fix(editor): retain scoped edits for failure recovery”; “fix(panels): measure reader text with its painted weight”; “fix(editor): make normal reader details and overlapping pages accessible”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-editor-ui/src/widgets/works_reader_paint.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-host-web/src/live_sync_conflict.rs crates/op-host-web/src/live_sync_conflict.rs:26— crates/op-host-web/src/live_sync_conflict.rs changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is op_host_web::live_sync_conflict::preserve_local_document at line 26), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(web): satisfy canvaskit clippy on the live-sync modules”; “fix(web): credential partition hygiene, shutdown write barrier, seed lifecycle”; “fix(web): wire the review remedies end to end”; “fix(web): recovery affordance, tenant-aware URLs, and restore isolation for online”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-host-web/src/live_sync_conflict.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/op-orchestrator/src/plan_shared_context.rs crates/op-orchestrator/src/plan_shared_context.rs:55— crates/op-orchestrator/src/plan_shared_context.rs changed 5 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is PlanSharedContext::validate at line 55), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ai): fill requested concept fields with demo values instead of placeholders”; “fix(ai): gate source-facts contract on real brief source content”; “fix(ai): repair rejected plans without losing shared decisions”; “fix(ai): give precise shared context retry diagnostics”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-07..2026-11-05, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-07 11:29:33 +08:00' --until='2026-11-05 11:29:33 +08:00' --full-history --no-merges -- crates/op-orchestrator/src/plan_shared_context.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Duplicated block (6 lines × 2) crates/op-ai-skills/src/loader.rs:38— crates/op-ai-skills/src/loader.rs:38-43 | crates/op-ai-skills/src/style_guide/loader.rs:62-67 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-ai-skills/src/loader.rs:38` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/op-ai/src/chat_sse.rs:60— crates/op-ai/src/chat_sse.rs:60-65 | crates/op-hosted-models/src/stream_protocol.rs:81-86 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-ai/src/chat_sse.rs:60` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:398— crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:398-403 | crates/op-chat-agent/src/chat_agent_loop/openai.rs:362-367 — before extracting anything, compare `crates/op-chat-agent/src/chat_agent_loop/anthropic.rs` and `crates/op-chat-agent/src/chat_agent_loop/openai.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 175 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:398` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/op-chrome-extension-core/src/design_md_validate.rs:110— crates/op-chrome-extension-core/src/design_md_validate.rs:110-115 | crates/op-chrome-extension-core/src/design_md_validate.rs:144-150 — both copies are in the same file, so extract the 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 (6 lines × 2) crates/op-collab-relay-locator-hsm/src/server.rs:159— crates/op-collab-relay-locator-hsm/src/server.rs:159-164 | crates/op-collab-relay-locator-hsm/src/server.rs:186-191 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-collab-relay-locator-hsm/src/server.rs:159` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/op-editor-core/src/component_backing.rs:53— crates/op-editor-core/src/component_backing.rs:53-58 | crates/op-editor-core/src/component_backing.rs:65-70 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/component_backing.rs:53` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/op-editor-core/src/icon_path_normalize.rs:389— crates/op-editor-core/src/icon_path_normalize.rs:389-394 | crates/op-editor-core/src/icon_path_normalize.rs:407-412 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/icon_path_normalize.rs:389` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (6 lines × 2) crates/op-editor-core/src/svg_path_data.rs:357— crates/op-editor-core/src/svg_path_data.rs:357-362 | crates/op-editor-core/src/svg_path_data.rs:364-369 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (6 lines × 2) crates/op-editor-host-core/src/settings_io.rs:484— crates/op-editor-host-core/src/settings_io.rs:484-489 | crates/op-editor-host-core/src/settings_payload.rs:258-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-host-core/src/settings_io.rs:484` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/op-editor-ui/src/svg_export.rs:285— crates/op-editor-ui/src/svg_export.rs:285-290 | crates/op-render-export/src/lib.rs:395-400 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_builtin.rs:210— crates/op-editor-ui/src/widgets/agent_settings_builtin.rs:210-218 | crates/op-editor-ui/src/widgets/agent_settings_builtin.rs:302-307 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/agent_settings_builtin.rs:210` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/op-editor-ui/src/widgets/canvas_path_overlay.rs:183— crates/op-editor-ui/src/widgets/canvas_path_overlay.rs:183-188 | crates/op-editor-ui/src/widgets/canvas_viewport/overlays.rs:72-77 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) crates/op-editor-ui/src/widgets/canvas_viewport_overlay.rs:330— crates/op-editor-ui/src/widgets/canvas_viewport_overlay.rs:330-335 | crates/op-editor-ui/src/widgets/canvas_viewport_overlay.rs:352-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/canvas_viewport_overlay.rs:330` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (6 lines × 2) crates/op-editor-ui/src/widgets/home_surface_paint_compact_chrome.rs:28— crates/op-editor-ui/src/widgets/home_surface_paint_compact_chrome.rs:28-33 | crates/op-editor-ui/src/widgets/works_reader_paint.rs:453-458 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) crates/op-editor-ui/src/widgets/home_surface_paint_sections.rs:95— crates/op-editor-ui/src/widgets/home_surface_paint_sections.rs:95-102 | crates/op-editor-ui/src/widgets/home_surface_paint_works_grid.rs:46-51 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/home_surface_paint_sections.rs:95` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/op-editor-ui/src/widgets/home_surface_palette.rs:202— crates/op-editor-ui/src/widgets/home_surface_palette.rs:202-207 | crates/op-editor-ui/src/widgets/home_surface_palette.rs:278-283 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/home_surface_palette.rs:202` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-editor-ui/src/widgets/home_surface_palette.rs:201` calls `rgba_u8` and `crates/op-editor-ui/src/widgets/home_surface_palette.rs:277` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) crates/op-editor-ui/src/widgets/text_input.rs:105— crates/op-editor-ui/src/widgets/text_input.rs:105-110 | crates/op-editor-ui/src/widgets/text_input.rs:167-172 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/text_input.rs:105` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/op-editor-ui/src/widgets/works_reader_paint_tablet.rs:100— crates/op-editor-ui/src/widgets/works_reader_paint_tablet.rs:100-105 | crates/op-editor-ui/src/widgets/workspace_surface_paint.rs:607-612 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/works_reader_paint_tablet.rs:100` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (6 lines × 2) crates/op-engine-jni/src/callbacks.rs:200— crates/op-engine-jni/src/callbacks.rs:200-205 | crates/op-engine-napi/src/callbacks.rs:143-151 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-engine-jni/src/callbacks.rs:200` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/op-figma/src/instance/swap_filter.rs:36— crates/op-figma/src/instance/swap_filter.rs:36-41 | crates/op-figma/src/instance/swap_filter.rs:42-47 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/op-host-services/src/chat_subprocess.rs:516— crates/op-host-services/src/chat_subprocess.rs:516-521 | crates/op-host-services/src/chat_subprocess.rs:584-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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 2) crates/op-host-services/src/web_canvas_server/connection.rs:173— crates/op-host-services/src/web_canvas_server/connection.rs:173-178 | crates/op-host-services/src/web_canvas_server/online_run_loop.rs:686-691 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-services/src/web_canvas_server/connection.rs:173` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) crates/op-host-services/src/web_static.rs:68— crates/op-host-services/src/web_static.rs:68-73 | crates/op-host-services/src/web_static.rs:104-109 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-services/src/web_static.rs:68` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/op-host-services/src/web_static.rs:111` calls `push`, `join` and `crates/op-host-services/src/web_static.rs:75` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) crates/op-host-web/src/dom_io/document_io.rs:204— crates/op-host-web/src/dom_io/document_io.rs:204-209 | crates/op-host-web/src/dom_io/document_io.rs:573-579 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-web/src/dom_io/document_io.rs:204` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/op-host-web/src/vscode_bridge.rs:631— crates/op-host-web/src/vscode_bridge.rs:631-636 | crates/op-host-web/src/vscode_bridge.rs:699-704 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-web/src/vscode_bridge.rs:631` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/op-chat-agent/src/design_agent_tools/quality_scans.rs:258— crates/op-chat-agent/src/design_agent_tools/quality_scans.rs:258-265 | crates/op-orchestrator/src/role_post_pass/surface_structure.rs:362-369 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-chat-agent/src/design_agent_tools/quality_scans.rs:258` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/op-codegen/src/codegen_tailwind_shadcn.rs:150— crates/op-codegen/src/codegen_tailwind_shadcn.rs:150-157 | crates/op-orchestrator/src/source_facts.rs:131-138 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (8 lines × 2) crates/op-collab-relay-client/src/session.rs:454— crates/op-collab-relay-client/src/session.rs:454-461 | crates/op-collab-relay-client/src/session.rs:473-480 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-collab-relay-client/src/session.rs:454` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/op-collab-transport/src/runtime.rs:97— crates/op-collab-transport/src/runtime.rs:97-104 | crates/op-collab-transport/src/runtime.rs:106-113 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/op-collab/src/apply.rs:221— crates/op-collab/src/apply.rs:221-228 | crates/op-collab/src/apply.rs:285-295 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-collab/src/apply.rs:221` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 lines × 2) crates/op-editor-core/src/collab_ui_state.rs:169— crates/op-editor-core/src/collab_ui_state.rs:169-176 | crates/op-editor-ui/src/widgets/collab_avatar_paint.rs:16-23 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/collab_ui_state.rs:169` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/op-editor-core/src/prompt_center_catalog.rs:290— crates/op-editor-core/src/prompt_center_catalog.rs:290-297 | crates/op-editor-core/src/scene_template_catalog.rs:459-466 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/prompt_center_catalog.rs:290` it does not close everything it opens, so those 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 (8 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_acp.rs:433— crates/op-editor-ui/src/widgets/agent_settings_acp.rs:433-440 | crates/op-editor-ui/src/widgets/agent_settings_builtin.rs:704-711 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_images/paint.rs:44— crates/op-editor-ui/src/widgets/agent_settings_images/paint.rs:44-51 | crates/op-editor-ui/src/widgets/agent_settings_images/paint.rs:233-240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/agent_settings_images/paint.rs:44` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/op-editor-ui/src/widgets/ai_chat_transcript_design.rs:320— crates/op-editor-ui/src/widgets/ai_chat_transcript_design.rs:320-327 | crates/op-orchestrator/src/parse.rs:330-337 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-editor-ui/src/widgets/ai_chat_transcript_design.rs:319` calls `remove` and `crates/op-orchestrator/src/parse.rs:329` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) crates/op-editor-ui/src/widgets/layer_context_menu.rs:328— crates/op-editor-ui/src/widgets/layer_context_menu.rs:328-335 | crates/op-editor-ui/src/widgets/path_anchor_context_menu.rs:117-124 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) crates/op-editor-ui/src/widgets/mobile_chrome.rs:744— crates/op-editor-ui/src/widgets/mobile_chrome.rs:744-751 | crates/op-editor-ui/src/widgets/mobile_chrome.rs:785-792 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/op-editor-ui/src/widgets/preview_device_switcher.rs:88— crates/op-editor-ui/src/widgets/preview_device_switcher.rs:88-95 | crates/op-editor-ui/src/widgets/screen_switcher_pills.rs:118-125 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/preview_device_switcher.rs:88` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/op-editor-ui/src/widgets/property_panel_effects.rs:334— crates/op-editor-ui/src/widgets/property_panel_effects.rs:334-341 | crates/op-editor-ui/src/widgets/property_panel_fill.rs:601-608 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/property_panel_effects.rs:334` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/op-editor-ui/src/widgets/property_panel_inputs.rs:253— crates/op-editor-ui/src/widgets/property_panel_inputs.rs:253-260 | crates/op-editor-ui/src/widgets/property_panel_inputs.rs:480-487 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/property_panel_inputs.rs:253` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/op-editor-ui/src/widgets/works_reader_paint.rs:129— crates/op-editor-ui/src/widgets/works_reader_paint.rs:129-136 | crates/op-editor-ui/src/widgets/workspace_surface_paint.rs:233-240 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/works_reader_paint.rs:129` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/op-editor-ui/src/widgets/workspace_quality_paint.rs:191— crates/op-editor-ui/src/widgets/workspace_quality_paint.rs:191-198 | crates/op-editor-ui/src/widgets/workspace_quality_paint.rs:325-332 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/workspace_quality_paint.rs:191` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/op-engine-ffi/src/desc.rs:348— crates/op-engine-ffi/src/desc.rs:348-355 | crates/op-engine-ffi/src/lifecycle.rs:417-424 — 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 (8 lines × 2) crates/op-engine-ffi/src/editor_chat_design.rs:75— crates/op-engine-ffi/src/editor_chat_design.rs:75-82 | crates/op-host-desktop/src/chat_session_launch_design.rs:98-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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `state` to `&EditorState` in one and `&op_editor_core::EditorState` 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) crates/op-engine-jni/src/callbacks.rs:62— crates/op-engine-jni/src/callbacks.rs:62-69 | crates/op-engine-napi/src/callbacks.rs:53-60 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-engine-jni/src/callbacks.rs:62` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/op-host-desktop/src/app_handler/pointer_events.rs:48— crates/op-host-desktop/src/app_handler/pointer_events.rs:48-55 | crates/op-host-desktop/src/app_handler/pointer_events.rs:120-127 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-desktop/src/app_handler/pointer_events.rs:48` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `super) fn on_cursor_moved(&mut` in one and `super) fn on_left_press(&mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8 lines × 2) crates/op-host-desktop/src/mcp_integrations.rs:388— crates/op-host-desktop/src/mcp_integrations.rs:388-395 | crates/op-host-desktop/src/mcp_integrations.rs:449-456 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-desktop/src/mcp_integrations.rs:388` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/op-host-desktop/src/mcp_integrations.rs:507— crates/op-host-desktop/src/mcp_integrations.rs:507-514 | crates/op-host-desktop/src/mcp_integrations.rs:532-539 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-desktop/src/mcp_integrations.rs:507` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/op-host-desktop/src/persistence_image.rs:224— crates/op-host-desktop/src/persistence_image.rs:224-231 | crates/op-host-web/src/dom_io.rs:414-421 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-desktop/src/persistence_image.rs:224` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/op-host-native/src/backend/skia/path.rs:208— crates/op-host-native/src/backend/skia/path.rs:208-215 | crates/op-host-native/src/backend/skia/path.rs:233-240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-native/src/backend/skia/path.rs:208` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
MethodTooLong: EditorState.apply_with_allocator crates/op-editor-core/src/command_apply.rs:55— MethodTooLong — apply_with_allocator runs 578 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 478 over it, 5.78× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WidgetHost.apply_cursor_move crates/op-host-web/src/widget_host/cursor_input.rs:17— MethodTooLong — apply_cursor_move runs 525 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 425 over it, 5.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WidgetHostNative.paint crates/op-host-native/src/widget_host/paint.rs:19— MethodTooLong — paint runs 424 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 324 over it, 4.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CollabPanel.paint crates/op-editor-ui/src/widgets/collab_panel.rs:122— MethodTooLong — paint runs 422 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 322 over it, 4.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PropertyPanel.paint crates/op-editor-ui/src/widgets/property_panel/paint.rs:31— MethodTooLong — paint runs 408 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 308 over it, 4.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Orchestrator.run crates/op-orchestrator/src/run_orchestrator.rs:23— MethodTooLong — run runs 405 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 305 over it, 4.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WidgetHostNative.update_agent_settings_hover crates/op-host-native/src/widget_host/geometry_settings_hover.rs:12— MethodTooLong — update_agent_settings_hover runs 365 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 265 over it, 3.65× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WidgetHost.update_agent_settings_hover crates/op-host-web/src/widget_host/agent_settings_hover.rs:14— MethodTooLong — update_agent_settings_hover runs 329 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 229 over it, 3.29× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TopBar.paint_chrome crates/op-editor-ui/src/widgets/top_bar_paint.rs:17— MethodTooLong — paint_chrome runs 325 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 225 over it, 3.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WidgetHost.paint_editor crates/op-host-web/src/widget_host/paint.rs:49— MethodTooLong — paint_editor runs 321 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 221 over it, 3.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WidgetHostNative.dispatch_git_panel_press crates/op-host-native/src/widget_host/git_press.rs:26— MethodTooLong — dispatch_git_panel_press runs 312 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 212 over it, 3.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DesktopApp.on_redraw_requested crates/op-host-desktop/src/app_handler/redraw.rs:35— MethodTooLong — on_redraw_requested runs 309 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 209 over it, 3.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LayerPanel.paint crates/op-editor-ui/src/widgets/layer_panel.rs:394— MethodTooLong — paint runs 298 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 198 over it, 2.98× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CanvasViewport.paint crates/op-editor-ui/src/widgets/canvas_viewport.rs:170— MethodTooLong — paint runs 289 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 189 over it, 2.89× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WidgetHostNative.apply_escape crates/op-host-native/src/widget_host/keyboard_escape.rs:13— MethodTooLong — apply_escape runs 275 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 175 over it, 2.75× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DesktopApp.handle_key_pressed crates/op-host-desktop/src/keyboard_input.rs:15— MethodTooLong — handle_key_pressed runs 265 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 165 over it, 2.65× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: GitPanel.paint crates/op-editor-ui/src/widgets/git_panel/paint.rs:12— MethodTooLong — paint runs 256 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 156 over it, 2.56× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: EditorState.commit_property_edit_inner crates/op-editor-core/src/property_edit_mutators.rs:69— MethodTooLong — commit_property_edit_inner runs 254 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 154 over it, 2.54× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: AIChatPlaceholder.paint crates/op-editor-ui/src/widgets/ai_chat_panel/widget_paint.rs:23— MethodTooLong — paint runs 246 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 146 over it, 2.46× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: EditorUiState.default crates/op-editor-core/src/editor_ui_state/defaults.rs:16— MethodTooLong — default runs 227 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 127 over it, 2.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DesktopApp.drain_git_action crates/op-host-desktop/src/git_host.rs:166— MethodTooLong — drain_git_action runs 209 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 109 over it, 2.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: AIChatPlaceholder.hit_test_with_canonical crates/op-editor-ui/src/widgets/ai_chat_panel_hit.rs:63— MethodTooLong — hit_test_with_canonical runs 206 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 106 over it, 2.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: OwnerSessionCore.handle_undo_request crates/op-collab/src/session_undo.rs:77— MethodTooLong — handle_undo_request runs 205 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 105 over it, 2.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WidgetHostNative.cursor_move_late_drag_tiers crates/op-host-native/src/widget_host/cursor_move_drags.rs:52— MethodTooLong — cursor_move_late_drag_tiers runs 198 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 98 over it, 1.98× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WidgetHost.apply_overlay_cursor_move crates/op-host-web/src/widget_host/overlay_cursor.rs:96— MethodTooLong — apply_overlay_cursor_move runs 189 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 89 over it, 1.89× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
op_editor_ui::widgets::canvas_viewport_paint::paint_node_inner (cognitive 177) crates/op-editor-ui/src/widgets/canvas_viewport_paint.rs:118— op_editor_ui::widgets::canvas_viewport_paint::paint_node_inner has cognitive complexity 177 (threshold 15). Drivers by points: if/else 85 (149 pts), boolean chains 17, match/switch 6 (8 pts), loops 1 (3 pts) (nesting depth added 68). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_ui::widgets::agent_settings_builtin::hit_test_with_touch (cognitive 124) crates/op-editor-ui/src/widgets/agent_settings_builtin.rs:123— op_editor_ui::widgets::agent_settings_builtin::hit_test_with_touch has cognitive complexity 124 (threshold 15). Drivers by points: if/else 42 (107 pts), boolean chains 11, loops 3 (6 pts) (nesting depth added 68). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
op_editor_ui::widgets::agent_settings_press_entries::apply_entry_hit (cognitive 84) crates/op-editor-ui/src/widgets/agent_settings_press_entries.rs:21— op_editor_ui::widgets::agent_settings_press_entries::apply_entry_hit has cognitive complexity 84 (threshold 15). Drivers by points: if/else 32 (67 pts), match/switch 8 (13 pts), boolean chains 4 (nesting depth added 40). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
op_editor_ui::widgets::property_panel_input_layout::editable_input_rects (cognitive 64) crates/op-editor-ui/src/widgets/property_panel_input_layout.rs:53— op_editor_ui::widgets::property_panel_input_layout::editable_input_rects has cognitive complexity 64 (threshold 15). Drivers by points: if/else 33 (48 pts), loops 3 (7 pts), boolean chains 6, match/switch 1 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_ui::widgets::property_panel_layout::action_button_rects_with_fill_picker (cognitive 63) crates/op-editor-ui/src/widgets/property_panel_layout.rs:213— op_editor_ui::widgets::property_panel_layout::action_button_rects_with_fill_picker has cognitive complexity 63 (threshold 15). Drivers by points: if/else 35 (50 pts), loops 4 (11 pts), boolean chains 2 (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.
op_editor_ui::widgets::ai_chat_transcript::paint_transcript_with_selection (cognitive 59) crates/op-editor-ui/src/widgets/ai_chat_transcript.rs:609— op_editor_ui::widgets::ai_chat_transcript::paint_transcript_with_selection has cognitive complexity 59 (threshold 15). Drivers by points: if/else 15 (41 pts), loops 5 (12 pts), match/switch 3 (5 pts), boolean chains 1 (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
op_editor_ui::widgets::ai_chat_transcript_hit::transcript_hit (cognitive 58) crates/op-editor-ui/src/widgets/ai_chat_transcript_hit.rs:22— op_editor_ui::widgets::ai_chat_transcript_hit::transcript_hit has cognitive complexity 58 (threshold 15). Drivers by points: if/else 15 (45 pts), loops 6 (13 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_ui::widgets::ai_chat_transcript::build_item (cognitive 56) crates/op-editor-ui/src/widgets/ai_chat_transcript.rs:179— op_editor_ui::widgets::ai_chat_transcript::build_item has cognitive complexity 56 (threshold 15). Drivers by points: if/else 35 (39 pts), boolean chains 12, loops 3 (5 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
op_editor_ui::widgets::canvas_viewport_image::paint_image_node_with_stroke (cognitive 51) crates/op-editor-ui/src/widgets/canvas_viewport_image.rs:409— op_editor_ui::widgets::canvas_viewport_image::paint_image_node_with_stroke has cognitive complexity 51 (threshold 15). Drivers by points: if/else 30 (43 pts), boolean chains 8 (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.
op_editor_ui::widgets::home_surface_paint_panels::paint_composer (cognitive 50) crates/op-editor-ui/src/widgets/home_surface_paint_panels.rs:25— op_editor_ui::widgets::home_surface_paint_panels::paint_composer has cognitive complexity 50 (threshold 15). Drivers by points: if/else 28 (43 pts), loops 3 (5 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.
op_editor_ui::widgets::canvas_viewport_layer_bounds::subtree_visual_bounds (cognitive 47) crates/op-editor-ui/src/widgets/canvas_viewport_layer_bounds.rs:99— op_editor_ui::widgets::canvas_viewport_layer_bounds::subtree_visual_bounds has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (34 pts), loops 3 (5 pts), boolean chains 4, match/switch 2 (4 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_ui::widgets::property_panel_typography_paint::paint_font_picker_layout (cognitive 47) crates/op-editor-ui/src/widgets/property_panel_typography_paint.rs:151— op_editor_ui::widgets::property_panel_typography_paint::paint_font_picker_layout has cognitive complexity 47 (threshold 15). Drivers by points: if/else 24 (39 pts), match/switch 2 (5 pts), boolean chains 2, loops 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.
op_editor_ui::widgets::collab_ui::panel_session_or_pre_auth (cognitive 45) crates/op-editor-ui/src/widgets/collab_ui.rs:215— op_editor_ui::widgets::collab_ui::panel_session_or_pre_auth has cognitive complexity 45 (threshold 15). Drivers by points: if/else 19 (39 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 21). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
op_editor_ui::widgets::property_panel_code_complete::syntax_tokens (cognitive 45) crates/op-editor-ui/src/widgets/property_panel_code_complete.rs:474— op_editor_ui::widgets::property_panel_code_complete::syntax_tokens has cognitive complexity 45 (threshold 15). Drivers by points: if/else 15 (30 pts), loops 5 (13 pts), boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_ui::widgets::agent_settings_builtin_form::paint_field (cognitive 44) crates/op-editor-ui/src/widgets/agent_settings_builtin_form.rs:222— op_editor_ui::widgets::agent_settings_builtin_form::paint_field has cognitive complexity 44 (threshold 15). Drivers by points: if/else 31 (37 pts), match/switch 3 (4 pts), boolean chains 3 (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.
op_editor_ui::widgets::canvas_viewport_text::paint_text_node (cognitive 44) crates/op-editor-ui/src/widgets/canvas_viewport_text.rs:278— op_editor_ui::widgets::canvas_viewport_text::paint_text_node has cognitive complexity 44 (threshold 15). Drivers by points: if/else 20 (33 pts), loops 3 (6 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_ui::widgets::property_panel_dispatch::apply_property_action (cognitive 44) crates/op-editor-ui/src/widgets/property_panel_dispatch.rs:186— op_editor_ui::widgets::property_panel_dispatch::apply_property_action has cognitive complexity 44 (threshold 15). Drivers by points: if/else 20 (38 pts), match/switch 3 (6 pts) (nesting depth added 21). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
op_editor_ui::widgets::property_panel_instance::paint_component_block (cognitive 44) crates/op-editor-ui/src/widgets/property_panel_instance.rs:163— op_editor_ui::widgets::property_panel_instance::paint_component_block has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (37 pts), boolean chains 4, loops 1 (2 pts), match/switch 1 (nesting depth added 23). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
op_editor_ui::widgets::agent_settings_builtin_model_menu::paint_model_menu (cognitive 42) crates/op-editor-ui/src/widgets/agent_settings_builtin_model_menu.rs:273— op_editor_ui::widgets::agent_settings_builtin_model_menu::paint_model_menu has cognitive complexity 42 (threshold 15). Drivers by points: if/else 20 (39 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_ui::widgets::home_surface_paint_compact::paint_composer (cognitive 42) crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs:291— op_editor_ui::widgets::home_surface_paint_compact::paint_composer has cognitive complexity 42 (threshold 15). Drivers by points: if/else 21 (34 pts), loops 4 (6 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.
op_editor_ui::widgets::property_panel_typography::font_picker_layout_at_with_density (cognitive 40) crates/op-editor-ui/src/widgets/property_panel_typography.rs:311— op_editor_ui::widgets::property_panel_typography::font_picker_layout_at_with_density has cognitive complexity 40 (threshold 15). Drivers by points: if/else 23 (32 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_ui::widgets::home_surface_copy::task_copy (cognitive 38) crates/op-editor-ui/src/widgets/home_surface_copy.rs:30— op_editor_ui::widgets::home_surface_copy::task_copy has cognitive complexity 38 (threshold 15). Drivers by points: if/else 18 (31 pts), match/switch 6 (7 pts) (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
op_editor_ui::widgets::press_flow::apply_layer_panel_click (cognitive 38) crates/op-editor-ui/src/widgets/press_flow.rs:473— op_editor_ui::widgets::press_flow::apply_layer_panel_click has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (31 pts), match/switch 3 (6 pts), boolean chains 1 (nesting depth added 19). 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.
op_editor_ui::widgets::property_panel_input_layout::push_fill_action_rects (cognitive 38) crates/op-editor-ui/src/widgets/property_panel_input_layout.rs:378— op_editor_ui::widgets::property_panel_input_layout::push_fill_action_rects has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (29 pts), loops 3 (6 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_ui::widgets::agent_settings_builtin_form::paint_identity (cognitive 37) crates/op-editor-ui/src/widgets/agent_settings_builtin_form.rs:135— op_editor_ui::widgets::agent_settings_builtin_form::paint_identity has cognitive complexity 37 (threshold 15). Drivers by points: if/else 30 (34 pts), boolean chains 2, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Duplicated block (7 lines × 2) crates/op-ai-skills/src/budget.rs:187— crates/op-ai-skills/src/budget.rs:187-193 | crates/op-ai-skills/src/budget.rs:239-245 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-ai-skills/src/budget.rs:187` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/op-chat-agent/src/design_agent_tools/root_seed.rs:369— crates/op-chat-agent/src/design_agent_tools/root_seed.rs:369-375 | crates/op-orchestrator/src/finalize_enforce_status_bar.rs:303-309 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 2) crates/op-cli/src/command_mappers.rs:199— crates/op-cli/src/command_mappers.rs:199-205 | crates/op-cli/src/command_mappers.rs:316-322 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/op-codegen/src/codegen_html.rs:41— crates/op-codegen/src/codegen_html.rs:41-47 | crates/op-codegen/src/codegen_targets.rs:295-301 — before extracting anything, compare `crates/op-codegen/src/codegen_html.rs` and `crates/op-codegen/src/codegen_targets.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/op-codegen/src/codegen_targets.rs:302` calls `emitted_corner_radius` and `crates/op-codegen/src/codegen_html.rs:48` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) crates/op-codegen/src/codegen_html.rs:110— crates/op-codegen/src/codegen_html.rs:110-116 | crates/op-codegen/src/codegen_targets.rs:359-365 — before extracting anything, compare `crates/op-codegen/src/codegen_html.rs` and `crates/op-codegen/src/codegen_targets.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-codegen/src/codegen_html.rs:110` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/op-collab-host/src/runtime/network/guest.rs:218— crates/op-collab-host/src/runtime/network/guest.rs:218-224 | crates/op-collab-host/src/runtime/network/owner.rs:80-88 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-collab-host/src/runtime/network/owner.rs:80` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 2) crates/op-collab-relay-client/src/session.rs:79— crates/op-collab-relay-client/src/session.rs:79-85 | crates/op-collab-relay-client/src/session.rs:89-95 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-collab-relay-client/src/session.rs:79` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/op-design-lint/src/node_util.rs:583— crates/op-design-lint/src/node_util.rs:583-589 | crates/op-orchestrator/src/validation_dump.rs:327-333 — before extracting anything, compare `crates/op-design-lint/src/node_util.rs` and `crates/op-orchestrator/src/validation_dump.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 2) crates/op-editor-core/src/instance_override.rs:142— crates/op-editor-core/src/instance_override.rs:142-148 | crates/op-editor-core/src/ref_resolve.rs:281-287 — before extracting anything, compare `crates/op-editor-core/src/instance_override.rs` and `crates/op-editor-core/src/ref_resolve.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/instance_override.rs:142` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/op-editor-core/src/svg_path_data.rs:233— crates/op-editor-core/src/svg_path_data.rs:233-239 | crates/op-editor-core/src/svg_path_data.rs:244-250 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/svg_path_data.rs:244` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/op-editor-ui/src/widgets/canvas_viewport_image/svg_raster.rs:58— crates/op-editor-ui/src/widgets/canvas_viewport_image/svg_raster.rs:58-64 | crates/op-host-desktop/src/remote_image_host.rs:187-193 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 2) crates/op-editor-ui/src/widgets/canvas_viewport_paint.rs:141— crates/op-editor-ui/src/widgets/canvas_viewport_paint.rs:141-147 | crates/op-editor-ui/src/widgets/canvas_viewport_paint_mask.rs:197-203 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) crates/op-editor-ui/src/widgets/export_dialog.rs:317— crates/op-editor-ui/src/widgets/export_dialog.rs:317-323 | crates/op-editor-ui/src/widgets/save_name_dialog.rs:68-74 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/export_dialog.rs:317` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/op-editor-ui/src/widgets/home_surface_paint_works_grid.rs:118— crates/op-editor-ui/src/widgets/home_surface_paint_works_grid.rs:118-124 | crates/op-editor-ui/src/widgets/home_works_list.rs:265-271 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/home_surface_paint_works_grid.rs:118` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (7 lines × 2) crates/op-editor-ui/src/widgets/layer_context_menu.rs:248— crates/op-editor-ui/src/widgets/layer_context_menu.rs:248-254 | crates/op-editor-ui/src/widgets/path_anchor_context_menu.rs:69-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 (7 lines × 2) crates/op-editor-ui/src/widgets/property_panel_commit.rs:220— crates/op-editor-ui/src/widgets/property_panel_commit.rs:220-226 | crates/op-editor-ui/src/widgets/property_panel_commit.rs:286-292 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/property_panel_commit.rs:220` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (7 lines × 2) crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:64— crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:64-70 | crates/op-orchestrator/src/validation_dump.rs:300-306 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 2) crates/op-engine-jni/src/bindings_editor.rs:37— crates/op-engine-jni/src/bindings_editor.rs:37-43 | crates/op-engine-jni/src/bindings_editor.rs:319-325 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-engine-jni/src/bindings_editor.rs:37` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/op-host-desktop/src/app_handler/scheduling.rs:100— crates/op-host-desktop/src/app_handler/scheduling.rs:100-106 | crates/op-host-desktop/src/app_handler/scheduling.rs:183-189 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/op-host-desktop/src/app_handler/scheduling.rs:110` calls `has_pending_remote_image_requests`, `is_pending` and `crates/op-host-desktop/src/app_handler/scheduling.rs:191` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) crates/op-host-desktop/src/iconify_host.rs:152— crates/op-host-desktop/src/iconify_host.rs:152-158 | crates/op-host-desktop/src/remote_image_host.rs:128-134 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-desktop/src/iconify_host.rs:152` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/op-host-native/src/backend/skia/path.rs:723— crates/op-host-native/src/backend/skia/path.rs:723-729 | crates/op-host-native/src/boolean_ops.rs:181-187 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-native/src/backend/skia/path.rs:723` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `path` to `&skia_safe::Path` in one and `&SkPath` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (7 lines × 2) crates/op-host-native/src/widget_host/variables_panel_row_press.rs:183— crates/op-host-native/src/widget_host/variables_panel_row_press.rs:183-189 | crates/op-host-native/src/widget_host/variables_panel_row_press.rs:218-224 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/op-host-services/src/export_html.rs:117— crates/op-host-services/src/export_html.rs:117-123 | crates/op-host-services/src/export_hyperframes.rs:344-350 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) crates/op-host-services/src/mcp_serve/enrich_images_tool.rs:303— crates/op-host-services/src/mcp_serve/enrich_images_tool.rs:303-309 | crates/op-host-services/src/mcp_serve/finalize_tool.rs:155-161 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-services/src/mcp_serve/enrich_images_tool.rs:303` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/op-host-web/src/iconify_web.rs:402— crates/op-host-web/src/iconify_web.rs:402-408 | crates/op-host-web/src/web_asset_fetch.rs:421-427 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-web/src/iconify_web.rs:402` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
op_orchestrator::role_defaults::role_defaults (cyclomatic 51) crates/op-orchestrator/src/role_defaults.rs:187— op_orchestrator::role_defaults::role_defaults has cyclomatic complexity 51 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_orchestrator::validation_fixes_apply::apply_validation_fixes (cyclomatic 51) crates/op-orchestrator/src/validation_fixes_apply.rs:66— op_orchestrator::validation_fixes_apply::apply_validation_fixes has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_orchestrator::validation_fixes_apply::collect_node (cyclomatic 50) crates/op-orchestrator/src/validation_fixes_apply.rs:635— op_orchestrator::validation_fixes_apply::collect_node has cyclomatic complexity 50 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_orchestrator::cleanup_equalize_siblings::plan_family_repairs (cyclomatic 47) crates/op-orchestrator/src/cleanup_equalize_siblings.rs:236— op_orchestrator::cleanup_equalize_siblings::plan_family_repairs 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.
op_orchestrator::prompt_subagent::build_subagent_prompt_core_with_outcomes (cyclomatic 47) crates/op-orchestrator/src/prompt_subagent.rs:148— op_orchestrator::prompt_subagent::build_subagent_prompt_core_with_outcomes has cyclomatic complexity 47 (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.
op_orchestrator::subagent::run_subtask_with_reveal_at_and_outcomes (cyclomatic 33) crates/op-orchestrator/src/subagent.rs:133— op_orchestrator::subagent::run_subtask_with_reveal_at_and_outcomes 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.
op_orchestrator::parse::resolve_numeric_design_token (cyclomatic 32) crates/op-orchestrator/src/parse.rs:551— op_orchestrator::parse::resolve_numeric_design_token has cyclomatic complexity 32 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_orchestrator::geometry_diagnostics_collect::collect_diagnostics_with_context (cyclomatic 31) crates/op-orchestrator/src/geometry_diagnostics_collect.rs:172— op_orchestrator::geometry_diagnostics_collect::collect_diagnostics_with_context 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.
op_orchestrator::hero_bleed::enforce (cyclomatic 31) crates/op-orchestrator/src/hero_bleed.rs:16— op_orchestrator::hero_bleed::enforce 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.
op_orchestrator::table_pagination_contract::wire (cyclomatic 31) crates/op-orchestrator/src/table_pagination_contract.rs:30— op_orchestrator::table_pagination_contract::wire 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.
op_orchestrator::table_time_filter::wire (cyclomatic 31) crates/op-orchestrator/src/table_time_filter.rs:64— op_orchestrator::table_time_filter::wire 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.
op_orchestrator::cleanup_slide_padding::enforce_slide_padding_floor (cyclomatic 30) crates/op-orchestrator/src/cleanup_slide_padding.rs:106— op_orchestrator::cleanup_slide_padding::enforce_slide_padding_floor 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.
op_orchestrator::style_guide_context::infer_tags_from_prompt (cyclomatic 30) crates/op-orchestrator/src/style_guide_context.rs:25— op_orchestrator::style_guide_context::infer_tags_from_prompt has cyclomatic complexity 30 (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.
op_orchestrator::subagent_empty_controls::rejection (cyclomatic 30) crates/op-orchestrator/src/subagent_empty_controls.rs:8— op_orchestrator::subagent_empty_controls::rejection has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 4 of the 30 points are its own statements and the rest belongs to 5 function items inside it that branch (collect, content, badge_needs_content, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
op_orchestrator::text_contrast_photo::visit (cyclomatic 30) crates/op-orchestrator/src/text_contrast_photo.rs:192— op_orchestrator::text_contrast_photo::visit 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.
op_orchestrator::loop_finalize_record::record_same_id_shallow_patches (cyclomatic 29) crates/op-orchestrator/src/loop_finalize_record.rs:225— op_orchestrator::loop_finalize_record::record_same_id_shallow_patches 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.
op_orchestrator::role_post_pass::contrast::fix_button_foreground_contrast (cyclomatic 29) crates/op-orchestrator/src/role_post_pass/contrast.rs:6— op_orchestrator::role_post_pass::contrast::fix_button_foreground_contrast 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.
op_orchestrator::cleanup_section_margins::unify_transparent_section_margins (cyclomatic 27) crates/op-orchestrator/src/cleanup_section_margins.rs:62— op_orchestrator::cleanup_section_margins::unify_transparent_section_margins has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_orchestrator::mobile_content_rail::collect_repairs (cyclomatic 27) crates/op-orchestrator/src/mobile_content_rail.rs:298— op_orchestrator::mobile_content_rail::collect_repairs has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_orchestrator::radial_repair_sink::radial_stack_repair (cyclomatic 27) crates/op-orchestrator/src/radial_repair_sink.rs:85— op_orchestrator::radial_repair_sink::radial_stack_repair has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_orchestrator::compact_prompt::build_compact_planning_prompt (cyclomatic 26) crates/op-orchestrator/src/compact_prompt.rs:35— op_orchestrator::compact_prompt::build_compact_planning_prompt has cyclomatic complexity 26 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_orchestrator::subtask_completeness::expected_count_with_map_markers (cyclomatic 26) crates/op-orchestrator/src/subtask_completeness.rs:31— op_orchestrator::subtask_completeness::expected_count_with_map_markers 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.
op_orchestrator::plan_normalize::normalize (cyclomatic 25) crates/op-orchestrator/src/plan_normalize.rs:123— op_orchestrator::plan_normalize::normalize 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.
op_orchestrator::plan_shared_context_diagnostics::collect_shapes (cyclomatic 25) crates/op-orchestrator/src/plan_shared_context_diagnostics.rs:129— op_orchestrator::plan_shared_context_diagnostics::collect_shapes 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.
op_orchestrator::repair_record::describe_command (cyclomatic 25) crates/op-orchestrator/src/repair_record.rs:161— op_orchestrator::repair_record::describe_command has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Duplicated block (9 lines × 2) crates/op-auth-bridge/src/collab_claims.rs:504— crates/op-auth-bridge/src/collab_claims.rs:504-512 | crates/op-collab/src/profile_validation.rs:99-107 — before extracting anything, compare `crates/op-auth-bridge/src/collab_claims.rs` and `crates/op-collab/src/profile_validation.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-auth-bridge/src/collab_claims.rs:504` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/op-chat-agent/src/chat_agent_loop.rs:430— crates/op-chat-agent/src/chat_agent_loop.rs:430-438 | crates/op-host-services/src/chat_builtin_http_wire.rs:72-80 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-chat-agent/src/chat_agent_loop.rs:430` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:223— crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:223-232 | crates/op-chat-agent/src/chat_agent_loop/openai.rs:174-182 — before extracting anything, compare `crates/op-chat-agent/src/chat_agent_loop/anthropic.rs` and `crates/op-chat-agent/src/chat_agent_loop/openai.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 175 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (9 lines × 2) crates/op-cli/src/app_control_cli.rs:194— crates/op-cli/src/app_control_cli.rs:194-202 | crates/op-cli/src/app_control_cli.rs:308-316 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/op-collab-policy-file/src/lib.rs:251— crates/op-collab-policy-file/src/lib.rs:251-259 | crates/op-collab-relay-server/src/x25519_boundary.rs:240-248 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) crates/op-collab-relay-protocol/src/invite.rs:74— crates/op-collab-relay-protocol/src/invite.rs:74-82 | crates/op-collab-relay-protocol/src/locator.rs:254-262 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-collab-relay-protocol/src/invite.rs:74` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) crates/op-collab-smoke/src/fault_guest.rs:167— crates/op-collab-smoke/src/fault_guest.rs:167-175 | crates/op-collab-smoke/src/fault_owner.rs:208-216 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-collab-smoke/src/fault_guest.rs:167` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/op-collab-smoke/src/fault_guest.rs:228— crates/op-collab-smoke/src/fault_guest.rs:228-236 | crates/op-collab-smoke/src/fault_guest.rs:460-468 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/op-collab-transport/src/queue.rs:350— crates/op-collab-transport/src/queue.rs:350-358 | crates/op-collab-transport/src/reassembly_budget.rs:86-94 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) crates/op-collab/src/apply_tree.rs:56— crates/op-collab/src/apply_tree.rs:56-64 | crates/op-collab/src/apply_tree.rs:89-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-collab/src/apply_tree.rs:56` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/op-collab/src/apply_tree.rs:65` calls `saturating_add` and `crates/op-collab/src/apply_tree.rs:98` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) crates/op-design-lint/src/node_util.rs:366— crates/op-design-lint/src/node_util.rs:366-374 | crates/op-editor-core/src/variables_resolve.rs:91-99 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-design-lint/src/node_util.rs:366` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/op-editor-core/src/agent_settings_builtin_models.rs:141— crates/op-editor-core/src/agent_settings_builtin_models.rs:141-149 | crates/op-editor-core/src/agent_settings_builtin_models.rs:185-193 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/agent_settings_builtin_models.rs:141` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_builtin.rs:391— crates/op-editor-ui/src/widgets/agent_settings_builtin.rs:391-399 | crates/op-editor-ui/src/widgets/agent_settings_builtin.rs:432-440 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/agent_settings_builtin.rs:391` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_fonts.rs:200— crates/op-editor-ui/src/widgets/agent_settings_fonts.rs:200-208 | crates/op-editor-ui/src/widgets/agent_settings_fonts.rs:284-292 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/op-editor-ui/src/widgets/canvas_frame_labels.rs:141— crates/op-editor-ui/src/widgets/canvas_frame_labels.rs:141-149 | crates/op-editor-ui/src/widgets/canvas_frame_labels.rs:166-174 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/canvas_frame_labels.rs:141` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/op-editor-ui/src/widgets/drag_flow.rs:90— crates/op-editor-ui/src/widgets/drag_flow.rs:90-98 | crates/op-editor-ui/src/widgets/drag_flow_index.rs:139-147 — before extracting anything, compare `crates/op-editor-ui/src/widgets/drag_flow.rs` and `crates/op-editor-ui/src/widgets/drag_flow_index.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/drag_flow.rs:90` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/op-editor-ui/src/widgets/figma_import.rs:262— crates/op-editor-ui/src/widgets/figma_import.rs:262-270 | crates/op-editor-ui/src/widgets/icon_picker_panel.rs:300-308 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/figma_import.rs:262` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/op-editor-ui/src/widgets/figma_import.rs:350— crates/op-editor-ui/src/widgets/figma_import.rs:350-358 | crates/op-editor-ui/src/widgets/figma_import.rs:367-375 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/figma_import.rs:350` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 2) crates/op-editor-ui/src/widgets/prompt_center_panel.rs:496— crates/op-editor-ui/src/widgets/prompt_center_panel.rs:496-504 | crates/op-editor-ui/src/widgets/scene_template_panel.rs:559-567 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (9 lines × 2) crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:78— crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:78-86 | crates/op-editor-ui/src/widgets/property_panel_stroke.rs:313-321 — before extracting anything, compare `crates/op-editor-ui/src/widgets/property_panel_fill_body.rs` and `crates/op-editor-ui/src/widgets/property_panel_stroke.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:78` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/op-editor-ui/src/widgets/property_panel_input_layout.rs:73— crates/op-editor-ui/src/widgets/property_panel_input_layout.rs:73-81 | crates/op-editor-ui/src/widgets/property_panel_layout.rs:531-539 — before extracting anything, compare `crates/op-editor-ui/src/widgets/property_panel_input_layout.rs` and `crates/op-editor-ui/src/widgets/property_panel_layout.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) crates/op-editor-ui/src/widgets/property_panel_inputs.rs:236— crates/op-editor-ui/src/widgets/property_panel_inputs.rs:236-246 | crates/op-editor-ui/src/widgets/property_panel_interactions.rs:311-319 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/property_panel_inputs.rs:236` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 2) crates/op-host-desktop/src/cursor_icon.rs:35— crates/op-host-desktop/src/cursor_icon.rs:35-43 | crates/op-host-desktop/src/cursor_icon.rs:46-54 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/op-host-desktop/src/iconify_host.rs:166— crates/op-host-desktop/src/iconify_host.rs:166-174 | crates/op-host-desktop/src/iconify_host.rs:188-196 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-desktop/src/iconify_host.rs:166` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/op-host-native/src/backend/skia/gradient.rs:36— crates/op-host-native/src/backend/skia/gradient.rs:36-44 | crates/op-host-native/src/backend/skia/gradient.rs:91-99 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/op-auth-bridge/src/real_collab_ticket.rs:89— crates/op-auth-bridge/src/real_collab_ticket.rs:89-98 | crates/op-auth-bridge/src/real_collab_ticket.rs:123-132 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-auth-bridge/src/real_collab_ticket.rs:89` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:254— crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:254-266 | crates/op-chat-agent/src/chat_agent_loop/openai.rs:207-216 — before extracting anything, compare `crates/op-chat-agent/src/chat_agent_loop/anthropic.rs` and `crates/op-chat-agent/src/chat_agent_loop/openai.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 175 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:254` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 lines × 2) crates/op-chat-agent/src/design_agent_tools/root_seed.rs:310— crates/op-chat-agent/src/design_agent_tools/root_seed.rs:310-319 | crates/op-chat-agent/src/design_agent_tools/root_seed.rs:337-346 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-chat-agent/src/design_agent_tools/root_seed.rs:310` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/op-chrome-extension-core/src/design_md_palette.rs:245— crates/op-chrome-extension-core/src/design_md_palette.rs:245-254 | crates/op-host-services/src/design_md_evidence_normalize.rs:98-107 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-chrome-extension-core/src/design_md_palette.rs:245` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/op-collab-host/src/runtime/network/connection.rs:132— crates/op-collab-host/src/runtime/network/connection.rs:132-141 | crates/op-collab-host/src/runtime/network/connection.rs:302-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-collab-host/src/runtime/network/connection.rs:132` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/op-collab-relay-locator-hsm/src/server.rs:282— crates/op-collab-relay-locator-hsm/src/server.rs:282-291 | crates/op-collab-relay-locator-server/src/hsm.rs:261-270 — 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 `stream` to `&UnixStream` in one and `&std::os::unix::net::UnixStream` 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) crates/op-collab-relay-server/src/connection_reauth.rs:251— crates/op-collab-relay-server/src/connection_reauth.rs:251-260 | crates/op-collab-relay-server/src/connection_reauth.rs:295-304 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-collab-relay-server/src/connection_reauth.rs:292` calls `Some`, `Ok`, `Text` and `crates/op-collab-relay-server/src/connection_reauth.rs:250` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) crates/op-collab-smoke/src/fault_guest.rs:341— crates/op-collab-smoke/src/fault_guest.rs:341-350 | crates/op-collab-smoke/src/fault_owner.rs:397-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-collab-smoke/src/fault_guest.rs:341` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/op-collab-smoke/src/fault_transport.rs:53— crates/op-collab-smoke/src/fault_transport.rs:53-62 | crates/op-collab-smoke/src/owner.rs:84-93 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-collab-smoke/src/fault_transport.rs:53` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 2) crates/op-collab-smoke/src/fault_transport.rs:81— crates/op-collab-smoke/src/fault_transport.rs:81-90 | crates/op-collab-smoke/src/guest.rs:33-42 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) crates/op-collab-transport/src/admission.rs:142— crates/op-collab-transport/src/admission.rs:142-151 | crates/op-collab/src/protocol.rs:120-129 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-collab-transport/src/admission.rs:142` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/op-editor-core/src/color_picker_snapshot.rs:27— crates/op-editor-core/src/color_picker_snapshot.rs:27-36 | crates/op-editor-ui/src/widgets/variables_panel.rs:329-338 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) crates/op-editor-core/src/conversion.rs:203— crates/op-editor-core/src/conversion.rs:203-212 | crates/op-editor-core/src/conversion.rs:238-247 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/op-editor-core/src/conversion.rs:213` calls `base_mut`, `Some`, `to_string` and `crates/op-editor-core/src/conversion.rs:248` 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) crates/op-editor-core/src/editor_ui_state/workspace.rs:301— crates/op-editor-core/src/editor_ui_state/workspace.rs:301-312 | crates/op-editor-core/src/editor_ui_state/workspace.rs:501-510 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-editor-core/src/editor_ui_state/workspace.rs:298` calls `max` and `crates/op-editor-core/src/editor_ui_state/workspace.rs:498` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) crates/op-editor-core/src/fills/edits.rs:156— crates/op-editor-core/src/fills/edits.rs:156-165 | crates/op-editor-core/src/fills/primary.rs:154-163 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/fills/edits.rs:156` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/op-editor-core/src/icon_path_normalize.rs:489— crates/op-editor-core/src/icon_path_normalize.rs:489-498 | crates/op-editor-core/src/icon_path_normalize.rs:513-522 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/op-editor-core/src/mutators.rs:550— crates/op-editor-core/src/mutators.rs:550-559 | crates/op-editor-core/src/mutators.rs:576-585 — both copies are in the same file, so extract the 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 (10 lines × 2) crates/op-editor-ui/src/svg_export.rs:560— crates/op-editor-ui/src/svg_export.rs:560-569 | crates/op-host-native/src/backend/skia/path.rs:736-745 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_account.rs:138— crates/op-editor-ui/src/widgets/agent_settings_account.rs:138-148 | crates/op-editor-ui/src/widgets/agent_settings_account.rs:208-217 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/agent_settings_account.rs:138` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:100— crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:100-109 | crates/op-editor-ui/src/widgets/property_panel_stroke.rs:337-346 — before extracting anything, compare `crates/op-editor-ui/src/widgets/property_panel_fill_body.rs` and `crates/op-editor-ui/src/widgets/property_panel_stroke.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:100` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/op-editor-ui/src/widgets/property_panel_inputs.rs:175— crates/op-editor-ui/src/widgets/property_panel_inputs.rs:175-184 | crates/op-editor-ui/src/widgets/variables_panel/paint.rs:671-680 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/property_panel_inputs.rs:175` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/op-editor-ui/src/widgets/property_panel_sections.rs:469— crates/op-editor-ui/src/widgets/property_panel_sections.rs:469-478 | crates/op-editor-ui/src/widgets/property_panel_sections.rs:606-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 (10 lines × 2) crates/op-editor-ui/src/widgets/scene_template_card_paint.rs:248— crates/op-editor-ui/src/widgets/scene_template_card_paint.rs:248-257 | crates/op-editor-ui/src/widgets/scene_template_card_paint.rs:598-607 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/op-editor-ui/src/widgets/toolbar.rs:206— crates/op-editor-ui/src/widgets/toolbar.rs:206-215 | crates/op-editor-ui/src/widgets/toolbar.rs:250-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 `crates/op-editor-ui/src/widgets/toolbar.rs:206` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/op-engine-ffi/src/editor.rs:281— crates/op-engine-ffi/src/editor.rs:281-290 | crates/op-engine-ffi/src/editor.rs:317-326 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-engine-ffi/src/editor.rs:281` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
FileTooLong: src/op_ck_bridge.js crates/op-host-web/src/op_ck_bridge.js— FileTooLong — 1367 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units), about 85% of them inside a single declaration: opCkInit (308-1931). The bar is 500 significant lines; this is 867 over it, 2.73× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: pkg-webgl/op_host_web.js crates/op-host-web/pkg-webgl/op_host_web.js— FileTooLong — 1248 significant lines (blank, comment-only and punctuation-only lines excluded), about 79% of them inside a single declaration: __wbg_get_imports (66-1338). The bar is 500 significant lines; this is 748 over it, 2.50× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: pkg-ck/op_host_web.js crates/op-host-web/pkg-ck/op_host_web.js— FileTooLong — 910 significant lines (blank, comment-only and punctuation-only lines excluded), about 75% of them inside a single declaration: __wbg_get_imports (31-892). The bar is 500 significant lines; this is 410 over it, 1.82× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: assets/snapshot-extractor.js crates/op-html/assets/snapshot-extractor.js— FileTooLong — 754 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 254 over it, 1.51× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/fault_owner.rs crates/op-collab-smoke/src/fault_owner.rs— FileTooLong — 647 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 147 over it, 1.29× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/design_md_evidence.rs crates/op-host-services/src/design_md_evidence.rs— FileTooLong — 601 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 101 over it, 1.20× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/command_apply.rs crates/op-editor-core/src/command_apply.rs— FileTooLong — 597 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 97% of them inside a single declaration: EditorState (49-798). The bar is 500 significant lines; this is 97 over it, 1.19× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: variables_panel/paint.rs crates/op-editor-ui/src/widgets/variables_panel/paint.rs— FileTooLong — 595 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 95 over it, 1.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: agent_settings_images/paint.rs crates/op-editor-ui/src/widgets/agent_settings_images/paint.rs— FileTooLong — 594 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 94 over it, 1.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: widgets/agent_settings_builtin.rs crates/op-editor-ui/src/widgets/agent_settings_builtin.rs— FileTooLong — 591 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 91 over it, 1.18× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: widgets/property_panel_text.rs crates/op-editor-ui/src/widgets/property_panel_text.rs— FileTooLong — 590 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 90 over it, 1.18× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/runtime.rs crates/op-collab-host/src/runtime.rs— FileTooLong — 582 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 90% of them inside a single declaration: CollabRuntime (3 blocks, 72-799). The bar is 500 significant lines; this is 82 over it, 1.16× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/converters.rs crates/op-figma/src/converters.rs— FileTooLong — 580 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 80 over it, 1.16× 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: widgets/home_surface_layout.rs crates/op-editor-ui/src/widgets/home_surface_layout.rs— FileTooLong — 579 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 79 over it, 1.16× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/mapper_visual.rs crates/op-html/src/mapper_visual.rs— FileTooLong — 575 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 75 over it, 1.15× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: css/declarations.rs crates/op-html/src/css/declarations.rs— FileTooLong — 571 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 71 over it, 1.14× 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: widgets/mobile_more_panel.rs crates/op-editor-ui/src/widgets/mobile_more_panel.rs— FileTooLong — 569 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 69 over it, 1.14× 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: widgets/property_panel_dispatch.rs crates/op-editor-ui/src/widgets/property_panel_dispatch.rs— FileTooLong — 569 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 69 over it, 1.14× 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: canvaskit/backend.rs crates/op-host-web/src/canvaskit/backend.rs— FileTooLong — 568 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 96% of them inside a single declaration: CanvasKitBackend (2 blocks, 24-716). The bar is 500 significant lines; this is 68 over it, 1.14× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/binding_overlay.rs crates/op-preview-core/src/binding_overlay.rs— FileTooLong — 565 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 65 over it, 1.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: widgets/icons.rs crates/op-editor-ui/src/widgets/icons.rs— FileTooLong — 562 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 80% of them inside a single declaration: Icon (2 blocks, 33-608). The bar is 500 significant lines; this is 62 over it, 1.12× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: widgets/workspace_surface_paint.rs crates/op-editor-ui/src/widgets/workspace_surface_paint.rs— FileTooLong — 562 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 62 over it, 1.12× 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: mcp_live/design_md_route.rs crates/op-host-services/src/mcp_live/design_md_route.rs— FileTooLong — 562 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 62 over it, 1.12× 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: widgets/agent_settings_acp.rs crates/op-editor-ui/src/widgets/agent_settings_acp.rs— FileTooLong — 558 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 58 over it, 1.12× 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: widgets/property_panel_sections.rs crates/op-editor-ui/src/widgets/property_panel_sections.rs— FileTooLong — 558 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 58 over it, 1.12× 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.
Duplicated block (11 lines × 2) crates/op-ai-skills/src/style_guide/card.rs:89— crates/op-ai-skills/src/style_guide/card.rs:89-99 | crates/op-ai-skills/src/style_guide/summary.rs:65-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-ai-skills/src/style_guide/card.rs:89` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crates/op-ai-skills/src/style_guide/design_md_import.rs:349— crates/op-ai-skills/src/style_guide/design_md_import.rs:349-359 | crates/op-ai-skills/src/style_guide/token_table.rs:204-214 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-ai-skills/src/style_guide/design_md_import.rs:349` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crates/op-collab-relay-control-plane/src/pairing_wire.rs:108— crates/op-collab-relay-control-plane/src/pairing_wire.rs:108-118 | crates/op-collab-relay-control-plane/src/pairing_wire.rs:187-197 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-collab-relay-control-plane/src/pairing_wire.rs:108` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crates/op-collab-smoke/src/fault_owner.rs:53— crates/op-collab-smoke/src/fault_owner.rs:53-63 | crates/op-collab-smoke/src/fault_owner.rs:224-234 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/op-collab-smoke/src/fault_owner.rs:236` calls `with_position`, `commit_owner_edit` and `crates/op-collab-smoke/src/fault_owner.rs:65` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) crates/op-collab-transport/src/driver.rs:484— crates/op-collab-transport/src/driver.rs:484-494 | crates/op-collab-transport/src/driver.rs:556-566 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-collab-transport/src/driver.rs:484` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crates/op-editor-core/src/fills/image.rs:143— crates/op-editor-core/src/fills/image.rs:143-153 | crates/op-editor-core/src/image_node_props.rs:48-58 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/fills/image.rs:143` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crates/op-editor-core/src/fills/image.rs:158— crates/op-editor-core/src/fills/image.rs:158-168 | crates/op-editor-core/src/image_node_props.rs:62-72 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/fills/image.rs:158` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crates/op-editor-core/src/page_mutators.rs:205— crates/op-editor-core/src/page_mutators.rs:205-215 | crates/op-editor-core/src/page_mutators.rs:379-389 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/page_mutators.rs:205` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_images_parts.rs:476— crates/op-editor-ui/src/widgets/agent_settings_images_parts.rs:476-486 | crates/op-editor-ui/src/widgets/settings_form.rs:37-47 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (11 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_rows.rs:378— crates/op-editor-ui/src/widgets/agent_settings_rows.rs:378-388 | crates/op-editor-ui/src/widgets/agent_settings_rows.rs:431-441 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/agent_settings_rows.rs:378` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crates/op-editor-ui/src/widgets/ai_chat_transcript_flow.rs:150— crates/op-editor-ui/src/widgets/ai_chat_transcript_flow.rs:150-160 | crates/op-editor-ui/src/widgets/ai_chat_transcript_flow.rs:184-194 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/ai_chat_transcript_flow.rs: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.
Duplicated block (11 lines × 2) crates/op-editor-ui/src/widgets/home_surface_paint_app_preview.rs:76— crates/op-editor-ui/src/widgets/home_surface_paint_app_preview.rs:76-86 | crates/op-editor-ui/src/widgets/home_surface_paint_cards.rs:305-315 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/home_surface_paint_app_preview.rs:76` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/op-editor-ui/src/widgets/home_surface_paint_app_preview.rs:87` calls `save`, `clip_round_rect` and `crates/op-editor-ui/src/widgets/home_surface_paint_cards.rs:316` 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) crates/op-editor-ui/src/widgets/property_panel_fill_image_body.rs:52— crates/op-editor-ui/src/widgets/property_panel_fill_image_body.rs:52-62 | crates/op-editor-ui/src/widgets/property_panel_image_node.rs:191-201 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) crates/op-editor-ui/src/widgets/property_panel_flex.rs:384— crates/op-editor-ui/src/widgets/property_panel_flex.rs:384-394 | crates/op-editor-ui/src/widgets/property_panel_text.rs:724-734 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/property_panel_flex.rs:384` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crates/op-engine-ffi/src/editor_chat_design_tools.rs:86— crates/op-engine-ffi/src/editor_chat_design_tools.rs:86-96 | crates/op-host-desktop/src/chat_session.rs:583-593 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-engine-ffi/src/editor_chat_design_tools.rs:86` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crates/op-engine-ffi/src/editor_chat_turn.rs:331— crates/op-engine-ffi/src/editor_chat_turn.rs:331-341 | crates/op-host-services/src/chat_builtin_http_wire.rs:93-103 — 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) crates/op-host-desktop/src/iconify_host.rs:248— crates/op-host-desktop/src/iconify_host.rs:248-258 | crates/op-host-web/src/iconify_web.rs:415-425 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (11 lines × 2) crates/op-host-desktop/src/persistence.rs:535— crates/op-host-desktop/src/persistence.rs:535-545 | crates/op-host-desktop/src/persistence.rs:557-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 (11 lines × 2) crates/op-host-native/src/widget_host/agent_settings_touch.rs:84— crates/op-host-native/src/widget_host/agent_settings_touch.rs:84-94 | crates/op-host-native/src/widget_host/touch_panel_gesture.rs:400-410 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-native/src/widget_host/agent_settings_touch.rs:84` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/op-host-native/src/widget_host/touch_panel_gesture.rs:411` calls `Some`, `touch_panel_scroll_axis` and `crates/op-host-native/src/widget_host/agent_settings_touch.rs:95` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) crates/op-host-native/src/widget_host/mode_transition_host.rs:151— crates/op-host-native/src/widget_host/mode_transition_host.rs:151-161 | crates/op-host-web/src/widget_host/preview_slideshow.rs:103-113 — 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) crates/op-host-native/src/widget_host/variables_panel_row_press.rs:15— crates/op-host-native/src/widget_host/variables_panel_row_press.rs:15-25 | crates/op-host-web/src/widget_host/variables_panel_rows.rs:113-123 — before extracting anything, compare `crates/op-host-native/src/widget_host/variables_panel_row_press.rs` and `crates/op-host-web/src/widget_host/variables_panel_rows.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 148 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 (11 lines × 2) crates/op-host-services/src/mcp_serve/design_agent_run_tool.rs:122— crates/op-host-services/src/mcp_serve/design_agent_run_tool.rs:122-132 | crates/op-smoke/src/loop_mode.rs:199-209 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) crates/op-host-web/src/a11y_dom.rs:102— crates/op-host-web/src/a11y_dom.rs:102-112 | crates/op-host-web/src/ime_input.rs:92-102 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-web/src/a11y_dom.rs:102` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 2) crates/op-host-web/src/dom_io/html_zip_session.rs:129— crates/op-host-web/src/dom_io/html_zip_session.rs:129-139 | crates/op-host-web/src/dom_io/html_zip_session.rs:159-169 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-web/src/dom_io/html_zip_session.rs:129` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crates/op-host-web/src/dom_io/html_zip_session.rs:217— crates/op-host-web/src/dom_io/html_zip_session.rs:217-228 | crates/op-host-web/src/dom_io/html_zip_session.rs:276-286 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-web/src/dom_io/html_zip_session.rs:217` it does not close everything it opens, so those 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.
WidgetHostNative::paint (cognitive 114) crates/op-host-native/src/widget_host/paint.rs:19— WidgetHostNative::paint has cognitive complexity 114 (threshold 15). Drivers by points: if/else 62 (89 pts), boolean chains 25 (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.
WidgetHostNative::apply_text (cognitive 93) crates/op-host-native/src/widget_host/keyboard.rs:16— WidgetHostNative::apply_text has cognitive complexity 93 (threshold 15). Drivers by points: if/else 57 (84 pts), boolean chains 5, match/switch 1 (4 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHostNative::apply_backspace (cognitive 88) crates/op-host-native/src/widget_host/keyboard_delete.rs:13— WidgetHostNative::apply_backspace has cognitive complexity 88 (threshold 15). Drivers by points: if/else 57 (80 pts), boolean chains 4, match/switch 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.
WidgetHostNative::apply_press_inner (cognitive 83) crates/op-host-native/src/widget_host/press.rs:201— WidgetHostNative::apply_press_inner has cognitive complexity 83 (threshold 15). Drivers by points: if/else 45 (66 pts), boolean chains 11, match/switch 3 (6 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHostNative::cursor_move_floating_panel_tiers (cognitive 79) crates/op-host-native/src/widget_host/cursor_move_panels.rs:20— WidgetHostNative::cursor_move_floating_panel_tiers has cognitive complexity 79 (threshold 15). Drivers by points: if/else 35 (73 pts), boolean chains 6 (nesting depth added 38). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
WidgetHostNative::cursor_move_late_drag_tiers (cognitive 78) crates/op-host-native/src/widget_host/cursor_move_drags.rs:52— WidgetHostNative::cursor_move_late_drag_tiers has cognitive complexity 78 (threshold 15). Drivers by points: if/else 36 (68 pts), boolean chains 8, match/switch 1 (2 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHostNative::apply_escape (cognitive 77) crates/op-host-native/src/widget_host/keyboard_escape.rs:13— WidgetHostNative::apply_escape has cognitive complexity 77 (threshold 15). Drivers by points: if/else 64 (71 pts), boolean chains 6 (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.
WidgetHostNative::apply_send (cognitive 77) crates/op-host-native/src/widget_host/keyboard_send.rs:10— WidgetHostNative::apply_send has cognitive complexity 77 (threshold 15). Drivers by points: if/else 51 (70 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHostNative::cursor_move_property_overlay_tiers (cognitive 66) crates/op-host-native/src/widget_host/cursor_move_overlays.rs:120— WidgetHostNative::cursor_move_property_overlay_tiers has cognitive complexity 66 (threshold 15). Drivers by points: if/else 36 (44 pts), boolean chains 22 (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.
WidgetHostNative::update_agent_settings_hover (cognitive 65) crates/op-host-native/src/widget_host/geometry_settings_hover.rs:12— WidgetHostNative::update_agent_settings_hover has cognitive complexity 65 (threshold 15). Drivers by points: if/else 48, match/switch 5 (10 pts), boolean chains 7 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WidgetHostNative::dispatch_git_panel_press (cognitive 62) crates/op-host-native/src/widget_host/git_press.rs:26— WidgetHostNative::dispatch_git_panel_press has cognitive complexity 62 (threshold 15). Drivers by points: if/else 31 (58 pts), match/switch 2 (3 pts), boolean chains 1 (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.
WidgetHostNative::apply_wheel_inner (cognitive 61) crates/op-host-native/src/widget_host/scroll.rs:475— WidgetHostNative::apply_wheel_inner has cognitive complexity 61 (threshold 15). Drivers by points: if/else 37 (57 pts), boolean chains 4 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHostNative::cursor_hint (cognitive 55) crates/op-host-native/src/widget_host/cursor_hint.rs:29— WidgetHostNative::cursor_hint has cognitive complexity 55 (threshold 15). Drivers by points: if/else 33 (46 pts), boolean chains 5, match/switch 3 (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.
WidgetHostNative::apply_ime_commit (cognitive 52) crates/op-host-native/src/widget_host/ime.rs:190— WidgetHostNative::apply_ime_commit has cognitive complexity 52 (threshold 15). Drivers by points: if/else 20 (35 pts), loops 5 (9 pts), boolean chains 8 (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.
WidgetHostNative::apply_release_with_viewport_inner (cognitive 52) crates/op-host-native/src/widget_host/release.rs:37— WidgetHostNative::apply_release_with_viewport_inner has cognitive complexity 52 (threshold 15). Drivers by points: if/else 42 (48 pts), boolean chains 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.
WidgetHostNative::apply_pan_gesture (cognitive 50) crates/op-host-native/src/widget_host/scroll_pan.rs:10— WidgetHostNative::apply_pan_gesture has cognitive complexity 50 (threshold 15). Drivers by points: if/else 32 (45 pts), boolean chains 5 (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.
WidgetHostNative::cursor_move_modal_tiers (cognitive 46) crates/op-host-native/src/widget_host/cursor_move_modals.rs:13— WidgetHostNative::cursor_move_modal_tiers has cognitive complexity 46 (threshold 15). Drivers by points: if/else 23 (38 pts), boolean chains 5, match/switch 1 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHostNative::apply_release (cognitive 45) crates/op-host-native/src/widget_host/release.rs:244— WidgetHostNative::apply_release has cognitive complexity 45 (threshold 15). Drivers by points: if/else 35 (41 pts), boolean chains 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.
WidgetHostNative::apply_delete (cognitive 43) crates/op-host-native/src/widget_host/keyboard_delete.rs:289— WidgetHostNative::apply_delete has cognitive complexity 43 (threshold 15). Drivers by points: if/else 30 (40 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHostNative::cursor_move_status_align_picker_tiers (cognitive 42) crates/op-host-native/src/widget_host/cursor_move_overlays.rs:348— WidgetHostNative::cursor_move_status_align_picker_tiers has cognitive complexity 42 (threshold 15). Drivers by points: if/else 19 (33 pts), boolean chains 7, match/switch 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHostNative::apply_node_drag_cursor_move (cognitive 41) crates/op-host-native/src/widget_host/input.rs:208— WidgetHostNative::apply_node_drag_cursor_move has cognitive complexity 41 (threshold 15). Drivers by points: if/else 21 (36 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHostNative::press_home (cognitive 40) crates/op-host-native/src/widget_host/home.rs:79— WidgetHostNative::press_home has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (28 pts), match/switch 5 (10 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHostNative::apply_ime_preedit (cognitive 38) crates/op-host-native/src/widget_host/ime.rs:98— WidgetHostNative::apply_ime_preedit has cognitive complexity 38 (threshold 15). Drivers by points: if/else 21 (31 pts), boolean chains 7 (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.
WidgetHostNative::press_menu_modal_tiers (cognitive 35) crates/op-host-native/src/widget_host/press_overlay_tiers.rs:174— WidgetHostNative::press_menu_modal_tiers has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (20 pts), match/switch 3 (8 pts), boolean chains 7 (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
WidgetHostNative::press_mobile_more_sheet_tier (cognitive 33) crates/op-host-native/src/widget_host/press_chrome_tiers.rs:596— WidgetHostNative::press_mobile_more_sheet_tier has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (23 pts), match/switch 3 (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.
+ 29 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×54
Edited copy of a member (10 corresponding lines) crates/op-orchestrator/src/loop_finalize.rs:180— crates/op-orchestrator/src/loop_finalize.rs:180-189 | crates/op-orchestrator/src/role_post_pass/color_utils.rs:12-23 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/op-orchestrator/src/palette_harmonize.rs:27— crates/op-orchestrator/src/palette_harmonize.rs:27-36 | crates/op-orchestrator/src/role_post_pass/color_utils.rs:25-41 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) templates/step0/_generators/deck_sounding_navy.py:116— templates/step0/_generators/deck_sounding_navy.py:116-132 | templates/step0/_generators/deck_tidemark_slate.py:114-123 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/op-html/src/css/selectors.rs:344— crates/op-html/src/css/selectors.rs:344-353 | crates/op-html/src/css/selectors.rs:359-379 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) templates/step0/_generators/tpl_lecture_light.py:68— templates/step0/_generators/tpl_lecture_light.py:68-82 | templates/step0/_generators/tpl_toolkit_carousel.py:200-209 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/op-editor-core/src/compositing.rs:40— crates/op-editor-core/src/compositing.rs:40-49 | crates/op-pen-loader/src/layout_scene.rs:598-609 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/op-orchestrator/src/subtask_completeness_bottom_action.rs:216— crates/op-orchestrator/src/subtask_completeness_bottom_action.rs:216-228 | crates/op-orchestrator/src/subtask_completeness_semantic_items.rs:58-67 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/op-editor-host-core/src/collab/guest.rs:222— crates/op-editor-host-core/src/collab/guest.rs:222-231 | crates/op-editor-host-core/src/collab/owner.rs:278-289 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/op-host-web/src/widget_host/web_fonts.rs:5— crates/op-host-web/src/widget_host/web_fonts.rs:5-21 | crates/op-host-web/src/widget_host/web_fonts.rs:30-39 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/op-design-lint/src/node_util.rs:263— crates/op-design-lint/src/node_util.rs:263-272 | crates/op-editor-core/src/fills/access.rs:260-274 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) templates/step0/_generators/tpl_deck43_openpencil_intro.py:190— templates/step0/_generators/tpl_deck43_openpencil_intro.py:190-200 | templates/step0/_generators/tpl_deck_openpencil_intro.py:196-205 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/op-ai-skills/src/style_guide/user_registry.rs:142— crates/op-ai-skills/src/style_guide/user_registry.rs:142-152 | crates/op-editor-core/src/user_scene_templates.rs:128-137 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/op-editor-ui/src/widgets/git_panel_remotes.rs:175— crates/op-editor-ui/src/widgets/git_panel_remotes.rs:175-184 | crates/op-editor-ui/src/widgets/git_panel_remotes.rs:197-215 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/op-host-native/src/widget_host/input.rs:392— crates/op-host-native/src/widget_host/input.rs:392-406 | crates/op-host-native/src/widget_host/input.rs:408-417 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) packaging/ios/Sources/DocumentExportCoordinator.swift:192— packaging/ios/Sources/DocumentExportCoordinator.swift:192-201 | packaging/ios/Sources/DocumentSaveCoordinator.swift:378-387 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/op-collab-host/src/runtime/network/owner.rs:613— crates/op-collab-host/src/runtime/network/owner.rs:613-622 | crates/op-collab-host/src/runtime/relay.rs:624-633 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/op-figma/src/kiwi.rs:307— crates/op-figma/src/kiwi.rs:307-316 | crates/op-figma/src/kiwi.rs:320-329 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/op-editor-core/src/mutators.rs:34— crates/op-editor-core/src/mutators.rs:34-43 | crates/op-editor-core/src/mutators.rs:51-60 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/op-design-lint/src/detectors/empty_filled_panel.rs:181— crates/op-design-lint/src/detectors/empty_filled_panel.rs:181-190 | crates/op-design-lint/src/detectors/top_anchored_bars.rs:366-375 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/op-editor-core/src/command_refine.rs:64— crates/op-editor-core/src/command_refine.rs:64-78 | crates/op-editor-core/src/command_refine.rs:86-95 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/op-editor-ui/src/widgets/git_panel_clone.rs:200— crates/op-editor-ui/src/widgets/git_panel_clone.rs:200-209 | crates/op-editor-ui/src/widgets/git_panel_menus.rs:91-101 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/op-figma/src/tree.rs:225— crates/op-figma/src/tree.rs:225-236 | crates/op-figma/src/tree.rs:247-256 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/op-mcp/src/read_tools.rs:182— crates/op-mcp/src/read_tools.rs:182-191 | crates/op-mcp/src/read_tools.rs:278-290 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/op-editor-ui/src/widgets/agent_settings_press_focus.rs:83— crates/op-editor-ui/src/widgets/agent_settings_press_focus.rs:83-97 | crates/op-editor-ui/src/widgets/agent_settings_press_focus.rs:103-112 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) templates/step0/_generators/tpl_compare_pricing_tiers.py:175— templates/step0/_generators/tpl_compare_pricing_tiers.py:175-188 | templates/step0/_generators/tpl_yearreview_carousel.py:280-289 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
+ 29 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×53
Edited copy of a member (9 corresponding lines) crates/op-html/src/mapper_intrinsic.rs:169— crates/op-html/src/mapper_intrinsic.rs:169-177 | crates/op-html/src/special_image.rs:506-515 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/op-editor-ui/src/widgets/export_dialog.rs:315— crates/op-editor-ui/src/widgets/export_dialog.rs:315-323 | crates/op-editor-ui/src/widgets/save_name_dialog.rs:66-74 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/op-chat-agent/src/design_agent_diagnostics.rs:164— crates/op-chat-agent/src/design_agent_diagnostics.rs:164-172 | crates/op-design-lint/src/detectors/spacing.rs:236-244 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/op-editor-core/src/components.rs:156— crates/op-editor-core/src/components.rs:156-164 | crates/op-editor-core/src/components.rs:268-280 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/op-orchestrator/src/cleanup_mobile_chrome.rs:210— crates/op-orchestrator/src/cleanup_mobile_chrome.rs:210-218 | crates/op-orchestrator/src/cleanup_mobile_chrome.rs:583-591 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/op-collab-host/src/runtime/actor.rs:263— crates/op-collab-host/src/runtime/actor.rs:263-272 | crates/op-collab-host/src/runtime/actor.rs:274-282 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/op-host-services/src/export_html_structured/css.rs:48— crates/op-host-services/src/export_html_structured/css.rs:48-56 | crates/op-html/src/color.rs:473-486 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/op-editor-core/src/editor_ui_state/home.rs:660— crates/op-editor-core/src/editor_ui_state/home.rs:660-668 | crates/op-editor-core/src/editor_ui_state/home.rs:670-678 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/op-cli/src/page_theme_cli.rs:61— crates/op-cli/src/page_theme_cli.rs:61-69 | crates/op-cli/src/page_theme_cli.rs:71-79 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/op-codegen/src/codegen_tailwind_shadcn.rs:149— crates/op-codegen/src/codegen_tailwind_shadcn.rs:149-157 | crates/op-orchestrator/src/source_facts.rs:130-138 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/op-collab/src/typed_images.rs:180— crates/op-collab/src/typed_images.rs:180-189 | crates/op-pen-loader/src/layout_repair.rs:766-774 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/op-editor-core/src/screen_sets.rs:167— crates/op-editor-core/src/screen_sets.rs:167-175 | crates/op-html/src/css/cascade_shared.rs:118-131 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/op-collab-relay-locator-hsm/src/server.rs:309— crates/op-collab-relay-locator-hsm/src/server.rs:309-317 | crates/op-collab-relay-locator-server/src/hsm.rs:294-304 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/op-host-native/src/widget_host/variables_preset_press.rs:89— crates/op-host-native/src/widget_host/variables_preset_press.rs:89-97 | crates/op-host-web/src/widget_host/variables_preset_press.rs:66-74 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/op-host-services/src/web_canvas_server/connect_routes.rs:101— crates/op-host-services/src/web_canvas_server/connect_routes.rs:101-109 | crates/op-host-services/src/web_canvas_server/export_routes.rs:128-139 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/op-orchestrator/src/map_placeholder.rs:185— crates/op-orchestrator/src/map_placeholder.rs:185-200 | crates/op-orchestrator/src/map_placeholder.rs:218-226 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/op-editor-core/src/host_keyboard_transitions.rs:60— crates/op-editor-core/src/host_keyboard_transitions.rs:60-68 | crates/op-editor-core/src/host_keyboard_transitions.rs:71-79 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/op-editor-ui/src/widgets/home_surface.rs:97— crates/op-editor-ui/src/widgets/home_surface.rs:97-106 | crates/op-editor-ui/src/widgets/workspace_surface.rs:97-105 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/op-orchestrator/src/orchestration_self_check.rs:594— crates/op-orchestrator/src/orchestration_self_check.rs:594-602 | crates/op-orchestrator/src/role_post_pass/mobile_category_row.rs:40-50 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/op-editor-host-core/src/collab/guest.rs:150— crates/op-editor-host-core/src/collab/guest.rs:150-158 | crates/op-editor-host-core/src/collab/guest.rs:166-174 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/op-engine-ffi/src/editor_chat_design.rs:74— crates/op-engine-ffi/src/editor_chat_design.rs:74-82 | crates/op-host-desktop/src/chat_session_launch_design.rs:97-105 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/op-editor-core/src/collab_owner_confirm_ui.rs:174— crates/op-editor-core/src/collab_owner_confirm_ui.rs:174-182 | crates/op-editor-core/src/collab_owner_confirm_ui.rs:184-192 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/op-editor-ui/src/widgets/top_bar_geometry.rs:19— crates/op-editor-ui/src/widgets/top_bar_geometry.rs:19-34 | crates/op-editor-ui/src/widgets/top_bar_geometry.rs:36-44 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/op-figma/src/node_mapper.rs:94— crates/op-figma/src/node_mapper.rs:94-102 | crates/op-figma/src/node_mapper.rs:163-171 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/op-editor-ui/src/widgets/git_panel_tracked_picker.rs:82— crates/op-editor-ui/src/widgets/git_panel_tracked_picker.rs:82-90 | crates/op-editor-ui/src/widgets/slides_panel_actions.rs:181-190 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (5 lines × 2) crates/op-collab-relay-server/src/server.rs:135— crates/op-collab-relay-server/src/server.rs:135-139 | crates/op-host-services/src/mcp_live/connection.rs:61-65 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) crates/op-design-lint/src/detectors/spacing.rs:186— crates/op-design-lint/src/detectors/spacing.rs:186-192 | crates/op-orchestrator/src/mobile_content_rail_detect.rs:184-188 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-design-lint/src/detectors/spacing.rs:186` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 2) crates/op-editor-core/src/color_picker.rs:479— crates/op-editor-core/src/color_picker.rs:479-483 | crates/op-editor-core/src/color_picker.rs:485-489 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/color_picker.rs:479` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/op-editor-core/src/conversion.rs:91— crates/op-editor-core/src/conversion.rs:91-95 | crates/op-editor-core/src/conversion.rs:161-165 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/op-editor-core/src/icon_path_normalize.rs:371— crates/op-editor-core/src/icon_path_normalize.rs:371-375 | crates/op-editor-core/src/icon_path_normalize.rs:391-395 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/icon_path_normalize.rs:371` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (5 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_acp.rs:551— crates/op-editor-ui/src/widgets/agent_settings_acp.rs:551-555 | crates/op-editor-ui/src/widgets/agent_settings_press_focus.rs:119-123 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) crates/op-editor-ui/src/widgets/missing_fonts_flow.rs:58— crates/op-editor-ui/src/widgets/missing_fonts_flow.rs:58-62 | crates/op-host-native/src/widget_host/font_picker_dispatch.rs:402-406 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/missing_fonts_flow.rs:58` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/op-editor-ui/src/widgets/property_panel.rs:425— crates/op-editor-ui/src/widgets/property_panel.rs:425-429 | crates/op-editor-ui/src/widgets/property_panel.rs:472-476 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/property_panel.rs:425` it begins part-way through the construct above it, so those 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 (5 lines × 2) crates/op-engine-jni/src/callbacks.rs:104— crates/op-engine-jni/src/callbacks.rs:104-111 | crates/op-engine-jni/src/callbacks.rs:133-137 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-engine-jni/src/callbacks.rs:104` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (5 lines × 2) crates/op-host-desktop/src/chat_session_launch_design.rs:205— crates/op-host-desktop/src/chat_session_launch_design.rs:205-210 | crates/op-host-desktop/src/chat_session_launch_providers.rs:133-137 — 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 that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 2) crates/op-host-services/src/mcp_live/connection.rs:64— crates/op-host-services/src/mcp_live/connection.rs:64-68 | crates/op-host-services/src/web_canvas_server/online_run_loop.rs:236-240 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) crates/op-html/src/color.rs:188— crates/op-html/src/color.rs:188-192 | crates/op-html/src/color.rs:199-203 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/op-html/src/color.rs:210— crates/op-html/src/color.rs:210-214 | crates/op-html/src/color.rs:221-225 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/op-orchestrator/src/cleanup_fixed_mobile_rail.rs:172— crates/op-orchestrator/src/cleanup_fixed_mobile_rail.rs:172-176 | crates/op-orchestrator/src/cleanup_fixed_mobile_rail.rs:178-182 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-orchestrator/src/cleanup_fixed_mobile_rail.rs:172` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/op-orchestrator/src/geometry_compact_status.rs:203— crates/op-orchestrator/src/geometry_compact_status.rs:203-207 | crates/op-orchestrator/src/geometry_overflow_fixes.rs:154-158 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) crates/op-pen-loader/src/lib.rs:166— crates/op-pen-loader/src/lib.rs:166-172 | crates/op-pen-loader/src/variables.rs:211-215 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-pen-loader/src/lib.rs:166` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/op-editor-ui/src/widgets/canvas_viewport_overlay.rs:262— crates/op-editor-ui/src/widgets/canvas_viewport_overlay.rs:262-266 | crates/op-editor-ui/src/widgets/property_panel_corner.rs:67-71 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) crates/op-host-native/src/backend/skia/path.rs:703— crates/op-host-native/src/backend/skia/path.rs:703-707 | crates/op-host-native/src/widget_host/auth_flow.rs:318-322 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) crates/op-host-native/src/widget_host/preview_slideshow.rs:119— crates/op-host-native/src/widget_host/preview_slideshow.rs:119-123 | crates/op-host-web/src/widget_host/preview_slideshow.rs:275-279 — before extracting anything, compare `crates/op-host-native/src/widget_host/preview_slideshow.rs` and `crates/op-host-web/src/widget_host/preview_slideshow.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 171 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 (5 lines × 2) crates/op-host-web/src/dom_io/html_directory_session.rs:485— crates/op-host-web/src/dom_io/html_directory_session.rs:485-489 | crates/op-html/src/project.rs:270-274 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) crates/op-html/src/project_zip.rs:356— crates/op-html/src/project_zip.rs:356-360 | crates/op-html/src/zip_encoding.rs:133-137 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) crates/op-html/src/project_zip.rs:362— crates/op-html/src/project_zip.rs:362-366 | crates/op-html/src/zip_encoding.rs:139-143 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) crates/op-orchestrator/src/app_shell_detect.rs:7— crates/op-orchestrator/src/app_shell_detect.rs:7-12 | crates/op-orchestrator/src/table_repair.rs:57-61 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) crates/op-orchestrator/src/card_inner_padding.rs:299— crates/op-orchestrator/src/card_inner_padding.rs:299-303 | crates/op-orchestrator/src/touch_target_floor.rs:227-231 — before extracting anything, compare `crates/op-orchestrator/src/card_inner_padding.rs` and `crates/op-orchestrator/src/touch_target_floor.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) crates/op-orchestrator/src/cleanup_desktop_dashboard.rs:170— crates/op-orchestrator/src/cleanup_desktop_dashboard.rs:170-174 | crates/op-orchestrator/src/cleanup_mobile_dense.rs:190-194 — before extracting anything, compare `crates/op-orchestrator/src/cleanup_desktop_dashboard.rs` and `crates/op-orchestrator/src/cleanup_mobile_dense.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
op_editor_ui::widgets::canvas_viewport_paint::paint_node_inner (cyclomatic 103) crates/op-editor-ui/src/widgets/canvas_viewport_paint.rs:118— op_editor_ui::widgets::canvas_viewport_paint::paint_node_inner has cyclomatic complexity 103 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_editor_ui::widgets::property_panel_dispatch::apply_property_action (cyclomatic 99) crates/op-editor-ui/src/widgets/property_panel_dispatch.rs:186— op_editor_ui::widgets::property_panel_dispatch::apply_property_action has cyclomatic complexity 99 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_editor_ui::widgets::agent_settings_press_entries::apply_entry_hit (cyclomatic 72) crates/op-editor-ui/src/widgets/agent_settings_press_entries.rs:21— op_editor_ui::widgets::agent_settings_press_entries::apply_entry_hit has cyclomatic complexity 72 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_editor_ui::widgets::agent_settings_builtin::hit_test_with_touch (cyclomatic 54) crates/op-editor-ui/src/widgets/agent_settings_builtin.rs:123— op_editor_ui::widgets::agent_settings_builtin::hit_test_with_touch has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_editor_ui::widgets::chat_click_flow::apply_chat_hit (cyclomatic 50) crates/op-editor-ui/src/widgets/chat_click_flow.rs:85— op_editor_ui::widgets::chat_click_flow::apply_chat_hit has cyclomatic complexity 50 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_editor_ui::widgets::property_panel_input_layout::editable_input_rects (cyclomatic 40) crates/op-editor-ui/src/widgets/property_panel_input_layout.rs:53— op_editor_ui::widgets::property_panel_input_layout::editable_input_rects 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.
op_editor_ui::widgets::ai_chat_transcript::build_item (cyclomatic 37) crates/op-editor-ui/src/widgets/ai_chat_transcript.rs:179— op_editor_ui::widgets::ai_chat_transcript::build_item has cyclomatic complexity 37 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
op_editor_ui::widgets::property_panel_layout::action_button_rects_with_fill_picker (cyclomatic 37) crates/op-editor-ui/src/widgets/property_panel_layout.rs:213— op_editor_ui::widgets::property_panel_layout::action_button_rects_with_fill_picker 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.
op_editor_ui::widgets::canvas_viewport_image::paint_image_node_with_stroke (cyclomatic 31) crates/op-editor-ui/src/widgets/canvas_viewport_image.rs:409— op_editor_ui::widgets::canvas_viewport_image::paint_image_node_with_stroke 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.
op_editor_ui::svg_export::emit_node (cyclomatic 29) crates/op-editor-ui/src/svg_export.rs:330— op_editor_ui::svg_export::emit_node 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.
op_editor_ui::widgets::agent_settings_builtin_form::paint_field (cyclomatic 29) crates/op-editor-ui/src/widgets/agent_settings_builtin_form.rs:222— op_editor_ui::widgets::agent_settings_builtin_form::paint_field 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.
op_editor_ui::widgets::agent_settings_press_flow::apply_agent_settings_hit (cyclomatic 29) crates/op-editor-ui/src/widgets/agent_settings_press_flow.rs:109— op_editor_ui::widgets::agent_settings_press_flow::apply_agent_settings_hit has cyclomatic complexity 29 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_editor_ui::widgets::layer_context_flow::apply_layer_context_ids (cyclomatic 29) crates/op-editor-ui/src/widgets/layer_context_flow.rs:75— op_editor_ui::widgets::layer_context_flow::apply_layer_context_ids 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.
op_editor_ui::widgets::property_panel_commit::commit_property_focus (cyclomatic 28) crates/op-editor-ui/src/widgets/property_panel_commit.rs:284— op_editor_ui::widgets::property_panel_commit::commit_property_focus 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. This is NOT this file's highest cyclomatic complexity: op_editor_ui::widgets::property_panel_commit::property_focus_initial (cyclomatic 42) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
op_editor_ui::widgets::scene_template_press_flow::press_scene_template_center (cyclomatic 27) crates/op-editor-ui/src/widgets/scene_template_press_flow.rs:26— op_editor_ui::widgets::scene_template_press_flow::press_scene_template_center has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_editor_ui::widgets::ai_chat_panel_footer::paint_bottom_toolbar (cyclomatic 26) crates/op-editor-ui/src/widgets/ai_chat_panel_footer.rs:355— op_editor_ui::widgets::ai_chat_panel_footer::paint_bottom_toolbar 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.
op_editor_ui::widgets::home_surface_copy::task_copy (cyclomatic 26) crates/op-editor-ui/src/widgets/home_surface_copy.rs:30— op_editor_ui::widgets::home_surface_copy::task_copy 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.
op_editor_ui::widgets::home_surface_paint_panels::paint_composer (cyclomatic 25) crates/op-editor-ui/src/widgets/home_surface_paint_panels.rs:25— op_editor_ui::widgets::home_surface_paint_panels::paint_composer 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.
op_editor_ui::widgets::property_panel_typography_paint::paint_font_picker_layout (cyclomatic 25) crates/op-editor-ui/src/widgets/property_panel_typography_paint.rs:151— op_editor_ui::widgets::property_panel_typography_paint::paint_font_picker_layout 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.
op_editor_ui::widgets::canvas_viewport_layer_bounds::subtree_visual_bounds (cyclomatic 24) crates/op-editor-ui/src/widgets/canvas_viewport_layer_bounds.rs:99— op_editor_ui::widgets::canvas_viewport_layer_bounds::subtree_visual_bounds 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.
op_editor_ui::widgets::canvas_viewport_text::paint_text_node (cyclomatic 24) crates/op-editor-ui/src/widgets/canvas_viewport_text.rs:278— op_editor_ui::widgets::canvas_viewport_text::paint_text_node 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.
op_editor_ui::widgets::collab_ui::panel_session_or_pre_auth (cyclomatic 24) crates/op-editor-ui/src/widgets/collab_ui.rs:215— op_editor_ui::widgets::collab_ui::panel_session_or_pre_auth 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.
op_editor_ui::widgets::agent_settings_panel_card::paint_agent_card (cyclomatic 22) crates/op-editor-ui/src/widgets/agent_settings_panel_card.rs:33— op_editor_ui::widgets::agent_settings_panel_card::paint_agent_card 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.
op_editor_ui::widgets::ai_chat_transcript::paint_transcript_with_selection (cyclomatic 22) crates/op-editor-ui/src/widgets/ai_chat_transcript.rs:609— op_editor_ui::widgets::ai_chat_transcript::paint_transcript_with_selection 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.
op_editor_ui::widgets::ai_chat_transcript_hit::transcript_hit (cyclomatic 22) crates/op-editor-ui/src/widgets/ai_chat_transcript_hit.rs:22— op_editor_ui::widgets::ai_chat_transcript_hit::transcript_hit 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.
op_html::mapper_margin::finish_children (cognitive 50) crates/op-html/src/mapper_margin.rs:166— op_html::mapper_margin::finish_children has cognitive complexity 50 (threshold 15). Drivers by points: if/else 20 (40 pts), loops 6 (7 pts), boolean chains 3 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_html::css::declarations::expand_background (cognitive 39) crates/op-html/src/css/declarations.rs:359— op_html::css::declarations::expand_background has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (30 pts), loops 4 (6 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.
op_html::text::normalize_segments (cognitive 38) crates/op-html/src/text.rs:359— op_html::text::normalize_segments has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (32 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_html::srcset::parse_srcset (cognitive 35) crates/op-html/src/srcset.rs:188— op_html::srcset::parse_srcset has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 4 (8 pts), match/switch 1 (4 pts), boolean chains 3 (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.
op_html::mapper_visual::map_gradient (cognitive 32) crates/op-html/src/mapper_visual.rs:307— op_html::mapper_visual::map_gradient has cognitive complexity 32 (threshold 15). Drivers by points: if/else 22 (31 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.
op_html::mapper_grid::wrap_grid_rows (cognitive 31) crates/op-html/src/mapper_grid.rs:27— op_html::mapper_grid::wrap_grid_rows has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (23 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_html::resources_css_urls::unescape_css (cognitive 31) crates/op-html/src/resources_css_urls.rs:213— op_html::resources_css_urls::unescape_css has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_html::mapper_visual::map_fill (cognitive 29) crates/op-html/src/mapper_visual.rs:35— op_html::mapper_visual::map_fill has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (26 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.
op_html::project_zip_range::parse_html_zip_central_directory (cognitive 29) crates/op-html/src/project_zip_range.rs:160— op_html::project_zip_range::parse_html_zip_central_directory has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 6, 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.
op_html::html_encoding::encoding_from_meta_attributes (cognitive 27) crates/op-html/src/html_encoding.rs:73— op_html::html_encoding::encoding_from_meta_attributes has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 4 (8 pts), boolean chains 6 (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.
op_html::text_children::map_dom_children (cognitive 27) crates/op-html/src/text_children.rs:120— op_html::text_children::map_dom_children has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_html::css::cascade::compute_raw (cognitive 26) crates/op-html/src/css/cascade.rs:392— op_html::css::cascade::compute_raw has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 4 (5 pts), match/switch 2 (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.
op_html::mapper_visual::map_filter (cognitive 24) crates/op-html/src/mapper_visual.rs:534— op_html::mapper_visual::map_filter has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (23 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.
op_html::srcset::pick_from_picture (cognitive 24) crates/op-html/src/srcset.rs:85— op_html::srcset::pick_from_picture has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (3 pts), match/switch 1 (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.
op_html::css::declaration_syntax::split_whitespace_top_level (cognitive 23) crates/op-html/src/css/declaration_syntax.rs:215— op_html::css::declaration_syntax::split_whitespace_top_level has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 2, match/switch 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.
op_html::mapper_grid::resolved_track_widths (cognitive 23) crates/op-html/src/mapper_grid.rs:196— op_html::mapper_grid::resolved_track_widths has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (4 pts), match/switch 3 (4 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.
op_html::resources_css_imports::expand_inner (cognitive 22) crates/op-html/src/resources_css_imports.rs:41— op_html::resources_css_imports::expand_inner has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (20 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.
op_html::transform::split_functions (cognitive 22) crates/op-html/src/transform.rs:318— op_html::transform::split_functions has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_html::html_encoding::extract_charset_from_content (cognitive 21) crates/op-html/src/html_encoding.rs:153— op_html::html_encoding::extract_charset_from_content has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (7 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_html::mapper_grid::expand_fixed_tracks (cognitive 21) crates/op-html/src/mapper_grid.rs:412— op_html::mapper_grid::expand_fixed_tracks has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (4 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.
op_html::special_image::parent_content_box (cognitive 21) crates/op-html/src/special_image.rs:354— op_html::special_image::parent_content_box has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, match/switch 2 (4 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_html::css::cascade_parser::strip_comments (cognitive 20) crates/op-html/src/css/cascade_parser.rs:349— op_html::css::cascade_parser::strip_comments has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (4 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.
op_html::css::cascade_shared::split_top_level (cognitive 20) crates/op-html/src/css/cascade_shared.rs:75— op_html::css::cascade_shared::split_top_level has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 1 (3 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.
op_html::mapper_grid::top_level_tokens (cognitive 20) crates/op-html/src/mapper_grid.rs:518— op_html::mapper_grid::top_level_tokens has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_html::resources_css_urls::rebase_stylesheet_urls (cognitive 20) crates/op-html/src/resources_css_urls.rs:8— op_html::resources_css_urls::rebase_stylesheet_urls has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
+ 22 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (8 corresponding lines) · ×47
Edited copy of a member (8 corresponding lines) crates/op-editor-ui/src/scene_bounds.rs:72— crates/op-editor-ui/src/scene_bounds.rs:72-79 | crates/op-editor-ui/src/svg_export/transform.rs:165-172 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/op-chat-agent/src/design_agent_tools/quality_scans.rs:197— crates/op-chat-agent/src/design_agent_tools/quality_scans.rs:197-204 | crates/op-orchestrator/src/validation_fixes_apply.rs:594-603 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/op-orchestrator/src/cleanup_container_geometry.rs:192— crates/op-orchestrator/src/cleanup_container_geometry.rs:192-199 | crates/op-orchestrator/src/cleanup_mobile_dense.rs:214-221 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) templates/step0/_generators/tpl_deck43_openpencil_intro.py:178— templates/step0/_generators/tpl_deck43_openpencil_intro.py:178-185 | templates/step0/_generators/tpl_deck43_openpencil_intro.py:204-211 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/op-editor-ui/src/widgets/ai_chat_panel.rs:519— crates/op-editor-ui/src/widgets/ai_chat_panel.rs:519-527 | crates/op-editor-ui/src/widgets/figma_import.rs:164-171 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/op-orchestrator/src/orchestration_self_check.rs:512— crates/op-orchestrator/src/orchestration_self_check.rs:512-519 | crates/op-orchestrator/src/table_repair_gap_budget.rs:37-44 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/op-design-lint/src/detectors/siblings.rs:517— crates/op-design-lint/src/detectors/siblings.rs:517-524 | crates/op-orchestrator/src/mobile_reflow.rs:374-383 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/op-editor-ui/src/widgets/canvas_viewport_image/svg_raster.rs:57— crates/op-editor-ui/src/widgets/canvas_viewport_image/svg_raster.rs:57-64 | crates/op-host-desktop/src/remote_image_host.rs:186-193 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/op-host-desktop/src/figma_import_session.rs:584— crates/op-host-desktop/src/figma_import_session.rs:584-591 | crates/op-host-desktop/src/persistence.rs:632-643 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/op-git/src/merge.rs:129— crates/op-git/src/merge.rs:129-141 | crates/op-git/src/merge.rs:516-523 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/op-design-lint/src/detectors/slop.rs:57— crates/op-design-lint/src/detectors/slop.rs:57-70 | crates/op-design-lint/src/detectors/typography.rs:155-162 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/op-host-services/src/web_canvas_server/tenant_auth.rs:292— crates/op-host-services/src/web_canvas_server/tenant_auth.rs:292-299 | crates/op-host-services/src/web_canvas_server/tenant_auth.rs:302-312 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/op-editor-ui/src/widgets/figma_import.rs:86— crates/op-editor-ui/src/widgets/figma_import.rs:86-98 | crates/op-editor-ui/src/widgets/figma_import_progress.rs:41-48 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/op-editor-ui/src/widgets/property_panel_layout_ops.rs:228— crates/op-editor-ui/src/widgets/property_panel_layout_ops.rs:228-235 | crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:213-220 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/op-mcp/src/batch_page.rs:7— crates/op-mcp/src/batch_page.rs:7-14 | crates/op-mcp/src/reparent_tools.rs:152-159 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/op-host-web/src/web_clipboard.rs:57— crates/op-host-web/src/web_clipboard.rs:57-64 | crates/op-host-web/src/web_clipboard.rs:66-73 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/op-chat-agent/src/design_agent_tools/root_seed.rs:368— crates/op-chat-agent/src/design_agent_tools/root_seed.rs:368-375 | crates/op-orchestrator/src/finalize_enforce_status_bar.rs:302-309 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/op-design-lint/src/node_util.rs:582— crates/op-design-lint/src/node_util.rs:582-589 | crates/op-orchestrator/src/validation_dump.rs:326-333 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:63— crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:63-70 | crates/op-orchestrator/src/validation_dump.rs:299-306 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/op-host-web/src/dom_io.rs:541— crates/op-host-web/src/dom_io.rs:541-548 | crates/op-host-web/src/web_design_md.rs:235-249 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/op-cli/src/codegen_cli.rs:155— crates/op-cli/src/codegen_cli.rs:155-163 | crates/op-cli/src/command_mappers.rs:397-404 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/op-collab-relay-protocol/src/invite.rs:104— crates/op-collab-relay-protocol/src/invite.rs:104-112 | crates/op-collab-relay-protocol/src/locator.rs:285-292 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/op-mcp/src/insert_node_args.rs:184— crates/op-mcp/src/insert_node_args.rs:184-191 | crates/op-mcp/src/write_tools.rs:406-413 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/op-editor-ui/src/widgets/missing_fonts_panel.rs:218— crates/op-editor-ui/src/widgets/missing_fonts_panel.rs:218-226 | crates/op-editor-ui/src/widgets/works_reader_paint.rs:270-277 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/op-collab-host/src/runtime/relay_bootstrap.rs:651— crates/op-collab-host/src/runtime/relay_bootstrap.rs:651-658 | crates/op-collab-host/src/runtime/relay_bootstrap.rs:660-669 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
WidgetHostNative::dispatch_git_panel_press (cyclomatic 99) crates/op-host-native/src/widget_host/git_press.rs:26— WidgetHostNative::dispatch_git_panel_press has cyclomatic complexity 99 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
WidgetHostNative::paint (cyclomatic 86) crates/op-host-native/src/widget_host/paint.rs:19— WidgetHostNative::paint has cyclomatic complexity 86 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WidgetHostNative::apply_escape (cyclomatic 71) crates/op-host-native/src/widget_host/keyboard_escape.rs:13— WidgetHostNative::apply_escape has cyclomatic complexity 71 (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.
WidgetHostNative::apply_text (cyclomatic 64) crates/op-host-native/src/widget_host/keyboard.rs:16— WidgetHostNative::apply_text has cyclomatic complexity 64 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WidgetHostNative::apply_backspace (cyclomatic 63) crates/op-host-native/src/widget_host/keyboard_delete.rs:13— WidgetHostNative::apply_backspace has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WidgetHostNative::apply_press_inner (cyclomatic 60) crates/op-host-native/src/widget_host/press.rs:201— WidgetHostNative::apply_press_inner has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WidgetHostNative::apply_send (cyclomatic 57) crates/op-host-native/src/widget_host/keyboard_send.rs:10— WidgetHostNative::apply_send has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WidgetHostNative::press_home (cyclomatic 55) crates/op-host-native/src/widget_host/home.rs:79— WidgetHostNative::press_home has cyclomatic complexity 55 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
WidgetHostNative::update_agent_settings_hover (cyclomatic 52) crates/op-host-native/src/widget_host/geometry_settings_hover.rs:12— WidgetHostNative::update_agent_settings_hover has cyclomatic complexity 52 (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.
WidgetHostNative::cursor_move_property_overlay_tiers (cyclomatic 51) crates/op-host-native/src/widget_host/cursor_move_overlays.rs:120— WidgetHostNative::cursor_move_property_overlay_tiers has cyclomatic complexity 51 (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.
WidgetHostNative::apply_release_with_viewport_inner (cyclomatic 46) crates/op-host-native/src/widget_host/release.rs:37— WidgetHostNative::apply_release_with_viewport_inner has cyclomatic complexity 46 (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.
WidgetHostNative::cursor_hint (cyclomatic 45) crates/op-host-native/src/widget_host/cursor_hint.rs:29— WidgetHostNative::cursor_hint has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WidgetHostNative::cursor_move_late_drag_tiers (cyclomatic 45) crates/op-host-native/src/widget_host/cursor_move_drags.rs:52— WidgetHostNative::cursor_move_late_drag_tiers has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WidgetHostNative::cursor_move_floating_panel_tiers (cyclomatic 42) crates/op-host-native/src/widget_host/cursor_move_panels.rs:20— WidgetHostNative::cursor_move_floating_panel_tiers 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.
WidgetHostNative::apply_release (cyclomatic 39) crates/op-host-native/src/widget_host/release.rs:244— WidgetHostNative::apply_release has cyclomatic complexity 39 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WidgetHostNative::apply_wheel_inner (cyclomatic 38) crates/op-host-native/src/widget_host/scroll.rs:475— WidgetHostNative::apply_wheel_inner 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.
WidgetHostNative::apply_pan_gesture (cyclomatic 35) crates/op-host-native/src/widget_host/scroll_pan.rs:10— WidgetHostNative::apply_pan_gesture has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WidgetHostNative::apply_delete (cyclomatic 34) crates/op-host-native/src/widget_host/keyboard_delete.rs:289— WidgetHostNative::apply_delete 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.
WidgetHostNative::apply_ime_commit (cyclomatic 33) crates/op-host-native/src/widget_host/ime.rs:190— WidgetHostNative::apply_ime_commit 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.
WidgetHostNative::run_workspace_action (cyclomatic 30) crates/op-host-native/src/widget_host/workspace.rs:124— WidgetHostNative::run_workspace_action has cyclomatic complexity 30 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
WidgetHostNative::cursor_move_modal_tiers (cyclomatic 29) crates/op-host-native/src/widget_host/cursor_move_modals.rs:13— WidgetHostNative::cursor_move_modal_tiers 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.
WidgetHostNative::press_mobile_more_sheet_tier (cyclomatic 29) crates/op-host-native/src/widget_host/press_chrome_tiers.rs:596— WidgetHostNative::press_mobile_more_sheet_tier 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.
WidgetHostNative::press_menu_modal_tiers (cyclomatic 28) crates/op-host-native/src/widget_host/press_overlay_tiers.rs:174— WidgetHostNative::press_menu_modal_tiers 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.
WidgetHostNative::apply_ime_preedit (cyclomatic 27) crates/op-host-native/src/widget_host/ime.rs:98— WidgetHostNative::apply_ime_preedit has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WidgetHostNative::press_property_overlay_tiers (cyclomatic 26) crates/op-host-native/src/widget_host/press_property_tiers.rs:18— WidgetHostNative::press_property_overlay_tiers has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Duplicated block (12 lines × 2) crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:317— crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:317-328 | crates/op-chat-agent/src/chat_agent_loop/openai.rs:259-270 — before extracting anything, compare `crates/op-chat-agent/src/chat_agent_loop/anthropic.rs` and `crates/op-chat-agent/src/chat_agent_loop/openai.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 175 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:317` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/op-collab-relay-locator-server/src/http.rs:447— crates/op-collab-relay-locator-server/src/http.rs:447-458 | crates/op-collab-relay-locator-server/src/http.rs:517-528 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-collab-relay-locator-server/src/http.rs:447` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/op-collab-smoke/src/fault_guest.rs:62— crates/op-collab-smoke/src/fault_guest.rs:62-73 | crates/op-collab-smoke/src/fault_guest.rs:137-148 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-collab-smoke/src/fault_guest.rs:62` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 2) crates/op-collab/src/codec.rs:244— crates/op-collab/src/codec.rs:244-255 | crates/op-collab/src/codec.rs:363-374 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-collab/src/codec.rs:244` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/op-collab/src/guest_pending.rs:328— crates/op-collab/src/guest_pending.rs:328-339 | crates/op-collab/src/reapply.rs:60-71 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-collab/src/guest_pending.rs:328` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/op-editor-core/src/command_style_replace.rs:275— crates/op-editor-core/src/command_style_replace.rs:275-286 | crates/op-editor-core/src/command_style_replace.rs:297-308 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 2) crates/op-editor-core/src/host_preset_name_draft.rs:47— crates/op-editor-core/src/host_preset_name_draft.rs:47-58 | crates/op-editor-core/src/host_preset_name_draft.rs:72-83 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/op-editor-core/src/svg_import/nodes.rs:131— crates/op-editor-core/src/svg_import/nodes.rs:131-142 | crates/op-editor-core/src/svg_import/nodes.rs:146-157 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/svg_import/nodes.rs:131` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_account.rs:182— crates/op-editor-ui/src/widgets/agent_settings_account.rs:182-193 | crates/op-editor-ui/src/widgets/top_bar_paint.rs:651-662 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/agent_settings_account.rs:182` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_builtin.rs:197— crates/op-editor-ui/src/widgets/agent_settings_builtin.rs:197-208 | crates/op-editor-ui/src/widgets/agent_settings_builtin.rs:289-300 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/agent_settings_builtin.rs:197` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) crates/op-editor-ui/src/widgets/agent_settings_panel/layout.rs:132— crates/op-editor-ui/src/widgets/agent_settings_panel/layout.rs:132-143 | crates/op-editor-ui/src/widgets/agent_settings_panel/layout.rs:169-180 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/agent_settings_panel/layout.rs:132` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/op-editor-ui/src/widgets/ai_chat_transcript_steps.rs:139— crates/op-editor-ui/src/widgets/ai_chat_transcript_steps.rs:139-150 | crates/op-editor-ui/src/widgets/ai_chat_transcript_steps.rs:177-188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/ai_chat_transcript_steps.rs:139` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) crates/op-editor-ui/src/widgets/collab_panel.rs:498— crates/op-editor-ui/src/widgets/collab_panel.rs:498-509 | crates/op-editor-ui/src/widgets/collab_panel.rs:553-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/collab_panel.rs:498` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/op-editor-ui/src/widgets/figma_import.rs:344— crates/op-editor-ui/src/widgets/figma_import.rs:344-355 | crates/op-editor-ui/src/widgets/figma_import_progress.rs:111-122 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/figma_import.rs:344` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/op-editor-ui/src/widgets/property_panel_color_variables.rs:167— crates/op-editor-ui/src/widgets/property_panel_color_variables.rs:167-178 | crates/op-editor-ui/src/widgets/property_panel_typography.rs:418-429 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 2) crates/op-editor-ui/src/widgets/property_panel_inputs.rs:402— crates/op-editor-ui/src/widgets/property_panel_inputs.rs:402-413 | crates/op-editor-ui/src/widgets/property_panel_inputs.rs:534-545 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/property_panel_inputs.rs:402` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-editor-ui/src/widgets/property_panel_inputs.rs:530` calls `Some` and `crates/op-editor-ui/src/widgets/property_panel_inputs.rs:401` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 2) crates/op-editor-ui/src/widgets/property_panel_text.rs:632— crates/op-editor-ui/src/widgets/property_panel_text.rs:632-643 | crates/op-editor-ui/src/widgets/property_panel_text.rs:729-740 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/property_panel_text.rs:632` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/op-figma/src/boolean_fallback.rs:75— crates/op-figma/src/boolean_fallback.rs:75-86 | crates/op-figma/src/boolean_fallback.rs:140-151 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-figma/src/boolean_fallback.rs:75` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/op-figma/src/tree.rs:54— crates/op-figma/src/tree.rs:54-65 | crates/op-figma/src/tree.rs:75-86 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-figma/src/tree.rs:54` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `node_changes` to `&[FigValue]) -> (HashMap<String` in one and `Vec<FigValue>) -> (HashMap<String` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (12 lines × 2) crates/op-host-desktop/src/chat_session.rs:324— crates/op-host-desktop/src/chat_session.rs:324-335 | crates/op-host-desktop/src/chat_session.rs:427-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-desktop/src/chat_session.rs:324` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/op-host-native/src/widget_host/preview_slideshow.rs:248— crates/op-host-native/src/widget_host/preview_slideshow.rs:248-259 | crates/op-host-web/src/widget_host/preview_slideshow.rs:403-414 — before extracting anything, compare `crates/op-host-native/src/widget_host/preview_slideshow.rs` and `crates/op-host-web/src/widget_host/preview_slideshow.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 171 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 2) crates/op-host-native/src/widget_host/preview_slideshow.rs:268— crates/op-host-native/src/widget_host/preview_slideshow.rs:268-279 | crates/op-host-web/src/widget_host/preview_slideshow.rs:423-434 — before extracting anything, compare `crates/op-host-native/src/widget_host/preview_slideshow.rs` and `crates/op-host-web/src/widget_host/preview_slideshow.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 171 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-native/src/widget_host/preview_slideshow.rs:268` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/op-host-native/src/widget_host/slides_panel.rs:315— crates/op-host-native/src/widget_host/slides_panel.rs:315-326 | crates/op-host-web/src/widget_host/slides_panel.rs:196-207 — before extracting anything, compare `crates/op-host-native/src/widget_host/slides_panel.rs` and `crates/op-host-web/src/widget_host/slides_panel.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-native/src/widget_host/slides_panel.rs:315` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/op-host-native/src/widget_host/variables_preset_press.rs:70— crates/op-host-native/src/widget_host/variables_preset_press.rs:70-81 | crates/op-host-web/src/widget_host/variables_preset_press.rs:46-57 — before extracting anything, compare `crates/op-host-native/src/widget_host/variables_preset_press.rs` and `crates/op-host-web/src/widget_host/variables_preset_press.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 2) crates/op-host-native/src/widget_host/variables_preset_press.rs:218— crates/op-host-native/src/widget_host/variables_preset_press.rs:218-229 | crates/op-host-web/src/widget_host/variables_preset_press.rs:154-165 — before extracting anything, compare `crates/op-host-native/src/widget_host/variables_preset_press.rs` and `crates/op-host-web/src/widget_host/variables_preset_press.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
op_editor_core::variables_resolve::replace::replace_in_node (cognitive 72) crates/op-editor-core/src/variables_resolve/replace.rs:43— op_editor_core::variables_resolve::replace::replace_in_node has cognitive complexity 72 (threshold 15). Drivers by points: if/else 20 (46 pts), loops 5 (13 pts), match/switch 4 (13 pts) (nesting depth added 43). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
op_editor_core::variables_resolve::resolve_node_for_canvas (cognitive 66) crates/op-editor-core/src/variables_resolve.rs:251— op_editor_core::variables_resolve::resolve_node_for_canvas has cognitive complexity 66 (threshold 15). Drivers by points: if/else 21 (51 pts), loops 5 (13 pts), match/switch 1 (2 pts) (nesting depth added 39). 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.
op_editor_core::svg_import::path_data::parse_path_d (cognitive 41) crates/op-editor-core/src/svg_import/path_data.rs:12— op_editor_core::svg_import::path_data::parse_path_d has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (27 pts), match/switch 4 (10 pts), loops 2 (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.
op_editor_core::svg_import::scale::scale_svg_path (cognitive 36) crates/op-editor-core/src/svg_import/scale.rs:46— op_editor_core::svg_import::scale::scale_svg_path has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 7, loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_core::host_settings_commit::commit_settings_focus (cognitive 33) crates/op-editor-core/src/host_settings_commit.rs:48— op_editor_core::host_settings_commit::commit_settings_focus has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (26 pts), match/switch 4 (7 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.
op_editor_core::host_variables_commit::commit_row_draft (cognitive 33) crates/op-editor-core/src/host_variables_commit.rs:231— op_editor_core::host_variables_commit::commit_row_draft has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (31 pts), boolean chains 1, match/switch 1 (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
op_editor_core::editor_ui_state::workspace_variants::variant_pick_commands (cognitive 31) crates/op-editor-core/src/editor_ui_state/workspace_variants.rs:211— op_editor_core::editor_ui_state::workspace_variants::variant_pick_commands has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 4 (7 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_core::screen_sets::listed_whole_screen_names_en (cognitive 31) crates/op-editor-core/src/screen_sets.rs:199— op_editor_core::screen_sets::listed_whole_screen_names_en has cognitive complexity 31 (threshold 15). Drivers by points: if/else 4 (19 pts), loops 4 (10 pts), boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_core::svg_path_data::absolute_segments (cognitive 31) crates/op-editor-core/src/svg_path_data.rs:55— op_editor_core::svg_path_data::absolute_segments has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (23 pts), match/switch 2 (4 pts), loops 2 (3 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.
op_editor_core::workspace_edit::resolve_workspace_edit_scope (cognitive 31) crates/op-editor-core/src/workspace_edit.rs:270— op_editor_core::workspace_edit::resolve_workspace_edit_scope has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 14, if/else 9 (13 pts), match/switch 2 (3 pts), loops 1 (nesting depth added 5). 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.
op_editor_core::svg_import::path_data::tokenize_path (cognitive 29) crates/op-editor-core/src/svg_import/path_data.rs:270— op_editor_core::svg_import::path_data::tokenize_path has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 6, 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.
op_editor_core::svg_path_data::tokenize_path (cognitive 29) crates/op-editor-core/src/svg_path_data.rs:416— op_editor_core::svg_path_data::tokenize_path has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 6, 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.
op_editor_core::missing_fonts::component_override_font_family_stacks (cognitive 28) crates/op-editor-core/src/missing_fonts.rs:85— op_editor_core::missing_fonts::component_override_font_family_stacks has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 5 (11 pts), match/switch 1 (nesting depth added 15). Most of this is not in the body itself: 3 of the 28 points are its own statements and the rest belongs to 2 function items inside it that branch (scan_json, scan_nodes). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
op_editor_core::svg_import::lexer::scan_numbers (cognitive 28) crates/op-editor-core/src/svg_import/lexer.rs:143— op_editor_core::svg_import::lexer::scan_numbers has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 6, 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.
op_editor_core::instance_override::route_display_state (cognitive 27) crates/op-editor-core/src/instance_override.rs:335— op_editor_core::instance_override::route_display_state has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3 (6 pts), match/switch 4 (5 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.
op_editor_core::svg_import::lexer::parse_attrs (cognitive 27) crates/op-editor-core/src/svg_import/lexer.rs:87— op_editor_core::svg_import::lexer::parse_attrs has cognitive complexity 27 (threshold 15). Drivers by points: loops 6 (11 pts), boolean chains 8, if/else 4 (8 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.
op_editor_core::svg_import::xml::parse_svg_tree (cognitive 27) crates/op-editor-core/src/svg_import/xml.rs:95— op_editor_core::svg_import::xml::parse_svg_tree has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 4 (10 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.
op_editor_core::screen_sets::listed_whole_screen_names (cognitive 25) crates/op-editor-core/src/screen_sets.rs:245— op_editor_core::screen_sets::listed_whole_screen_names has cognitive complexity 25 (threshold 15). Drivers by points: if/else 3 (14 pts), loops 4 (10 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_core::table_pagination::materialize::walk (cognitive 25) crates/op-editor-core/src/table_pagination.rs:133— op_editor_core::table_pagination::materialize::walk has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_core::icon_path_normalize::absolute_segments (cognitive 24) crates/op-editor-core/src/icon_path_normalize.rs:306— op_editor_core::icon_path_normalize::absolute_segments has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_core::instance_child_override::split_instance_child_anchor (cognitive 22) crates/op-editor-core/src/instance_child_override.rs:48— op_editor_core::instance_child_override::split_instance_child_anchor has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 2, loops 2 (nesting depth added 8). Of this number, 17 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_core::workspace_edit::routing_text (cognitive 21) crates/op-editor-core/src/workspace_edit.rs:37— op_editor_core::workspace_edit::routing_text has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2, loops 2, match/switch 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.
op_editor_core::command_refine::ids_outside_subtree (cognitive 20) crates/op-editor-core/src/command_refine.rs:124— op_editor_core::command_refine::ids_outside_subtree has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 5 (10 pts) (nesting depth added 8). Of this number, 10 points are the body's own statements and 10 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_core::host_ui_transitions::settings_text_payload (cognitive 20) crates/op-editor-core/src/host_ui_transitions.rs:182— op_editor_core::host_ui_transitions::settings_text_payload has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 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.
op_editor_core::svg_import::nodes::element_to_node_ctx (cognitive 20) crates/op-editor-core/src/svg_import/nodes.rs:9— op_editor_core::svg_import::nodes::element_to_node_ctx has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 2, 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.
+ 19 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×43
Edited copy of a member (13 corresponding lines) crates/op-editor-core/src/fills/access.rs:306— crates/op-editor-core/src/fills/access.rs:306-318 | crates/op-editor-core/src/fills/access.rs:326-339 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/op-editor-core/src/command_apply/helpers.rs:64— crates/op-editor-core/src/command_apply/helpers.rs:64-80 | crates/op-mcp/src/batch_program_resolve.rs:179-191 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/op-acp/src/client.rs:659— crates/op-acp/src/client.rs:659-671 | crates/op-collab-relay-client/src/session.rs:31-43 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/op-host-web/src/web_design_md.rs:72— crates/op-host-web/src/web_design_md.rs:72-84 | crates/op-host-web/src/web_design_md.rs:214-233 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/op-host-native/src/backend/skia/path.rs:200— crates/op-host-native/src/backend/skia/path.rs:200-215 | crates/op-host-native/src/backend/skia/path.rs:228-240 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/op-mcp/src/read_tools_extra.rs:92— crates/op-mcp/src/read_tools_extra.rs:92-108 | crates/op-mcp/src/read_tools_extra.rs:140-152 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/op-editor-ui/src/widgets/home_surface_paint_works_grid.rs:19— crates/op-editor-ui/src/widgets/home_surface_paint_works_grid.rs:19-31 | crates/op-editor-ui/src/widgets/home_works_list.rs:172-188 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/op-codegen/src/codegen_tailwind_scale.rs:184— crates/op-codegen/src/codegen_tailwind_scale.rs:184-198 | crates/op-codegen/src/codegen_tailwind_scale.rs:201-213 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/op-orchestrator/src/card_inner_padding.rs:263— crates/op-orchestrator/src/card_inner_padding.rs:263-275 | crates/op-orchestrator/src/touch_target_floor.rs:190-203 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/op-editor-ui/src/widgets/ai_chat_input_text.rs:301— crates/op-editor-ui/src/widgets/ai_chat_input_text.rs:301-313 | crates/op-editor-ui/src/widgets/home_surface_input.rs:262-277 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/op-collab-transport/src/discovery.rs:400— crates/op-collab-transport/src/discovery.rs:400-413 | crates/op-collab-transport/src/discovery.rs:415-427 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/op-editor-ui/src/widgets/scene_template_card_paint.rs:140— crates/op-editor-ui/src/widgets/scene_template_card_paint.rs:140-152 | crates/op-editor-ui/src/widgets/scene_template_card_paint.rs:542-555 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/op-chat-agent/src/design_agent_diagnostics.rs:115— crates/op-chat-agent/src/design_agent_diagnostics.rs:115-127 | crates/op-image-enrich/src/targets/page_context.rs:84-96 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/op-collab/src/apply_tree.rs:201— crates/op-collab/src/apply_tree.rs:201-213 | crates/op-collab/src/apply_tree.rs:219-232 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/op-editor-ui/src/widgets/property_panel_flex.rs:97— crates/op-editor-ui/src/widgets/property_panel_flex.rs:97-114 | crates/op-editor-ui/src/widgets/property_panel_stroke.rs:91-103 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/op-host-web/src/dom_io/html_directory_session.rs:471— crates/op-host-web/src/dom_io/html_directory_session.rs:471-483 | crates/op-html/src/project.rs:327-339 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/op-editor-core/src/mutators.rs:143— crates/op-editor-core/src/mutators.rs:143-155 | crates/op-editor-core/src/mutators.rs:187-200 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/op-orchestrator/src/text_contrast_repair.rs:410— crates/op-orchestrator/src/text_contrast_repair.rs:410-422 | crates/op-orchestrator/src/text_contrast_repair.rs:744-757 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/op-codegen/src/codegen_targets.rs:408— crates/op-codegen/src/codegen_targets.rs:408-422 | crates/op-codegen/src/lib.rs:365-377 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/op-collab-relay-protocol/src/challenge.rs:302— crates/op-collab-relay-protocol/src/challenge.rs:302-316 | crates/op-collab-relay-protocol/src/locator.rs:430-442 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/op-editor-core/src/fills/image.rs:156— crates/op-editor-core/src/fills/image.rs:156-168 | crates/op-editor-core/src/image_node_props.rs:60-72 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/op-editor-core/src/prompt_center_keyboard.rs:81— crates/op-editor-core/src/prompt_center_keyboard.rs:81-93 | crates/op-editor-core/src/scene_template_keyboard.rs:115-127 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/op-html/src/length.rs:336— crates/op-html/src/length.rs:336-349 | crates/op-html/src/length.rs:351-363 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) packaging/ios/Sources/RegisterViewController.swift:39— packaging/ios/Sources/RegisterViewController.swift:39-51 | packaging/ios/Sources/RegisterViewController.swift:76-88 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/op-editor-core/src/components.rs:395— crates/op-editor-core/src/components.rs:395-407 | crates/op-editor-core/src/conversion.rs:328-342 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
+ 18 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×40
Edited copy of a member (12 corresponding lines) crates/op-chrome-extension-core/src/hub_time.rs:84— crates/op-chrome-extension-core/src/hub_time.rs:84-101 | crates/op-host-desktop/src/git_jobs.rs:425-436 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/op-host-services/src/hub_auth_client.rs:241— crates/op-host-services/src/hub_auth_client.rs:241-252 | crates/op-host-services/src/hub_auth_client.rs:255-266 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/op-orchestrator/src/subtask_completeness_reviews.rs:179— crates/op-orchestrator/src/subtask_completeness_reviews.rs:179-190 | crates/op-orchestrator/src/subtask_completeness_reviews.rs:216-228 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/op-orchestrator/src/program_gen.rs:157— crates/op-orchestrator/src/program_gen.rs:157-168 | crates/op-orchestrator/src/program_gen.rs:170-181 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/op-editor-core/src/id_allocator.rs:207— crates/op-editor-core/src/id_allocator.rs:207-218 | crates/op-editor-core/src/id_allocator.rs:224-239 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/op-collab-relay-locator-server/src/production/production_check.rs:32— crates/op-collab-relay-locator-server/src/production/production_check.rs:32-50 | crates/op-collab-relay-server/src/production.rs:46-57 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/op-editor-ui/src/widgets/variables_panel.rs:612— crates/op-editor-ui/src/widgets/variables_panel.rs:612-623 | crates/op-editor-ui/src/widgets/variables_panel.rs:625-639 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/op-host-desktop/src/image_panel_host.rs:212— crates/op-host-desktop/src/image_panel_host.rs:212-224 | crates/op-host-web/src/web_image_panel.rs:263-274 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/op-collab-relay-client/src/session.rs:453— crates/op-collab-relay-client/src/session.rs:453-464 | crates/op-collab-relay-client/src/session.rs:472-485 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/op-editor-core/src/command_node_attrs/slots.rs:163— crates/op-editor-core/src/command_node_attrs/slots.rs:163-174 | crates/op-editor-core/src/fills/access.rs:277-289 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/op-git/src/remote.rs:293— crates/op-git/src/remote.rs:293-311 | crates/op-git/src/status.rs:247-258 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/op-orchestrator/src/orchestration_self_check.rs:570— crates/op-orchestrator/src/orchestration_self_check.rs:570-581 | crates/op-orchestrator/src/role_post_pass/mobile_category_row.rs:14-25 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/op-editor-core/src/prompt_center_keyboard.rs:65— crates/op-editor-core/src/prompt_center_keyboard.rs:65-76 | crates/op-editor-core/src/scene_template_keyboard.rs:98-110 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/op-collab-transport/src/queue.rs:349— crates/op-collab-transport/src/queue.rs:349-360 | crates/op-collab-transport/src/reassembly_budget.rs:85-100 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/op-host-desktop/src/mcp_integrations.rs:321— crates/op-host-desktop/src/mcp_integrations.rs:321-332 | crates/op-host-desktop/src/mcp_integrations.rs:334-345 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/op-host-services/src/mcp_serve/sniff.rs:14— crates/op-host-services/src/mcp_serve/sniff.rs:14-26 | crates/op-host-services/src/mcp_serve/sniff.rs:32-43 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/op-html/src/css/cascade.rs:342— crates/op-html/src/css/cascade.rs:342-353 | crates/op-html/src/css/cascade.rs:373-390 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/op-codegen/src/codegen_targets.rs:230— crates/op-codegen/src/codegen_targets.rs:230-243 | crates/op-codegen/src/codegen_targets.rs:255-266 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/op-host-native/src/context/provider.rs:358— crates/op-host-native/src/context/provider.rs:358-369 | crates/op-host-native/src/context/provider.rs:372-383 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/op-collab-policy-file/src/lib.rs:250— crates/op-collab-policy-file/src/lib.rs:250-261 | crates/op-collab-relay-server/src/x25519_boundary.rs:239-250 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/op-editor-ui/src/widgets/agent_settings_builtin.rs:474— crates/op-editor-ui/src/widgets/agent_settings_builtin.rs:474-485 | crates/op-editor-ui/src/widgets/agent_settings_builtin.rs:494-505 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/op-editor-ui/src/widgets/property_panel_layout_ops.rs:87— crates/op-editor-ui/src/widgets/property_panel_layout_ops.rs:87-102 | crates/op-editor-ui/src/widgets/property_panel_layout_ops.rs:171-182 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/op-host-desktop/src/mcp_serve.rs:21— crates/op-host-desktop/src/mcp_serve.rs:21-32 | crates/op-host-web-server/src/main.rs:13-35 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/op-editor-core/src/host_variables_transitions.rs:122— crates/op-editor-core/src/host_variables_transitions.rs:122-133 | crates/op-editor-core/src/host_variables_transitions.rs:136-147 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/op-mcp/src/node_attr_tools.rs:416— crates/op-mcp/src/node_attr_tools.rs:416-428 | crates/op-mcp/src/node_attr_tools.rs:434-445 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
+ 15 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×40
Edited copy of a member (11 corresponding lines) crates/op-cli/src/app_control_cli.rs:410— crates/op-cli/src/app_control_cli.rs:410-425 | crates/op-cli/src/app_control_cli.rs:433-443 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) templates/step0/_generators/tpl_app_coffee_counter.py:319— templates/step0/_generators/tpl_app_coffee_counter.py:319-329 | templates/step0/_generators/tpl_app_sales_dashboard.py:398-410 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/op-chat-agent/src/design_agent_tools/quality_scans.rs:252— crates/op-chat-agent/src/design_agent_tools/quality_scans.rs:252-265 | crates/op-orchestrator/src/role_post_pass/surface_structure.rs:359-369 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/op-design-lint/src/node_util.rs:527— crates/op-design-lint/src/node_util.rs:527-537 | crates/op-mcp/src/style_ops_tools.rs:521-531 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/op-host-desktop/src/chat_session_launch_design.rs:204— crates/op-host-desktop/src/chat_session_launch_design.rs:204-214 | crates/op-host-desktop/src/chat_session_launch_providers.rs:132-147 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/op-collab/src/serde_context.rs:43— crates/op-collab/src/serde_context.rs:43-58 | crates/op-collab/src/serde_context.rs:160-170 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/op-editor-host-core/src/codegen_runtime_state.rs:42— crates/op-editor-host-core/src/codegen_runtime_state.rs:42-56 | crates/op-host-web/src/codegen_web.rs:149-159 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/op-orchestrator/src/cleanup_mobile_chrome.rs:332— crates/op-orchestrator/src/cleanup_mobile_chrome.rs:332-344 | crates/op-orchestrator/src/unfilled_screens.rs:193-203 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/op-orchestrator/src/first_viewport.rs:108— crates/op-orchestrator/src/first_viewport.rs:108-118 | crates/op-orchestrator/src/first_viewport.rs:128-138 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/op-editor-ui/src/widgets/variables_panel/hit.rs:209— crates/op-editor-ui/src/widgets/variables_panel/hit.rs:209-219 | crates/op-editor-ui/src/widgets/variables_panel/hit.rs:226-236 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/op-editor-ui/src/widgets/preview_device_switcher.rs:52— crates/op-editor-ui/src/widgets/preview_device_switcher.rs:52-62 | crates/op-editor-ui/src/widgets/screen_switcher_pills.rs:75-86 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/op-figma/src/image_resolver.rs:67— crates/op-figma/src/image_resolver.rs:67-77 | crates/op-figma/src/image_resolver.rs:79-89 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/op-editor-core/src/color_picker_snapshot.rs:77— crates/op-editor-core/src/color_picker_snapshot.rs:77-87 | crates/op-editor-ui/src/widgets/property_panel_commit.rs:419-429 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/ChatAttachmentPicker.kt:212— packaging/android/app/src/main/kotlin/tech/zseven/openpencil/ChatAttachmentPicker.kt:212-222 | packaging/android/app/src/main/kotlin/tech/zseven/openpencil/DocumentSaveCoordinator.kt:217-229 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/op-figma/src/instance/assignment.rs:274— crates/op-figma/src/instance/assignment.rs:274-284 | crates/op-figma/src/instance/assignment.rs:292-304 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/op-host-services/src/export_html.rs:116— crates/op-host-services/src/export_html.rs:116-126 | crates/op-host-services/src/export_hyperframes.rs:343-353 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/op-collab-smoke/src/fault_guest.rs:495— crates/op-collab-smoke/src/fault_guest.rs:495-505 | crates/op-collab-smoke/src/fault_owner.rs:665-678 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/op-collab-smoke/src/fault_owner.rs:626— crates/op-collab-smoke/src/fault_owner.rs:626-636 | crates/op-collab-smoke/src/fault_owner.rs:643-658 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/op-editor-ui/src/widgets/html_import_diagnostics_panel.rs:155— crates/op-editor-ui/src/widgets/html_import_diagnostics_panel.rs:155-165 | crates/op-editor-ui/src/widgets/html_import_diagnostics_panel.rs:167-177 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/op-engine-ffi/src/editor_document_shell.rs:405— crates/op-engine-ffi/src/editor_document_shell.rs:405-415 | crates/op-engine-ffi/src/editor_export.rs:224-234 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/op-git/src/history.rs:71— crates/op-git/src/history.rs:71-81 | crates/op-git/src/history.rs:84-97 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/op-editor-ui/src/widgets/top_bar.rs:367— crates/op-editor-ui/src/widgets/top_bar.rs:367-377 | crates/op-editor-ui/src/widgets/top_bar.rs:389-399 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/op-editor-core/src/collab_ui_state.rs:166— crates/op-editor-core/src/collab_ui_state.rs:166-176 | crates/op-editor-ui/src/widgets/collab_avatar_paint.rs:13-23 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/op-editor-core/src/conversion.rs:39— crates/op-editor-core/src/conversion.rs:39-49 | crates/op-editor-core/src/conversion.rs:344-354 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/op-editor-core/src/mutators.rs:479— crates/op-editor-core/src/mutators.rs:479-489 | crates/op-editor-core/src/pen.rs:50-60 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
op_host_services::mcp_serve::registry::rebuild_registry (cognitive 154) crates/op-host-services/src/mcp_serve/registry.rs:9— op_host_services::mcp_serve::registry::rebuild_registry has cognitive complexity 154 (threshold 15). Drivers by points: if/else 149 (152 pts), 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.
op_host_services::chat_http_server::run_opencode_turn (cognitive 98) crates/op-host-services/src/chat_http_server.rs:246— op_host_services::chat_http_server::run_opencode_turn has cognitive complexity 98 (threshold 15). Drivers by points: if/else 32 (71 pts), match/switch 12 (18 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 46). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
op_host_services::mcp_serve::sniff::walk_top_level (cognitive 84) crates/op-host-services/src/mcp_serve/sniff.rs:57— op_host_services::mcp_serve::sniff::walk_top_level has cognitive complexity 84 (threshold 15). Drivers by points: if/else 24 (54 pts), loops 8 (18 pts), boolean chains 10, match/switch 1 (2 pts) (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_services::web_canvas_server::connection::dispatch (cognitive 66) crates/op-host-services/src/web_canvas_server/connection.rs:101— op_host_services::web_canvas_server::connection::dispatch has cognitive complexity 66 (threshold 15). Drivers by points: if/else 35 (40 pts), boolean chains 19, match/switch 4 (7 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.
op_host_services::web_image_generate_workbench::generate_workbench (cognitive 43) crates/op-host-services/src/web_image_generate_workbench.rs:97— op_host_services::web_image_generate_workbench::generate_workbench has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (24 pts), match/switch 3 (8 pts), boolean chains 6, loops 3 (5 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.
op_host_services::mcp_serve::read_http_request (cognitive 41) crates/op-host-services/src/mcp_serve.rs:440— op_host_services::mcp_serve::read_http_request has cognitive complexity 41 (threshold 15). Drivers by points: if/else 18 (28 pts), boolean chains 7, match/switch 3 (4 pts), loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_services::chat_claude::map_message (cognitive 38) crates/op-host-services/src/chat_claude.rs:349— op_host_services::chat_claude::map_message has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (28 pts), match/switch 3 (7 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 22). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
op_host_services::web_canvas_server::connection_ai_routes::serve_ai_route (cognitive 37) crates/op-host-services/src/web_canvas_server/connection_ai_routes.rs:38— op_host_services::web_canvas_server::connection_ai_routes::serve_ai_route has cognitive complexity 37 (threshold 15). Drivers by points: match/switch 8 (19 pts), if/else 10 (16 pts), boolean chains 2 (nesting depth added 17). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
op_host_services::ai_proxy::proxy_builtin_for_identity (cognitive 34) crates/op-host-services/src/ai_proxy.rs:386— op_host_services::ai_proxy::proxy_builtin_for_identity has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 6, loops 2 (5 pts), match/switch 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_services::cli_model_discovery::parse_grok_models (cognitive 32) crates/op-host-services/src/cli_model_discovery.rs:210— op_host_services::cli_model_discovery::parse_grok_models has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 8, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_services::design_md_evidence::evidence_provenance (cognitive 32) crates/op-host-services/src/design_md_evidence.rs:416— op_host_services::design_md_evidence::evidence_provenance has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 6 (7 pts), match/switch 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_services::cli_model_discovery_antigravity::parse_antigravity_models (cognitive 31) crates/op-host-services/src/cli_model_discovery_antigravity.rs:35— op_host_services::cli_model_discovery_antigravity::parse_antigravity_models has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 10, 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.
op_host_services::image_relevance_judge_evidence::parse_verdict_text (cognitive 31) crates/op-host-services/src/image_relevance_judge_evidence.rs:19— op_host_services::image_relevance_judge_evidence::parse_verdict_text has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 3 (4 pts), boolean chains 3, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_services::chat_builtin_http_wire::pump_sse_response (cognitive 30) crates/op-host-services/src/chat_builtin_http_wire.rs:30— op_host_services::chat_builtin_http_wire::pump_sse_response has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_services::web_chat_standard_stream_routes::stream_modify_route (cognitive 28) crates/op-host-services/src/web_chat_standard_stream_routes.rs:60— op_host_services::web_chat_standard_stream_routes::stream_modify_route has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (25 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_services::mcp_live::connection::serve_connection (cognitive 25) crates/op-host-services/src/mcp_live/connection.rs:115— op_host_services::mcp_live::connection::serve_connection has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (22 pts), match/switch 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.
op_host_services::web_credentials::validate_and_merge (cognitive 25) crates/op-host-services/src/web_credentials.rs:303— op_host_services::web_credentials::validate_and_merge has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 4, 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.
op_host_services::chat_spawn::well_known_install_paths (cognitive 24) crates/op-host-services/src/chat_spawn.rs:427— op_host_services::chat_spawn::well_known_install_paths has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 4 (10 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.
op_host_services::design_md_evidence_roles::from_sanitized_json (cognitive 24) crates/op-host-services/src/design_md_evidence_roles.rs:11— op_host_services::design_md_evidence_roles::from_sanitized_json has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (17 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
op_host_services::web_canvas_server::handle_web_canvas_request (cognitive 24) crates/op-host-services/src/web_canvas_server.rs:460— op_host_services::web_canvas_server::handle_web_canvas_request has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 6 (12 pts), if/else 6 (11 pts), boolean chains 1 (nesting depth added 11). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
op_host_services::design_md_evidence::validate_evidence (cognitive 23) crates/op-host-services/src/design_md_evidence.rs:535— op_host_services::design_md_evidence::validate_evidence has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 8 (9 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.
op_host_services::export_pptx::unexpressible (cognitive 23) crates/op-host-services/src/export_pptx.rs:365— op_host_services::export_pptx::unexpressible has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4, match/switch 3 (4 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.
op_host_services::zode_import::import_from_config (cognitive 23) crates/op-host-services/src/zode_import.rs:81— op_host_services::zode_import::import_from_config has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_services::chat_http_server_error::format_opencode_error (cognitive 22) crates/op-host-services/src/chat_http_server_error.rs:114— op_host_services::chat_http_server_error::format_opencode_error has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (22 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_services::web_canvas_server::run_loop::run_web_canvas (cognitive 22) crates/op-host-services/src/web_canvas_server/run_loop.rs:28— op_host_services::web_canvas_server::run_loop::run_web_canvas has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 3 (5 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.
+ 11 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (6 corresponding lines) · ×36
Edited copy of a member (6 corresponding lines) templates/step0/_generators/tpl_infographic_data.py:326— templates/step0/_generators/tpl_infographic_data.py:326-331 | templates/step0/_generators/tpl_infographic_weekly_review.py:360-366 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) templates/step0/_generators/tpl_compare_scenario_guide.py:265— templates/step0/_generators/tpl_compare_scenario_guide.py:265-271 | templates/step0/_generators/tpl_compare_spec_table.py:325-330 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/op-orchestrator/src/role_post_pass/color_utils.rs:159— crates/op-orchestrator/src/role_post_pass/color_utils.rs:159-164 | crates/op-orchestrator/src/role_post_pass/color_utils.rs:166-182 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) templates/step0/_generators/tpl1.py:235— templates/step0/_generators/tpl1.py:235-249 | templates/step0/_generators/tpl2.py:215-220 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) templates/step0/_generators/tpl_bookreview_carousel.py:263— templates/step0/_generators/tpl_bookreview_carousel.py:263-268 | templates/step0/_generators/tpl_story_carousel.py:242-252 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/op-editor-ui/src/svg_export.rs:682— crates/op-editor-ui/src/svg_export.rs:682-689 | crates/op-editor-ui/src/util.rs:32-37 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/op-host-web/src/web_settings.rs:36— crates/op-host-web/src/web_settings.rs:36-41 | crates/op-host-web/src/web_settings_theme.rs:77-84 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) templates/step0/_generators/tpl1.py:109— templates/step0/_generators/tpl1.py:109-119 | templates/step0/_generators/tpl3.py:80-85 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/op-editor-ui/src/widgets/slides_panel.rs:275— crates/op-editor-ui/src/widgets/slides_panel.rs:275-281 | crates/op-editor-ui/src/widgets/property_panel_color_variables.rs:274-279 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) templates/step0/_generators/tpl_deck_banxin.py:156— templates/step0/_generators/tpl_deck_banxin.py:156-163 | templates/step0/_generators/tpl_deck_gridpaper.py:133-138 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/op-editor-ui/src/widgets/variables_panel.rs:390— crates/op-editor-ui/src/widgets/variables_panel.rs:390-396 | crates/op-editor-ui/src/widgets/ai_chat_model_picker.rs:352-357 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) templates/step0/_generators/tpl_deck_dossier.py:189— templates/step0/_generators/tpl_deck_dossier.py:189-194 | templates/step0/_generators/tpl_deck_ledger.py:182-187 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/op-render-export/src/lib.rs:209— crates/op-render-export/src/lib.rs:209-217 | crates/op-render-export/src/pdf.rs:49-54 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/op-editor-ui/src/widgets/ai_chat_panel.rs:647— crates/op-editor-ui/src/widgets/ai_chat_panel.rs:647-656 | crates/op-editor-ui/src/widgets/icon_picker_panel.rs:172-177 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/op-orchestrator/src/plan_coverage_append.rs:185— crates/op-orchestrator/src/plan_coverage_append.rs:185-199 | crates/op-orchestrator/src/scaffold_right_rail.rs:72-77 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/op-brand/src/kit.rs:437— crates/op-brand/src/kit.rs:437-442 | crates/op-orchestrator/src/semantic_palette.rs:146-151 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/op-image-enrich/src/net/fetch_aspect.rs:16— crates/op-image-enrich/src/net/fetch_aspect.rs:16-21 | crates/op-image-enrich/src/net/fetch_judged.rs:105-110 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/op-editor-ui/src/widgets/agent_settings_panel_geometry.rs:89— crates/op-editor-ui/src/widgets/agent_settings_panel_geometry.rs:89-97 | crates/op-editor-ui/src/widgets/top_bar_window_control.rs:45-50 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/op-host-services/src/image_relevance_judge.rs:559— crates/op-host-services/src/image_relevance_judge.rs:559-564 | crates/op-host-services/src/web_canvas_server/tenant_store.rs:101-109 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/op-editor-core/src/components.rs:457— crates/op-editor-core/src/components.rs:457-462 | crates/op-editor-core/src/page_mutators.rs:159-164 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/op-editor-core/src/components.rs:528— crates/op-editor-core/src/components.rs:528-533 | crates/op-editor-core/src/page_mutators.rs:331-336 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/op-host-services/src/web_canvas_server/tenant.rs:110— crates/op-host-services/src/web_canvas_server/tenant.rs:110-116 | crates/op-smoke/src/llm_clients.rs:358-363 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/op-host-web/src/studio_web.rs:81— crates/op-host-web/src/studio_web.rs:81-86 | crates/op-host-web/src/web_generator_runner.rs:62-67 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/op-editor-ui/src/widgets/icon_catalog.rs:472— crates/op-editor-ui/src/widgets/icon_catalog.rs:472-477 | crates/op-html/src/snapshot.rs:618-624 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/op-engine-ffi/src/editor_document.rs:640— crates/op-engine-ffi/src/editor_document.rs:640-645 | crates/op-host-services/src/mcp_serve/file_path.rs:101-106 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
WidgetHost::apply_cursor_move (cognitive 264) crates/op-host-web/src/widget_host/cursor_input.rs:17— WidgetHost::apply_cursor_move has cognitive complexity 264 (threshold 15). Drivers by points: if/else 128 (220 pts), boolean chains 38, match/switch 2 (6 pts) (nesting depth added 96). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHost::apply_overlay_cursor_move (cognitive 92) crates/op-host-web/src/widget_host/overlay_cursor.rs:96— WidgetHost::apply_overlay_cursor_move has cognitive complexity 92 (threshold 15). Drivers by points: if/else 39 (75 pts), boolean chains 14, match/switch 1 (3 pts) (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHost::paint_editor (cognitive 92) crates/op-host-web/src/widget_host/paint.rs:49— WidgetHost::paint_editor has cognitive complexity 92 (threshold 15). Drivers by points: if/else 54 (81 pts), boolean chains 8, match/switch 1 (3 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHost::update_agent_settings_hover (cognitive 56) crates/op-host-web/src/widget_host/agent_settings_hover.rs:14— WidgetHost::update_agent_settings_hover has cognitive complexity 56 (threshold 15). Drivers by points: if/else 38, match/switch 6 (11 pts), boolean chains 7 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WidgetHost::apply_backspace (cognitive 43) crates/op-host-web/src/widget_host/keyboard.rs:138— WidgetHost::apply_backspace has cognitive complexity 43 (threshold 15). Drivers by points: if/else 30 (41 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.
WidgetHost::apply_escape (cognitive 42) crates/op-host-web/src/widget_host/keyboard_escape.rs:16— WidgetHost::apply_escape has cognitive complexity 42 (threshold 15). Drivers by points: if/else 41, boolean chains 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.
WidgetHost::update_dropdown_hover (cognitive 41) crates/op-host-web/src/widget_host/overlay_cursor.rs:469— WidgetHost::update_dropdown_hover has cognitive complexity 41 (threshold 15). Drivers by points: if/else 20 (34 pts), match/switch 3 (6 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHost::apply_delete (cognitive 40) crates/op-host-web/src/widget_host/keyboard.rs:364— WidgetHost::apply_delete has cognitive complexity 40 (threshold 15). Drivers by points: if/else 23 (38 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.
WidgetHost::apply_text (cognitive 35) crates/op-host-web/src/widget_host/keyboard.rs:17— WidgetHost::apply_text has cognitive complexity 35 (threshold 15). Drivers by points: if/else 27 (35 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.
WidgetHost::press_font_and_picker_tiers (cognitive 31) crates/op-host-web/src/widget_host/press_property_tiers.rs:121— WidgetHost::press_font_and_picker_tiers has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (30 pts), boolean chains 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.
WidgetHost::apply_git_text (cognitive 30) crates/op-host-web/src/widget_host/keyboard_git.rs:7— WidgetHost::apply_git_text has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (26 pts), match/switch 1 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHost::focused_input_selected_text (cognitive 29) crates/op-host-web/src/widget_host/keyboard_text_inputs.rs:145— WidgetHost::focused_input_selected_text has cognitive complexity 29 (threshold 15). Drivers by points: if/else 19 (21 pts), match/switch 2 (5 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
WidgetHost::run_home_hit (cognitive 29) crates/op-host-web/src/widget_host/studio_home.rs:89— WidgetHost::run_home_hit has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 5 (10 pts), boolean chains 1 (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
WidgetHost::apply_press (cognitive 28) crates/op-host-web/src/widget_host/press.rs:130— WidgetHost::apply_press has cognitive complexity 28 (threshold 15). Drivers by points: if/else 21 (25 pts), boolean chains 3 (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.
WidgetHost::apply_send (cognitive 27) crates/op-host-web/src/widget_host/keyboard.rs:259— WidgetHost::apply_send has cognitive complexity 27 (threshold 15). Drivers by points: if/else 23 (27 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.
WidgetHost::press_top_bar_tier (cognitive 27) crates/op-host-web/src/widget_host/press_chrome_tiers.rs:124— WidgetHost::press_top_bar_tier has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (22 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHost::apply_release_with_viewport (cognitive 26) crates/op-host-web/src/widget_host/release_input.rs:36— WidgetHost::apply_release_with_viewport has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21 (23 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.
WidgetHost::apply_git_send (cognitive 22) crates/op-host-web/src/widget_host/keyboard_git.rs:162— WidgetHost::apply_git_send has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (19 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.
WidgetHost::apply_node_drag_cursor_move (cognitive 22) crates/op-host-web/src/widget_host/node_drag.rs:119— WidgetHost::apply_node_drag_cursor_move has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
WidgetHost::press_rail_overlay_tiers (cognitive 22) crates/op-host-web/src/widget_host/press_chrome_tiers.rs:17— WidgetHost::press_rail_overlay_tiers has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
WidgetHost::dispatch_icon_picker_press (cognitive 21) crates/op-host-web/src/widget_host/icon_picker_press.rs:19— WidgetHost::dispatch_icon_picker_press has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 3, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetHost::apply_release (cognitive 21) crates/op-host-web/src/widget_host/release_input.rs:136— WidgetHost::apply_release has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19 (20 pts), boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WidgetHost::press_import_locale_tiers (cognitive 20) crates/op-host-web/src/widget_host/press_overlay_tiers.rs:137— WidgetHost::press_import_locale_tiers has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 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.
WidgetHost::apply_wheel_with_canvas_delta (cognitive 20) crates/op-host-web/src/widget_host/wheel_pan.rs:169— WidgetHost::apply_wheel_with_canvas_delta has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18 (19 pts), boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WidgetHost::paint_menu_modal_and_panel_layers (cognitive 19) crates/op-host-web/src/widget_host/paint_overlays.rs:80— WidgetHost::paint_menu_modal_and_panel_layers has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16 (18 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.
+ 10 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×35
Edited copy of a member (14 corresponding lines) crates/op-editor-core/src/scene_template_append.rs:392— crates/op-editor-core/src/scene_template_append.rs:392-410 | crates/op-orchestrator/src/variants.rs:447-460 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/op-host-native/src/widget_host/slides_panel.rs:134— crates/op-host-native/src/widget_host/slides_panel.rs:134-158 | crates/op-host-web/src/widget_host/slides_panel.rs:78-91 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/op-host-native/src/widget_host/workspace.rs:43— crates/op-host-native/src/widget_host/workspace.rs:43-61 | crates/op-host-web/src/widget_host/studio_workspace.rs:42-55 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/op-editor-core/src/quality_report.rs:70— crates/op-editor-core/src/quality_report.rs:70-83 | crates/op-editor-core/src/quality_report/localize.rs:185-198 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/op-editor-ui/src/widgets/ai_chat_transcript_tools.rs:305— crates/op-editor-ui/src/widgets/ai_chat_transcript_tools.rs:305-320 | crates/op-editor-ui/src/widgets/ai_chat_transcript_tools.rs:354-367 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/op-editor-core/src/conversion.rs:202— crates/op-editor-core/src/conversion.rs:202-216 | crates/op-editor-core/src/conversion.rs:237-250 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/op-orchestrator/src/text_contrast_gradient.rs:215— crates/op-orchestrator/src/text_contrast_gradient.rs:215-230 | crates/op-orchestrator/src/text_contrast_repair.rs:515-528 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/op-cli/src/skill_install_cli.rs:210— crates/op-cli/src/skill_install_cli.rs:210-223 | crates/op-cli/src/skill_install_cli.rs:230-253 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/op-preview-contracts/src/effect.rs:67— crates/op-preview-contracts/src/effect.rs:67-80 | crates/op-preview-contracts/src/effect.rs:116-129 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/op-host-services/src/public_https_client.rs:37— crates/op-host-services/src/public_https_client.rs:37-53 | crates/op-host-services/src/public_https_client.rs:61-74 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/op-chrome-extension-core/src/design_md_render.rs:517— crates/op-chrome-extension-core/src/design_md_render.rs:517-530 | crates/op-orchestrator/src/variants.rs:92-105 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/op-host-desktop/src/brand_extract_host.rs:42— crates/op-host-desktop/src/brand_extract_host.rs:42-55 | crates/op-host-desktop/src/site_import_host.rs:40-54 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/op-ai-skills/src/style_guide/user_registry.rs:182— crates/op-ai-skills/src/style_guide/user_registry.rs:182-200 | crates/op-editor-core/src/user_scene_templates.rs:144-157 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/op-editor-ui/src/widgets/canvas_path_overlay.rs:134— crates/op-editor-ui/src/widgets/canvas_path_overlay.rs:134-149 | crates/op-editor-ui/src/widgets/canvas_selection_overlay.rs:65-78 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/op-builtin-model-discovery/src/lib.rs:214— crates/op-builtin-model-discovery/src/lib.rs:214-227 | crates/op-collab-relay-control-plane/src/http_client.rs:157-170 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/op-cli/src/app_control_cli.rs:266— crates/op-cli/src/app_control_cli.rs:266-283 | crates/op-cli/src/app_control_cli.rs:537-550 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/op-collab-relay-locator-server/src/production/production_check.rs:120— crates/op-collab-relay-locator-server/src/production/production_check.rs:120-133 | crates/op-collab-relay-server/src/production.rs:98-111 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/op-engine-jni/src/callbacks.rs:61— crates/op-engine-jni/src/callbacks.rs:61-74 | crates/op-engine-napi/src/callbacks.rs:52-67 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) templates/step0/_generators/tpl_brand_concept_sheet.py:224— templates/step0/_generators/tpl_brand_concept_sheet.py:224-237 | templates/step0/_generators/tpl_logo_qa_board.py:185-200 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/op-editor-core/src/uikit_io.rs:320— crates/op-editor-core/src/uikit_io.rs:320-333 | crates/op-editor-core/src/uikit_io.rs:339-359 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/op-editor-ui/src/widgets/agent_settings_builtin_parts.rs:281— crates/op-editor-ui/src/widgets/agent_settings_builtin_parts.rs:281-294 | crates/op-editor-ui/src/widgets/agent_settings_form_actions.rs:79-92 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/op-orchestrator/src/radial_repair_preinsert_normalize.rs:364— crates/op-orchestrator/src/radial_repair_preinsert_normalize.rs:364-377 | crates/op-orchestrator/src/ring_repair.rs:331-344 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/op-html/src/css/selectors_parser.rs:344— crates/op-html/src/css/selectors_parser.rs:344-357 | crates/op-html/src/mapper_pseudo.rs:275-288 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/op-engine-ffi/src/editor_chat.rs:704— crates/op-engine-ffi/src/editor_chat.rs:704-717 | crates/op-engine-ffi/src/editor_model_discovery.rs:204-217 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/op-editor-ui/src/widgets/agent_settings_press_entries.rs:564— crates/op-editor-ui/src/widgets/agent_settings_press_entries.rs:564-580 | crates/op-editor-ui/src/widgets/agent_settings_press_entries.rs:582-595 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
TooManyMethods: WidgetHostNative crates/op-host-native/src/widget_host.rs:326— TooManyMethods — 727 methods, declared across 118 files: widget_host/geometry.rs (29), widget_host/shortcuts.rs (28), widget_host/overlay_rects.rs (25), widget_host/works_reader.rs (25), +114 more file(s). The bar is 30 methods; this is 697 over it, 24.23× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: WidgetHost crates/op-host-web/src/widget_host.rs:262— TooManyMethods — 506 methods, declared across 87 files: widget_host/preview_frame.rs (30), widget_host/keyboard_edit_ops.rs (24), widget_host/host_lifecycle.rs (21), widget_host/image_panel_dispatch.rs (20), +83 more file(s). The bar is 30 methods; this is 476 over it, 16.87× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: EditorState crates/op-editor-core/src/state.rs:56— TooManyMethods — 391 methods, declared across 58 files: src/mutators.rs (37), command_node_attrs/state_ops.rs (25), src/property_edit_mutators.rs (25), src/text_edit.rs (23), +54 more file(s). The bar is 30 methods; this is 361 over it, 13.03× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: DesktopApp crates/op-host-desktop/src/main.rs:175— TooManyMethods — 161 methods, declared across 32 files: git_host/repo_ops.rs (15), src/app_state.rs (14), src/keyboard_input.rs (11), app_handler/pointer_events.rs (10), +28 more file(s). The bar is 30 methods; this is 131 over it, 5.37× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: GitPanel crates/op-editor-ui/src/widgets/git_panel.rs:244— TooManyMethods — 134 methods, declared across 19 files: widgets/git_panel_ready.rs (18), widgets/git_panel_diff.rs (13), widgets/git_panel_tracked_picker.rs (12), widgets/git_panel_commit_card.rs (10), +15 more file(s). The bar is 30 methods; this is 104 over it, 4.47× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SceneTemplatePanel crates/op-editor-ui/src/widgets/scene_template_panel.rs:259— TooManyMethods — 128 methods, declared across 11 files: widgets/scene_template_panel.rs (34), widgets/scene_template_card_paint.rs (20), widgets/scene_template_touch_density.rs (20), widgets/scene_template_panel_paint.rs (12), +7 more file(s). The bar is 30 methods; this is 98 over it, 4.27× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PreviewSession crates/op-preview-core/src/session.rs:64— TooManyMethods — 121 methods, declared across 15 files: src/input.rs (23), src/session.rs (17), src/session_paint.rs (15), src/present.rs (13), +11 more file(s). The bar is 30 methods; this is 91 over it, 4.03× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: EditorUiState crates/op-editor-core/src/editor_ui_state/state.rs:21— TooManyMethods — 112 methods, declared across 13 files: editor_ui_state/methods.rs (60), src/host_escape_transitions.rs (20), src/host_keyboard_transitions.rs (5), src/host_ui_transitions.rs (5), +9 more file(s). The bar is 30 methods; this is 82 over it, 3.73× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CollabRuntime crates/op-collab-host/src/runtime.rs:72— TooManyMethods — 101 methods, declared across 13 files: src/runtime.rs (28), runtime/effects.rs (20), runtime/effects_wire.rs (11), network/lifecycle.rs (9), +9 more file(s). The bar is 30 methods; this is 71 over it, 3.37× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: NativeBackend crates/op-host-native/src/backend/skia.rs:91— TooManyMethods — 91 methods, declared across 7 files: backend/skia.rs (35), skia/path.rs (23), skia/text.rs (10), skia/image.rs (9), +3 more file(s). The bar is 30 methods; this is 61 over it, 3.03× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PropertyPanel crates/op-editor-ui/src/widgets/property_panel.rs:80— TooManyMethods — 87 methods, declared across 8 files: widgets/property_panel_overlay_hit.rs (33), property_panel/hit.rs (16), property_panel/menus.rs (12), widgets/property_panel_compositing.rs (9), +4 more file(s). The bar is 30 methods; this is 57 over it, 2.90× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: OpNative packaging/android/app/src/main/kotlin/tech/zseven/openpencil/OpNative.kt:11— TooManyMethods — 73 methods. The bar is 30 methods; this is 43 over it, 2.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AgentSettings crates/op-editor-core/src/agent_settings.rs:254— TooManyMethods — 73 methods, declared across 4 files: agent_settings/mutators.rs (31), src/agent_settings_builtin_models.rs (17), src/agent_settings_connection.rs (13), src/agent_settings_acp_connection.rs (12). The bar is 30 methods; this is 43 over it, 2.43× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: Session crates/op-engine-ffi/src/lifecycle.rs:29— TooManyMethods — 65 methods, declared across 11 files: src/lifecycle.rs (27), src/editor_collab.rs (15), src/pointer_gate.rs (8), src/editor_collab_presence.rs (4), +7 more file(s). The bar is 30 methods; this is 35 over it, 2.17× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: OpSurfaceView packaging/android/app/src/main/kotlin/tech/zseven/openpencil/OpSurfaceView.kt:45— TooManyMethods — 62 methods. The bar is 30 methods; this is 32 over it, 2.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: OpEngineHost packaging/ios/Sources/OpEngineHost.swift:6— TooManyMethods — 60 methods, declared across 4 files: Sources/OpEngineHost.swift (40), Sources/OpEngineHost+Auth.swift (12), Sources/OpEngineHost+Pointer.swift (7), Sources/OpEngineHost+RemoteImages.swift (1). The bar is 30 methods; this is 30 over it, 2.00× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: OpPlayerView packaging/ios/Sources/OpPlayerView.swift:10— TooManyMethods — 53 methods, declared across 4 files: Sources/OpPlayerView.swift (44), Sources/OpPlayerView+ImeBridge.swift (5), Sources/OpPlayerView+Login.swift (3), Sources/OpPlayerView+AccountDeletion.swift (1). The bar is 30 methods; this is 23 over it, 1.77× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: GitRepo crates/op-git/src/lib.rs:129— TooManyMethods — 53 methods, declared across 7 files: src/merge.rs (11), src/status.rs (11), src/remote.rs (10), src/lib.rs (9), +3 more file(s). The bar is 30 methods; this is 23 over it, 1.77× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AIChatPlaceholder crates/op-editor-ui/src/widgets/ai_chat_panel.rs:87— TooManyMethods — 52 methods, declared across 3 files: widgets/ai_chat_panel.rs (39), widgets/ai_chat_panel_hit.rs (12), widgets/ai_chat_panel_footer.rs (1). The bar is 30 methods; this is 22 over it, 1.73× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: GuestSessionCore crates/op-collab/src/guest.rs:34— TooManyMethods — 47 methods, declared across 3 files: src/guest.rs (30), src/guest_sync.rs (13), src/guest_pending.rs (4). The bar is 30 methods; this is 17 over it, 1.57× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: VariablesPanel crates/op-editor-ui/src/widgets/variables_panel.rs:127— TooManyMethods — 47 methods, declared across 3 files: widgets/variables_panel.rs (45), variables_panel/hit.rs (1), variables_panel/hover.rs (1). The bar is 30 methods; this is 17 over it, 1.57× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: OwnerSessionCore crates/op-collab/src/session.rs:29— TooManyMethods — 46 methods, declared across 5 files: src/session_roster.rs (17), src/session.rs (10), src/session_undo.rs (10), src/session_sync.rs (5), +1 more file(s). The bar is 30 methods; this is 16 over it, 1.53× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: TopBar crates/op-editor-ui/src/widgets/top_bar.rs:114— TooManyMethods — 46 methods, declared across 5 files: widgets/top_bar_geometry.rs (28), widgets/top_bar.rs (12), widgets/top_bar_window_control.rs (4), widgets/top_bar_paint.rs (1), +1 more file(s). The bar is 30 methods; this is 16 over it, 1.53× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ChatState crates/op-editor-core/src/chat.rs:189— TooManyMethods — 45 methods, declared across 4 files: chat/session.rs (32), chat/messages.rs (11), chat/instance.rs (1), src/chat_design_apply.rs (1). The bar is 30 methods; this is 15 over it, 1.50× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PromptCenterPanel crates/op-editor-ui/src/widgets/prompt_center_panel.rs:143— TooManyMethods — 44 methods, declared across 2 files: widgets/prompt_center_panel.rs (33), widgets/prompt_center_panel_paint.rs (11). The bar is 30 methods; this is 14 over it, 1.47× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
op_figma::instance::apply_instance_overrides_cached (cognitive 248) crates/op-figma/src/instance.rs:102— op_figma::instance::apply_instance_overrides_cached has cognitive complexity 248 (threshold 15). Drivers by points: if/else 67 (186 pts), loops 17 (33 pts), boolean chains 18, match/switch 4 (11 pts) (nesting depth added 142). 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.
op_figma::instance::fingerprint::score (cognitive 52) crates/op-figma/src/instance/fingerprint.rs:202— op_figma::instance::fingerprint::score has cognitive complexity 52 (threshold 15). Drivers by points: if/else 29 (45 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_figma::instance::apply::apply_to_node (cognitive 47) crates/op-figma/src/instance/apply.rs:188— op_figma::instance::apply::apply_to_node has cognitive complexity 47 (threshold 15). Drivers by points: if/else 19 (39 pts), boolean chains 5, loops 1 (2 pts), match/switch 1 (nesting depth added 21). 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.
op_figma::clipboard::parse_clipboard_html_styles (cognitive 42) crates/op-figma/src/clipboard.rs:333— op_figma::clipboard::parse_clipboard_html_styles has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (34 pts), match/switch 1 (4 pts), loops 2 (3 pts), boolean chains 1 (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.
op_figma::node_mapper::style_references::resolve_on_node (cognitive 41) crates/op-figma/src/node_mapper/style_references.rs:121— op_figma::node_mapper::style_references::resolve_on_node has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (31 pts), boolean chains 5, match/switch 1 (3 pts), loops 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_figma::vector_decoder::scale_command_path (cognitive 39) crates/op-figma/src/vector_decoder.rs:96— op_figma::vector_decoder::scale_command_path has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 4 (9 pts), boolean chains 8 (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.
op_figma::vector_decoder::assemble_region_paths (cognitive 36) crates/op-figma/src/vector_decoder.rs:627— op_figma::vector_decoder::assemble_region_paths has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (27 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_figma::boolean_fallback::apply_result_paint_to_artwork (cognitive 34) crates/op-figma/src/boolean_fallback.rs:264— op_figma::boolean_fallback::apply_result_paint_to_artwork has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 5 (15 pts), match/switch 1 (nesting depth added 18). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
op_figma::instance::assignment::seed_assignments_from_instances::collect_geom (cognitive 34) crates/op-figma/src/instance/assignment.rs:127— op_figma::instance::assignment::seed_assignments_from_instances::collect_geom has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 3 (9 pts), boolean chains 4 (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. This shape REPEATS in the file: 2 other methods here (op_figma::instance::assignment::seed_assignments_from_instances, op_figma::instance::assignment::seed_assignments_from_instances::collect) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
op_figma::instance::assignment::seed_assignments_from_instances::collect (cognitive 31) crates/op-figma/src/instance/assignment.rs:51— op_figma::instance::assignment::seed_assignments_from_instances::collect has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 3 (9 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. This shape REPEATS in the file: 2 other methods here (op_figma::instance::assignment::seed_assignments_from_instances, op_figma::instance::assignment::seed_assignments_from_instances::collect_geom) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
op_figma::instance::fingerprint::assign_pooled (cognitive 30) crates/op-figma/src/instance/fingerprint.rs:346— op_figma::instance::fingerprint::assign_pooled has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 4 (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.
op_figma::clipboard::decode_html_entities (cognitive 28) crates/op-figma/src/clipboard.rs:258— op_figma::clipboard::decode_html_entities has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_figma::instance::swap_filter::filter_swap_stale_derived (cognitive 28) crates/op-figma/src/instance/swap_filter.rs:23— op_figma::instance::swap_filter::filter_swap_stale_derived has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 3, loops 3, match/switch 2 (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.
op_figma::vector_decoder::decode_figma_path_blob (cognitive 28) crates/op-figma/src/vector_decoder.rs:193— op_figma::vector_decoder::decode_figma_path_blob has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (24 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_figma::vector_decoder::scan_numbers (cognitive 28) crates/op-figma/src/vector_decoder.rs:251— op_figma::vector_decoder::scan_numbers has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 3 (8 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.
op_figma::converters::convert_vector (cognitive 27) crates/op-figma/src/converters.rs:562— op_figma::converters::convert_vector has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 5 (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.
op_figma::instance::apply::merge_entry_lists (cognitive 27) crates/op-figma/src/instance/apply.rs:89— op_figma::instance::apply::merge_entry_lists has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (20 pts), loops 2 (5 pts), match/switch 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_figma::instance::foreign_session::resolve_group (cognitive 23) crates/op-figma/src/instance/foreign_session.rs:72— op_figma::instance::foreign_session::resolve_group has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (8 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.
op_figma::collect_top_level_blocks (cognitive 21) crates/op-figma/src/lib.rs:219— op_figma::collect_top_level_blocks has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (18 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_figma::container::fig_to_binary_parts (cognitive 21) crates/op-figma/src/container.rs:113— op_figma::container::fig_to_binary_parts has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 2 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_figma::node_mapper::style_references::resolve_style_references (cognitive 20) crates/op-figma/src/node_mapper/style_references.rs:9— op_figma::node_mapper::style_references::resolve_style_references has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_figma::vector_decoder::decode_vector_network_blob (cognitive 20) crates/op-figma/src/vector_decoder.rs:490— op_figma::vector_decoder::decode_vector_network_blob has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 3, loops 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
op_figma::instance::assignment::guessed_mapping_is_implausible (cognitive 18) crates/op-figma/src/instance/assignment.rs:314— op_figma::instance::assignment::guessed_mapping_is_implausible has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, loops 2, match/switch 1 (nesting depth added 5). Of this number, 16 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_figma::instance::assignment::seed_assignments_from_instances (cognitive 17) crates/op-figma/src/instance/assignment.rs:42— op_figma::instance::assignment::seed_assignments_from_instances has cognitive complexity 17 (threshold 15). Drivers by points: if/else 20 (50 pts), loops 10 (24 pts), boolean chains 6, match/switch 1 (2 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. This shape REPEATS in the file: 2 other methods here (op_figma::instance::assignment::seed_assignments_from_instances::collect, op_figma::instance::assignment::seed_assignments_from_instances::collect_geom) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
op_figma::instance::fingerprint::assign (cognitive 17) crates/op-figma/src/instance/fingerprint.rs:415— op_figma::instance::fingerprint::assign has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (4 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.
op_mcp::parser::arguments_field (cognitive 113) crates/op-mcp/src/parser.rs:173— op_mcp::parser::arguments_field has cognitive complexity 113 (threshold 15). Drivers by points: if/else 32 (78 pts), loops 9 (21 pts), boolean chains 12, match/switch 1 (2 pts) (nesting depth added 59). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_mcp::parser::parse_flat_object_body (cognitive 76) crates/op-mcp/src/parser.rs:393— op_mcp::parser::parse_flat_object_body has cognitive complexity 76 (threshold 15). Drivers by points: if/else 21 (49 pts), loops 7 (16 pts), boolean chains 9, match/switch 1 (2 pts) (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_mcp::script_runner::repair_truncated_script (cognitive 52) crates/op-mcp/src/script_runner.rs:510— op_mcp::script_runner::repair_truncated_script has cognitive complexity 52 (threshold 15). Drivers by points: if/else 20 (37 pts), match/switch 3 (8 pts), boolean chains 4, loops 3 (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.
op_mcp::script_runner::balance_brackets (cognitive 44) crates/op-mcp/src/script_runner.rs:422— op_mcp::script_runner::balance_brackets has cognitive complexity 44 (threshold 15). Drivers by points: if/else 9 (27 pts), loops 6 (14 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_mcp::script_runner_dotted_keys::repair_dotted_object_keys (cognitive 42) crates/op-mcp/src/script_runner_dotted_keys.rs:29— op_mcp::script_runner_dotted_keys::repair_dotted_object_keys has cognitive complexity 42 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 4 (10 pts), boolean chains 6 (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.
op_mcp::batch_program::explicitly_sized_append_lines (cognitive 38) crates/op-mcp/src/batch_program.rs:418— op_mcp::batch_program::explicitly_sized_append_lines has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (33 pts), loops 2 (3 pts), boolean chains 2 (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.
op_mcp::script_runner::escape_raw_newlines_in_quoted_strings (cognitive 35) crates/op-mcp/src/script_runner.rs:132— op_mcp::script_runner::escape_raw_newlines_in_quoted_strings has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (27 pts), match/switch 2 (5 pts), boolean chains 2, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_mcp::codegen_plan_store::validate_plan (cognitive 34) crates/op-mcp/src/codegen_plan_store.rs:173— op_mcp::codegen_plan_store::validate_plan has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 8 (16 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.
op_mcp::batch_get::resolve_refs_in_node (cognitive 29) crates/op-mcp/src/batch_get.rs:171— op_mcp::batch_get::resolve_refs_in_node has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 5 (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.
op_mcp::batch_program_exec_ops::execute_image (cognitive 28) crates/op-mcp/src/batch_program_exec_ops.rs:236— op_mcp::batch_program_exec_ops::execute_image has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (20 pts), match/switch 3 (5 pts), 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.
op_mcp::batch_layered_guidelines::generate_section_guidelines (cognitive 27) crates/op-mcp/src/batch_layered_guidelines.rs:7— op_mcp::batch_layered_guidelines::generate_section_guidelines has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (15 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.
op_mcp::script_runner_overlay::restore (cognitive 27) crates/op-mcp/src/script_runner_overlay.rs:46— op_mcp::script_runner_overlay::restore has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 2, 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.
op_mcp::batch_design_wire::capture_raw_json_value (cognitive 26) crates/op-mcp/src/batch_design_wire.rs:173— op_mcp::batch_design_wire::capture_raw_json_value has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 2 (5 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_mcp::batch_design_normalize::normalize_pencil_autolayout_dialect (cognitive 25) crates/op-mcp/src/batch_design_normalize.rs:92— op_mcp::batch_design_normalize::normalize_pencil_autolayout_dialect has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 3 (7 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_mcp::codegen_plan_store::submit_chunk_result (cognitive 23) crates/op-mcp/src/codegen_plan_store.rs:514— op_mcp::codegen_plan_store::submit_chunk_result has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (19 pts), loops 2, boolean chains 1, match/switch 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.
op_mcp::batch_design_dsl::assemble_insert_forest (cognitive 22) crates/op-mcp/src/batch_design_dsl.rs:71— op_mcp::batch_design_dsl::assemble_insert_forest has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 2 (7 pts), loops 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_mcp::batch_design::dispatch_batch_design (cognitive 21) crates/op-mcp/src/batch_design.rs:180— op_mcp::batch_design::dispatch_batch_design has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 4 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_mcp::batch_design_wire::parse_item (cognitive 21) crates/op-mcp/src/batch_design_wire.rs:70— op_mcp::batch_design_wire::parse_item has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_mcp::batch_program_parse::replace_single_quote_delimiters (cognitive 21) crates/op-mcp/src/batch_program_parse.rs:129— op_mcp::batch_program_parse::replace_single_quote_delimiters has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 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.
op_mcp::codegen_plan_store_assembly::assemble_plan (cognitive 20) crates/op-mcp/src/codegen_plan_store_assembly.rs:13— op_mcp::codegen_plan_store_assembly::assemble_plan has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (18 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.
op_mcp::batch_design_wire::parse_string (cognitive 18) crates/op-mcp/src/batch_design_wire.rs:281— op_mcp::batch_design_wire::parse_string has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (4 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_mcp::script_runner_fences::extract (cognitive 18) crates/op-mcp/src/script_runner_fences.rs:11— op_mcp::script_runner_fences::extract has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, loops 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_mcp::batch_design_fill_normalize::normalize_fill_item (cognitive 17) crates/op-mcp/src/batch_design_fill_normalize.rs:19— op_mcp::batch_design_fill_normalize::normalize_fill_item has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 1 (2 pts), match/switch 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.
op_mcp::parser::params_body_if_present (cognitive 17) crates/op-mcp/src/parser.rs:339— op_mcp::parser::params_body_if_present has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_mcp::script_runner_dotted_keys::dotted_key_at (cognitive 17) crates/op-mcp/src/script_runner_dotted_keys.rs:117— op_mcp::script_runner_dotted_keys::dotted_key_at has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 4 (5 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.
+ 4 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (7 corresponding lines) · ×29
Edited copy of a member (7 corresponding lines) crates/op-host-native/src/backend/skia.rs:447— crates/op-host-native/src/backend/skia.rs:447-453 | crates/op-host-native/src/backend/skia.rs:505-513 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/op-orchestrator/src/role_post_pass/surface_structure.rs:203— crates/op-orchestrator/src/role_post_pass/surface_structure.rs:203-212 | crates/op-orchestrator/src/stub_repair.rs:260-266 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/op-design-lint/src/detectors/spacing.rs:80— crates/op-design-lint/src/detectors/spacing.rs:80-86 | crates/op-design-lint/src/detectors/spacing.rs:88-94 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/op-process-io/src/process_tree.rs:343— crates/op-process-io/src/process_tree.rs:343-349 | crates/op-process-io/src/process_tree.rs:396-402 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/op-editor-ui/src/widgets/canvas_selection_overlay.rs:185— crates/op-editor-ui/src/widgets/canvas_selection_overlay.rs:185-192 | crates/op-engine-ffi/src/lifecycle_wake.rs:3-9 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/op-editor-ui/src/widgets/property_panel_commit.rs:434— crates/op-editor-ui/src/widgets/property_panel_commit.rs:434-440 | crates/op-orchestrator/src/cleanup_root_and_nav.rs:324-331 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/op-acp/src/jsonrpc.rs:42— crates/op-acp/src/jsonrpc.rs:42-50 | crates/op-collab-host/src/runtime/network.rs:212-218 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/op-editor-ui/src/widgets/agent_settings_builtin_layout.rs:122— crates/op-editor-ui/src/widgets/agent_settings_builtin_layout.rs:122-128 | crates/op-editor-ui/src/widgets/ai_chat_model_picker.rs:359-365 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/op-mcp/src/effect_normalize.rs:239— crates/op-mcp/src/effect_normalize.rs:239-248 | crates/op-mcp/src/batch_program_dialect_fields.rs:77-83 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/op-orchestrator/src/geometry_row_fixes.rs:176— crates/op-orchestrator/src/geometry_row_fixes.rs:176-183 | crates/op-orchestrator/src/loop_finalize.rs:209-215 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/op-editor-ui/src/widgets/account_menu.rs:64— crates/op-editor-ui/src/widgets/account_menu.rs:64-70 | crates/op-editor-ui/src/widgets/property_panel_interactions.rs:370-377 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/op-editor-ui/src/widgets/export_dialog.rs:86— crates/op-editor-ui/src/widgets/export_dialog.rs:86-92 | crates/op-editor-ui/src/widgets/save_name_dialog.rs:41-47 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/op-orchestrator/src/sidebar_archetype.rs:351— crates/op-orchestrator/src/sidebar_archetype.rs:351-357 | crates/op-orchestrator/src/wire_screen_navigation.rs:696-702 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/op-editor-ui/src/widgets/mobile_chrome.rs:357— crates/op-editor-ui/src/widgets/mobile_chrome.rs:357-363 | crates/op-editor-ui/src/widgets/property_panel_color_variables.rs:398-404 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/op-host-desktop/src/git_jobs.rs:330— crates/op-host-desktop/src/git_jobs.rs:330-336 | crates/op-host-desktop/src/remote_image_host.rs:109-119 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/op-figma/src/corner_geometry.rs:7— crates/op-figma/src/corner_geometry.rs:7-13 | crates/op-figma/src/vector_decoder.rs:68-74 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/op-host-services/src/mcp_live/design_md_output.rs:282— crates/op-host-services/src/mcp_live/design_md_output.rs:282-290 | crates/op-editor-core/src/screen_sets.rs:104-110 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/op-orchestrator/src/square_ring_repair.rs:141— crates/op-orchestrator/src/square_ring_repair.rs:141-147 | crates/op-orchestrator/src/stub_repair.rs:189-195 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/op-cli/src/cli_conversion.rs:89— crates/op-cli/src/cli_conversion.rs:89-95 | crates/op-cli/src/command_mappers.rs:47-54 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/op-editor-core/src/ref_resolve.rs:166— crates/op-editor-core/src/ref_resolve.rs:166-172 | crates/op-host-web/src/web_fonts.rs:272-279 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/op-chrome-extension-core/src/account.rs:319— crates/op-chrome-extension-core/src/account.rs:319-325 | crates/op-editor-ui/src/collab_avatar_runtime.rs:650-658 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/op-orchestrator/src/text_fit.rs:175— crates/op-orchestrator/src/text_fit.rs:175-181 | crates/op-orchestrator/src/touch_target_floor.rs:160-166 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/op-host-web/src/collab_sync.rs:732— crates/op-host-web/src/collab_sync.rs:732-738 | crates/op-host-web/src/web_auth_sync.rs:166-172 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/op-orchestrator/src/repair_record.rs:723— crates/op-orchestrator/src/repair_record.rs:723-729 | crates/op-orchestrator/src/validation_dump.rs:583-591 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/op-chat-agent/src/design_agent_tools/root_seed.rs:556— crates/op-chat-agent/src/design_agent_tools/root_seed.rs:556-562 | crates/op-mcp/src/guidelines_tools.rs:248-254 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (14 lines × 2) crates/op-chat-agent/src/design_agent_tools.rs:80— crates/op-chat-agent/src/design_agent_tools.rs:80-93 | crates/op-chat-agent/src/design_agent_tools.rs:244-257 — both copies are in the same file, so extract the 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 `state` to `&EditorState` in one and `&mut EditorState` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (14 lines × 2) crates/op-editor-core/src/command_node/builders.rs:105— crates/op-editor-core/src/command_node/builders.rs:105-118 | crates/op-figma/src/lib.rs:426-440 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/command_node/builders.rs:105` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) crates/op-editor-core/src/command_node/builders.rs:164— crates/op-editor-core/src/command_node/builders.rs:164-177 | crates/op-figma/src/lib.rs:515-529 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/command_node/builders.rs:164` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) crates/op-editor-core/src/svg_import/path_data.rs:65— crates/op-editor-core/src/svg_import/path_data.rs:65-78 | crates/op-editor-core/src/svg_path_data.rs:86-99 — before extracting anything, compare `crates/op-editor-core/src/svg_import/path_data.rs` and `crates/op-editor-core/src/svg_path_data.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/svg_import/path_data.rs:65` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_builtin_model_menu.rs:310— crates/op-editor-ui/src/widgets/agent_settings_builtin_model_menu.rs:310-323 | crates/op-editor-ui/src/widgets/agent_settings_builtin_parts.rs:205-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 both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/agent_settings_builtin_model_menu.rs:310` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_builtin_model_menu.rs:389— crates/op-editor-ui/src/widgets/agent_settings_builtin_model_menu.rs:389-402 | crates/op-editor-ui/src/widgets/agent_settings_builtin_model_menu.rs:404-417 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/op-editor-ui/src/widgets/file_menu_paint.rs:286— crates/op-editor-ui/src/widgets/file_menu_paint.rs:286-299 | crates/op-editor-ui/src/widgets/file_menu_paint.rs:342-355 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/file_menu_paint.rs:286` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 2) crates/op-editor-ui/src/widgets/home_works_list.rs:299— crates/op-editor-ui/src/widgets/home_works_list.rs:299-312 | crates/op-editor-ui/src/widgets/home_works_list.rs:368-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 `crates/op-editor-ui/src/widgets/home_works_list.rs:299` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) crates/op-editor-ui/src/widgets/property_panel_widget.rs:201— crates/op-editor-ui/src/widgets/property_panel_widget.rs:201-214 | crates/op-editor-ui/src/widgets/property_panel_widget.rs:241-254 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/property_panel_widget.rs:201` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) crates/op-editor-ui/src/widgets/scene_template_card_actions.rs:115— crates/op-editor-ui/src/widgets/scene_template_card_actions.rs:115-128 | crates/op-editor-ui/src/widgets/scene_template_touch_density.rs:274-287 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/scene_template_card_actions.rs:115` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) crates/op-editor-ui/src/widgets/toolbar.rs:138— crates/op-editor-ui/src/widgets/toolbar.rs:138-151 | crates/op-editor-ui/src/widgets/toolbar.rs:156-169 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/toolbar.rs:138` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) crates/op-engine-ffi/src/lifecycle.rs:608— crates/op-engine-ffi/src/lifecycle.rs:608-621 | crates/op-engine-ffi/src/lifecycle.rs:692-705 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/op-figma/src/node_mapper.rs:121— crates/op-figma/src/node_mapper.rs:121-134 | crates/op-figma/src/node_mapper.rs:189-202 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/op-figma/src/node_mapper.rs:137` calls `iter`, `enumerate` and `crates/op-figma/src/node_mapper.rs:203` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) crates/op-host-desktop/src/image_search_session.rs:52— crates/op-host-desktop/src/image_search_session.rs:52-65 | crates/op-host-services/src/mcp_serve/enrich_images_tool.rs:141-154 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (14 lines × 2) crates/op-host-native/src/widget_host/variables_panel_row_press.rs:79— crates/op-host-native/src/widget_host/variables_panel_row_press.rs:79-92 | crates/op-host-web/src/widget_host/variables_panel_rows.rs:165-178 — before extracting anything, compare `crates/op-host-native/src/widget_host/variables_panel_row_press.rs` and `crates/op-host-web/src/widget_host/variables_panel_rows.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (14 lines × 2) crates/op-host-native/src/widget_host/workspace.rs:170— crates/op-host-native/src/widget_host/workspace.rs:170-183 | crates/op-host-web/src/widget_host/studio_workspace.rs:149-162 — before extracting anything, compare `crates/op-host-native/src/widget_host/workspace.rs` and `crates/op-host-web/src/widget_host/studio_workspace.rs` 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-native/src/widget_host/workspace.rs:170` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 2) crates/op-host-services/src/mcp_serve/sniff.rs:135— crates/op-host-services/src/mcp_serve/sniff.rs:135-148 | crates/op-mcp/src/parser.rs:462-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-services/src/mcp_serve/sniff.rs:135` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) crates/op-host-services/src/web_credentials.rs:285— crates/op-host-services/src/web_credentials.rs:285-298 | crates/op-host-services/src/web_credentials.rs:415-428 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/op-host-web/src/dom_io/html_directory_session.rs:348— crates/op-host-web/src/dom_io/html_directory_session.rs:348-361 | crates/op-host-web/src/dom_io/html_zip_session.rs:380-393 — before extracting anything, compare `crates/op-host-web/src/dom_io/html_directory_session.rs` and `crates/op-host-web/src/dom_io/html_zip_session.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-web/src/dom_io/html_directory_session.rs:348` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-host-web/src/dom_io/html_directory_session.rs:345` calls `abandon_if_stale` and `crates/op-host-web/src/dom_io/html_zip_session.rs:379` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) crates/op-host-web/src/live_sync.rs:193— crates/op-host-web/src/live_sync.rs:193-206 | crates/op-host-web/src/web_image_panel.rs:388-401 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-web/src/live_sync.rs:193` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) crates/op-html/src/lib.rs:419— crates/op-html/src/lib.rs:419-432 | crates/op-html/src/mapper_grid.rs:126-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-html/src/lib.rs:419` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) crates/op-html/src/mapper_margin.rs:353— crates/op-html/src/mapper_margin.rs:353-366 | crates/op-html/src/mapper_wrap.rs:194-207 — 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 lines × 2) crates/op-html/src/project_zip.rs:216— crates/op-html/src/project_zip.rs:216-229 | crates/op-html/src/project_zip_range.rs:239-252 — before extracting anything, compare `crates/op-html/src/project_zip.rs` and `crates/op-html/src/project_zip_range.rs` as WHOLE FILES: this scan already matched 3 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-html/src/project_zip.rs:216` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) crates/op-mcp/src/node_attr_tools.rs:209— crates/op-mcp/src/node_attr_tools.rs:209-222 | crates/op-mcp/src/node_attr_tools.rs:345-358 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-mcp/src/node_attr_tools.rs:209` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) crates/op-mcp/src/selected_ops_tools.rs:21— crates/op-mcp/src/selected_ops_tools.rs:21-34 | crates/op-mcp/src/selected_ops_tools.rs:277-290 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/op-ai/src/agent_settings_state.rs:154— crates/op-ai/src/agent_settings_state.rs:154-169 | crates/op-editor-core/src/agent_settings.rs:144-159 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (16 lines × 2) crates/op-auth-bridge/src/collab_claims.rs:514— crates/op-auth-bridge/src/collab_claims.rs:514-529 | crates/op-collab/src/profile_validation.rs:109-124 — before extracting anything, compare `crates/op-auth-bridge/src/collab_claims.rs` and `crates/op-collab/src/profile_validation.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 72 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-auth-bridge/src/collab_claims.rs:514` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) crates/op-chat-agent/src/design_agent_diagnostics.rs:527— crates/op-chat-agent/src/design_agent_diagnostics.rs:527-542 | crates/op-image-enrich/src/targets.rs:703-718 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-chat-agent/src/design_agent_diagnostics.rs:527` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) crates/op-cli/src/html_cli.rs:237— crates/op-cli/src/html_cli.rs:237-252 | crates/op-host-desktop/src/html_import_session.rs:191-206 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (16 lines × 2) crates/op-editor-core/src/fills/primary.rs:65— crates/op-editor-core/src/fills/primary.rs:65-80 | crates/op-editor-core/src/fills/primary.rs:91-106 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/fills/primary.rs:65` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) crates/op-editor-core/src/pen.rs:283— crates/op-editor-core/src/pen.rs:283-298 | crates/op-editor-core/src/pen.rs:332-347 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/pen.rs:283` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) crates/op-editor-core/src/ref_resolve.rs:342— crates/op-editor-core/src/ref_resolve.rs:342-357 | crates/op-editor-core/src/ref_resolve.rs:449-464 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_images/paint.rs:130— crates/op-editor-ui/src/widgets/agent_settings_images/paint.rs:130-145 | crates/op-editor-ui/src/widgets/agent_settings_images/paint.rs:671-686 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/agent_settings_images/paint.rs:130` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) crates/op-editor-ui/src/widgets/canvas_viewport_paint.rs:601— crates/op-editor-ui/src/widgets/canvas_viewport_paint.rs:601-616 | crates/op-editor-ui/src/widgets/canvas_viewport_paint.rs:693-708 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/op-engine-ffi/src/lifecycle.rs:556— crates/op-engine-ffi/src/lifecycle.rs:556-571 | crates/op-engine-ffi/src/lifecycle.rs:650-665 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/op-host-desktop/src/persistence.rs:283— crates/op-host-desktop/src/persistence.rs:283-298 | crates/op-host-desktop/src/persistence.rs:307-322 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-desktop/src/persistence.rs:283` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) crates/op-host-native/src/widget_host/preview_slideshow.rs:327— crates/op-host-native/src/widget_host/preview_slideshow.rs:327-342 | crates/op-host-web/src/widget_host/preview_slideshow.rs:486-501 — before extracting anything, compare `crates/op-host-native/src/widget_host/preview_slideshow.rs` and `crates/op-host-web/src/widget_host/preview_slideshow.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 171 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (16 lines × 2) crates/op-host-native/src/widget_host/variables_panel_row_press.rs:379— crates/op-host-native/src/widget_host/variables_panel_row_press.rs:379-394 | crates/op-host-web/src/widget_host/variables_panel_rows.rs:321-336 — before extracting anything, compare `crates/op-host-native/src/widget_host/variables_panel_row_press.rs` and `crates/op-host-web/src/widget_host/variables_panel_rows.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (16 lines × 2) crates/op-host-services/src/export_html_structured.rs:291— crates/op-host-services/src/export_html_structured.rs:291-306 | crates/op-host-services/src/export_pptx.rs:444-461 — before extracting anything, compare `crates/op-host-services/src/export_html_structured.rs` and `crates/op-host-services/src/export_pptx.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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, `crates/op-host-services/src/export_html_structured.rs:286` calls `is_some`, `trim`, `is_empty` and `crates/op-host-services/src/export_pptx.rs:443` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16 lines × 2) crates/op-html/src/css/cascade_parser.rs:392— crates/op-html/src/css/cascade_parser.rs:392-407 | crates/op-html/src/css/cascade_shared.rs:11-26 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-html/src/css/cascade_parser.rs:392` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) crates/op-html/src/css/cascade_parser.rs:396— crates/op-html/src/css/cascade_parser.rs:396-411 | crates/op-html/src/css/cascade_shared.rs:46-61 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-html/src/css/cascade_parser.rs:396` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) crates/op-html/src/dom.rs:322— crates/op-html/src/dom.rs:322-337 | crates/op-html/src/srcset.rs:412-427 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (16 lines × 2) crates/op-html/src/special_image.rs:141— crates/op-html/src/special_image.rs:141-156 | crates/op-html/src/special_image.rs:216-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-html/src/special_image.rs:141` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) crates/op-html/src/text_children.rs:413— crates/op-html/src/text_children.rs:413-428 | crates/op-html/src/text_children.rs:514-529 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-html/src/text_children.rs:413` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) crates/op-orchestrator/src/card_inner_padding.rs:308— crates/op-orchestrator/src/card_inner_padding.rs:308-323 | crates/op-orchestrator/src/touch_target_floor.rs:236-251 — before extracting anything, compare `crates/op-orchestrator/src/card_inner_padding.rs` and `crates/op-orchestrator/src/touch_target_floor.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (16 lines × 2) crates/op-orchestrator/src/concurrent.rs:290— crates/op-orchestrator/src/concurrent.rs:290-305 | crates/op-orchestrator/src/concurrent.rs:370-385 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-orchestrator/src/concurrent.rs:290` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) crates/op-host-services/src/doc_io.rs:294— crates/op-host-services/src/doc_io.rs:294-309 | crates/op-host-services/src/web_canvas_server/doc_routes.rs:119-134 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-services/src/doc_io.rs:294` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-host-services/src/doc_io.rs:291` calls `has_streaming_turn`, `minimize` and `crates/op-host-services/src/web_canvas_server/doc_routes.rs: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 (16 lines × 2) crates/op-host-native/src/widget_host/preview_slideshow.rs:131— crates/op-host-native/src/widget_host/preview_slideshow.rs:131-146 | crates/op-host-web/src/widget_host/preview_slideshow.rs:286-301 — before extracting anything, compare `crates/op-host-native/src/widget_host/preview_slideshow.rs` and `crates/op-host-web/src/widget_host/preview_slideshow.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 171 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 (16 lines × 2) crates/op-host-services/src/design_session.rs:67— crates/op-host-services/src/design_session.rs:67-84 | crates/op-host-services/src/design_variants.rs:56-71 — before extracting anything, compare `crates/op-host-services/src/design_session.rs` and `crates/op-host-services/src/design_variants.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-services/src/design_session.rs:67` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (16 lines × 2) crates/op-editor-ui/src/widgets/file_menu_paint.rs:52— crates/op-editor-ui/src/widgets/file_menu_paint.rs:52-67 | crates/op-editor-ui/src/widgets/file_menu_paint.rs:74-89 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/file_menu_paint.rs:52` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crates/op-collab-relay-control-plane/src/http_client.rs:203— crates/op-collab-relay-control-plane/src/http_client.rs:203-215 | crates/op-collab-relay-locator-server/src/http.rs:571-583 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13 lines × 2) crates/op-editor-core/src/page_mutators.rs:173— crates/op-editor-core/src/page_mutators.rs:173-185 | crates/op-editor-core/src/page_mutators.rs:345-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/page_mutators.rs:173` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crates/op-editor-ui/src/widgets/account_menu.rs:223— crates/op-editor-ui/src/widgets/account_menu.rs:223-235 | crates/op-editor-ui/src/widgets/file_menu_paint.rs: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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/account_menu.rs:223` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crates/op-editor-ui/src/widgets/ai_chat_panel_header.rs:452— crates/op-editor-ui/src/widgets/ai_chat_panel_header.rs:452-464 | crates/op-editor-ui/src/widgets/ai_chat_panel_header.rs:467-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.
Duplicated block (13 lines × 2) crates/op-editor-ui/src/widgets/canvas_viewport_text.rs:196— crates/op-editor-ui/src/widgets/canvas_viewport_text.rs:196-208 | crates/op-editor-ui/src/widgets/canvas_viewport_text.rs:218-230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crates/op-editor-ui/src/widgets/layer_panel_walkers.rs:160— crates/op-editor-ui/src/widgets/layer_panel_walkers.rs:160-172 | crates/op-editor-ui/src/widgets/layer_panel_walkers.rs:189-201 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/layer_panel_walkers.rs:160` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-editor-ui/src/widgets/layer_panel_walkers.rs:186` calls `base`, `as_str` and `crates/op-editor-ui/src/widgets/layer_panel_walkers.rs:159` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) crates/op-editor-ui/src/widgets/property_panel_input_layout.rs:445— crates/op-editor-ui/src/widgets/property_panel_input_layout.rs:445-457 | crates/op-editor-ui/src/widgets/property_panel_layout.rs:453-465 — before extracting anything, compare `crates/op-editor-ui/src/widgets/property_panel_input_layout.rs` and `crates/op-editor-ui/src/widgets/property_panel_layout.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/property_panel_input_layout.rs:445` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13 lines × 2) crates/op-editor-ui/src/widgets/workspace_quality_paint.rs:264— crates/op-editor-ui/src/widgets/workspace_quality_paint.rs:264-277 | crates/op-editor-ui/src/widgets/workspace_quality_paint.rs:290-302 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/workspace_quality_paint.rs:264` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crates/op-engine-ffi/src/editor_chat.rs:549— crates/op-engine-ffi/src/editor_chat.rs:549-561 | crates/op-host-desktop/src/chat_session.rs:383-398 — before extracting anything, compare `crates/op-engine-ffi/src/editor_chat.rs` and `crates/op-host-desktop/src/chat_session.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-engine-ffi/src/editor_chat.rs:549` it begins part-way through the construct above it, so those 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 (13 lines × 2) crates/op-figma/src/image_resolver.rs:514— crates/op-figma/src/image_resolver.rs:514-526 | crates/op-figma/src/image_resolver.rs:546-558 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-figma/src/image_resolver.rs:514` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crates/op-host-desktop/src/mcp_config_io.rs:134— crates/op-host-desktop/src/mcp_config_io.rs:134-146 | crates/op-host-desktop/src/mcp_integrations_dsh.rs:103-115 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 2) crates/op-host-native/src/widget_host/preview_slideshow.rs:104— crates/op-host-native/src/widget_host/preview_slideshow.rs:104-116 | crates/op-host-web/src/widget_host/preview_slideshow.rs:260-272 — before extracting anything, compare `crates/op-host-native/src/widget_host/preview_slideshow.rs` and `crates/op-host-web/src/widget_host/preview_slideshow.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 171 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13 lines × 2) crates/op-host-native/src/widget_host/slides_panel.rs:334— crates/op-host-native/src/widget_host/slides_panel.rs:334-346 | crates/op-host-web/src/widget_host/slides_panel.rs:243-255 — before extracting anything, compare `crates/op-host-native/src/widget_host/slides_panel.rs` and `crates/op-host-web/src/widget_host/slides_panel.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-native/src/widget_host/slides_panel.rs:334` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crates/op-host-services/src/cli_model_discovery.rs:217— crates/op-host-services/src/cli_model_discovery.rs:217-229 | crates/op-host-services/src/cli_model_discovery_antigravity.rs:57-69 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-services/src/cli_model_discovery.rs:217` it does not close everything it opens, so those 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 (13 lines × 2) crates/op-host-services/src/web_canvas_server/online_run_loop.rs:226— crates/op-host-services/src/web_canvas_server/online_run_loop.rs:226-238 | crates/op-host-services/src/web_canvas_server/run_loop.rs:161-173 — before extracting anything, compare `crates/op-host-services/src/web_canvas_server/online_run_loop.rs` and `crates/op-host-services/src/web_canvas_server/run_loop.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-services/src/web_canvas_server/online_run_loop.rs:226` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/op-host-services/src/web_canvas_server/online_run_loop.rs:239` calls `clone` and `crates/op-host-services/src/web_canvas_server/run_loop.rs:174` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) crates/op-host-services/src/web_canvas_server/online_run_loop.rs:602— crates/op-host-services/src/web_canvas_server/online_run_loop.rs:602-614 | crates/op-host-services/src/web_canvas_server/online_run_loop.rs:618-630 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13 lines × 2) crates/op-orchestrator/src/cleanup_empty_content_bar.rs:168— crates/op-orchestrator/src/cleanup_empty_content_bar.rs:168-180 | crates/op-orchestrator/src/hero_bleed.rs:616-628 — before extracting anything, compare `crates/op-orchestrator/src/cleanup_empty_content_bar.rs` and `crates/op-orchestrator/src/hero_bleed.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-orchestrator/src/cleanup_empty_content_bar.rs:168` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crates/op-orchestrator/src/cleanup_slide_padding.rs:254— crates/op-orchestrator/src/cleanup_slide_padding.rs:254-266 | crates/op-orchestrator/src/cleanup_slide_padding.rs:357-369 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-orchestrator/src/cleanup_slide_padding.rs:254` it does not close everything it opens, so those 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 (13 lines × 2) crates/op-orchestrator/src/geometry_sidebar_rail.rs:133— crates/op-orchestrator/src/geometry_sidebar_rail.rs:133-145 | crates/op-orchestrator/src/geometry_starved_column.rs:457-469 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-orchestrator/src/geometry_sidebar_rail.rs:133` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crates/op-orchestrator/src/plan.rs:461— crates/op-orchestrator/src/plan.rs:461-473 | crates/op-orchestrator/src/plan_fallback_card.rs:135-147 — before extracting anything, compare `crates/op-orchestrator/src/plan.rs` and `crates/op-orchestrator/src/plan_fallback_card.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-orchestrator/src/plan.rs:461` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13 lines × 2) crates/op-editor-core/src/svg_import/path_data.rs:130— crates/op-editor-core/src/svg_import/path_data.rs:130-142 | crates/op-editor-core/src/svg_import/path_data.rs:154-166 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/svg_import/path_data.rs:130` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-editor-core/src/svg_import/path_data.rs:153` calls `quad_to_cubic` and `crates/op-editor-core/src/svg_import/path_data.rs:129` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) crates/op-editor-ui/src/widgets/canvas_layout_transition.rs:142— crates/op-editor-ui/src/widgets/canvas_layout_transition.rs:142-154 | crates/op-preview-core/src/binding_overlay_apply.rs:190-202 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/canvas_layout_transition.rs:142` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crates/op-host-web/src/dom_io/html_directory_session.rs:363— crates/op-host-web/src/dom_io/html_directory_session.rs:363-375 | crates/op-host-web/src/dom_io/html_zip_session.rs:402-414 — before extracting anything, compare `crates/op-host-web/src/dom_io/html_directory_session.rs` and `crates/op-host-web/src/dom_io/html_zip_session.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) crates/op-editor-ui/src/widgets/component_browser_panel.rs:550— crates/op-editor-ui/src/widgets/component_browser_panel.rs:550-562 | crates/op-editor-ui/src/widgets/icon_picker_panel.rs:331-343 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 2) crates/op-orchestrator/src/validation_fixes_apply.rs:343— crates/op-orchestrator/src/validation_fixes_apply.rs:343-355 | crates/op-orchestrator/src/validation_fixes_apply.rs:382-394 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-orchestrator/src/validation_fixes_apply.rs:343` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
+ 2 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×25
Edited copy of a member (16 corresponding lines) crates/op-cli/src/skill_install_cli.rs:395— crates/op-cli/src/skill_install_cli.rs:395-410 | crates/op-host-desktop/src/mcp_integrations.rs:555-581 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/op-editor-core/src/fills/image.rs:138— crates/op-editor-core/src/fills/image.rs:138-153 | crates/op-editor-core/src/image_node_props.rs:43-58 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/op-mcp/src/reparent_tools.rs:66— crates/op-mcp/src/reparent_tools.rs:66-92 | crates/op-mcp/src/write_tools.rs:457-472 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/op-editor-ui/src/widgets/layer_panel_walkers.rs:157— crates/op-editor-ui/src/widgets/layer_panel_walkers.rs:157-172 | crates/op-editor-ui/src/widgets/layer_panel_walkers.rs:183-201 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/op-orchestrator/src/concurrent_echo_copy.rs:16— crates/op-orchestrator/src/concurrent_echo_copy.rs:16-36 | crates/op-orchestrator/src/concurrent_echo_interaction.rs:26-41 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/op-mcp/src/script_runner.rs:658— crates/op-mcp/src/script_runner.rs:658-673 | crates/op-orchestrator/src/parse.rs:72-89 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/op-orchestrator/src/category_grid_reflow.rs:41— crates/op-orchestrator/src/category_grid_reflow.rs:41-57 | crates/op-orchestrator/src/cleanup_empty_content_bar.rs:76-91 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) packaging/ios/Sources/OpPlayerView.swift:421— packaging/ios/Sources/OpPlayerView.swift:421-439 | packaging/ios/Sources/OpPlayerView.swift:441-456 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/op-host-desktop/src/brand_extract_host.rs:57— crates/op-host-desktop/src/brand_extract_host.rs:57-72 | crates/op-host-desktop/src/site_import_host.rs:56-73 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/op-orchestrator/src/unify_shared_nav.rs:368— crates/op-orchestrator/src/unify_shared_nav.rs:368-383 | crates/op-orchestrator/src/unify_shared_nav.rs:418-438 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/op-auth-bridge/src/collab_claims.rs:486— crates/op-auth-bridge/src/collab_claims.rs:486-501 | crates/op-collab-transport/src/admission.rs:638-654 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/op-host-desktop/src/a11y.rs:216— crates/op-host-desktop/src/a11y.rs:216-231 | crates/op-host-desktop/src/a11y.rs:249-264 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/op-orchestrator/src/app_shell_detect.rs:28— crates/op-orchestrator/src/app_shell_detect.rs:28-43 | crates/op-orchestrator/src/dashboard_columns.rs:148-163 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/op-host-native/src/widget_host/workspace.rs:737— crates/op-host-native/src/widget_host/workspace.rs:737-758 | crates/op-host-web/src/widget_host/studio_workspace_run.rs:288-303 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/op-editor-core/src/command_style_replace.rs:379— crates/op-editor-core/src/command_style_replace.rs:379-397 | crates/op-editor-core/src/command_style_replace.rs:399-414 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/op-editor-ui/src/widgets/canvas_viewport_image.rs:199— crates/op-editor-ui/src/widgets/canvas_viewport_image.rs:199-215 | crates/op-editor-ui/src/widgets/canvas_viewport_image/decode_registry.rs:74-89 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/op-orchestrator/src/spacing_repair.rs:65— crates/op-orchestrator/src/spacing_repair.rs:65-83 | crates/op-orchestrator/src/table_repair.rs:458-473 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/op-orchestrator/src/app_shell_detect.rs:61— crates/op-orchestrator/src/app_shell_detect.rs:61-78 | crates/op-orchestrator/src/role_post_pass/mobile_search_header.rs:149-164 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/op-figma/src/mappers.rs:26— crates/op-figma/src/mappers.rs:26-41 | crates/op-figma/src/mappers.rs:348-363 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/op-orchestrator/src/loop_finalize.rs:240— crates/op-orchestrator/src/loop_finalize.rs:240-255 | crates/op-orchestrator/src/map_template_palette.rs:116-132 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/op-editor-ui/src/widgets/component_browser_panel.rs:162— crates/op-editor-ui/src/widgets/component_browser_panel.rs:162-178 | crates/op-editor-ui/src/widgets/git_panel.rs:266-281 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/op-editor-ui/src/widgets/agent_settings_builtin_layout.rs:130— crates/op-editor-ui/src/widgets/agent_settings_builtin_layout.rs:130-146 | crates/op-editor-ui/src/widgets/agent_settings_builtin_model_menu.rs:51-66 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/op-orchestrator/src/concurrent_echo_copy.rs:63— crates/op-orchestrator/src/concurrent_echo_copy.rs:63-78 | crates/op-orchestrator/src/concurrent_echo_interaction.rs:47-64 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/op-html/src/srcset.rs:393— crates/op-html/src/srcset.rs:393-408 | crates/op-brand/src/css_select.rs:295-310 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) templates/step0/_generators/tpl_bookreview_carousel.py:272— templates/step0/_generators/tpl_bookreview_carousel.py:272-287 | templates/step0/_generators/tpl_story_carousel.py:256-275 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
WidgetHost::apply_cursor_move (cyclomatic 151) crates/op-host-web/src/widget_host/cursor_input.rs:17— WidgetHost::apply_cursor_move has cyclomatic complexity 151 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WidgetHost::paint_editor (cyclomatic 60) crates/op-host-web/src/widget_host/paint.rs:49— WidgetHost::paint_editor has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WidgetHost::apply_overlay_cursor_move (cyclomatic 53) crates/op-host-web/src/widget_host/overlay_cursor.rs:96— WidgetHost::apply_overlay_cursor_move has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WidgetHost::update_agent_settings_hover (cyclomatic 48) crates/op-host-web/src/widget_host/agent_settings_hover.rs:14— WidgetHost::update_agent_settings_hover has cyclomatic complexity 48 (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.
WidgetHost::run_home_hit (cyclomatic 44) crates/op-host-web/src/widget_host/studio_home.rs:89— WidgetHost::run_home_hit has cyclomatic complexity 44 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
WidgetHost::apply_escape (cyclomatic 43) crates/op-host-web/src/widget_host/keyboard_escape.rs:16— WidgetHost::apply_escape has cyclomatic complexity 43 (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.
WidgetHost::apply_backspace (cyclomatic 33) crates/op-host-web/src/widget_host/keyboard.rs:138— WidgetHost::apply_backspace 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.
WidgetHost::run_workspace_action (cyclomatic 29) crates/op-host-web/src/widget_host/studio_workspace.rs:101— WidgetHost::run_workspace_action has cyclomatic complexity 29 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
WidgetHost::apply_text (cyclomatic 28) crates/op-host-web/src/widget_host/keyboard.rs:17— WidgetHost::apply_text 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.
WidgetHost::apply_delete (cyclomatic 26) crates/op-host-web/src/widget_host/keyboard.rs:364— WidgetHost::apply_delete 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.
WidgetHost::focused_input_selected_text (cyclomatic 25) crates/op-host-web/src/widget_host/keyboard_text_inputs.rs:145— WidgetHost::focused_input_selected_text 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.
WidgetHost::update_dropdown_hover (cyclomatic 25) crates/op-host-web/src/widget_host/overlay_cursor.rs:469— WidgetHost::update_dropdown_hover 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.
WidgetHost::apply_press (cyclomatic 25) crates/op-host-web/src/widget_host/press.rs:130— WidgetHost::apply_press 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.
WidgetHost::apply_release_with_viewport (cyclomatic 25) crates/op-host-web/src/widget_host/release_input.rs:36— WidgetHost::apply_release_with_viewport 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.
WidgetHost::apply_send (cyclomatic 24) crates/op-host-web/src/widget_host/keyboard.rs:259— WidgetHost::apply_send 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.
WidgetHost::apply_release (cyclomatic 21) crates/op-host-web/src/widget_host/release_input.rs:136— WidgetHost::apply_release 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.
WidgetHost::apply_wheel_with_canvas_delta (cyclomatic 20) crates/op-host-web/src/widget_host/wheel_pan.rs:169— WidgetHost::apply_wheel_with_canvas_delta 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.
WidgetHost::apply_pan_gesture (cyclomatic 19) crates/op-host-web/src/widget_host/wheel_pan.rs:260— WidgetHost::apply_pan_gesture 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.
WidgetHost::dispatch_file_menu_press (cyclomatic 18) crates/op-host-web/src/widget_host/chrome_menu_press.rs:13— WidgetHost::dispatch_file_menu_press has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
WidgetHost::apply_git_text (cyclomatic 18) crates/op-host-web/src/widget_host/keyboard_git.rs:7— WidgetHost::apply_git_text 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.
WidgetHost::paint_menu_modal_and_panel_layers (cyclomatic 18) crates/op-host-web/src/widget_host/paint_overlays.rs:80— WidgetHost::paint_menu_modal_and_panel_layers 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.
WidgetHost::press_topmost_overlay_tiers (cyclomatic 18) crates/op-host-web/src/widget_host/press_overlay_tiers.rs:17— WidgetHost::press_topmost_overlay_tiers 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.
WidgetHost::apply_git_send (cyclomatic 17) crates/op-host-web/src/widget_host/keyboard_git.rs:162— WidgetHost::apply_git_send 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.
WidgetHost::press_top_bar_tier (cyclomatic 16) crates/op-host-web/src/widget_host/press_chrome_tiers.rs:124— WidgetHost::press_top_bar_tier 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.
R4 · Test Coverage· No test reaches this file · ×24
No test reaches this file crates/op-host-web/src/op_ck_bridge.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file crates/op-html/assets/snapshot-extractor.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/op-chrome-extension/popup.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/op-chrome-extension/design-capture.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/op-chrome-extension/client.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file crates/op-host-web/src/figma_temp_worker.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/op-chrome-extension/background.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file crates/op-host-web/src/op_ck_image_cache.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/op-chrome-extension/picker.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/op-chrome-extension/capture.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/op-chrome-extension/i18n.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/op-chrome-extension/account.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/op-chrome-extension/design-evidence.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/op-chrome-extension/scripts/check-locales.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/op-chrome-extension/scripts/check-design-evidence.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/op-chrome-extension/popup-status.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/scripts/generate-iconify-catalog.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/op-chrome-extension/scripts/check-sw-imports.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/op-chrome-extension/core-registry.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/op-chrome-extension/design-md.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/op-chrome-extension/wasm-core.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/op-vscode/build.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/op-chrome-extension/popup-worker-actions.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
op_host_services::mcp_serve::registry::rebuild_registry (cyclomatic 151) crates/op-host-services/src/mcp_serve/registry.rs:9— op_host_services::mcp_serve::registry::rebuild_registry has cyclomatic complexity 151 (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.
op_host_services::web_canvas_server::connection::dispatch (cyclomatic 59) crates/op-host-services/src/web_canvas_server/connection.rs:101— op_host_services::web_canvas_server::connection::dispatch has cyclomatic complexity 59 (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.
op_host_services::chat_http_server::run_opencode_turn (cyclomatic 58) crates/op-host-services/src/chat_http_server.rs:246— op_host_services::chat_http_server::run_opencode_turn has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_host_services::mcp_serve::sniff::walk_top_level (cyclomatic 41) crates/op-host-services/src/mcp_serve/sniff.rs:57— op_host_services::mcp_serve::sniff::walk_top_level has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_host_services::web_canvas_server::handle_web_canvas_request (cyclomatic 40) crates/op-host-services/src/web_canvas_server.rs:460— op_host_services::web_canvas_server::handle_web_canvas_request has cyclomatic complexity 40 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_host_services::mcp_serve::read_http_request (cyclomatic 31) crates/op-host-services/src/mcp_serve.rs:440— op_host_services::mcp_serve::read_http_request 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.
op_host_services::export_pptx::unexpressible (cyclomatic 26) crates/op-host-services/src/export_pptx.rs:365— op_host_services::export_pptx::unexpressible has cyclomatic complexity 26 (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.
op_host_services::web_canvas_server::connection_ai_routes::serve_ai_route (cyclomatic 25) crates/op-host-services/src/web_canvas_server/connection_ai_routes.rs:38— op_host_services::web_canvas_server::connection_ai_routes::serve_ai_route has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_host_services::web_image_generate_workbench::generate_workbench (cyclomatic 25) crates/op-host-services/src/web_image_generate_workbench.rs:97— op_host_services::web_image_generate_workbench::generate_workbench 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.
op_host_services::mcp_live::connection::serve_connection (cyclomatic 23) crates/op-host-services/src/mcp_live/connection.rs:115— op_host_services::mcp_live::connection::serve_connection 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.
op_host_services::cli_model_discovery_antigravity::parse_antigravity_models (cyclomatic 22) crates/op-host-services/src/cli_model_discovery_antigravity.rs:35— op_host_services::cli_model_discovery_antigravity::parse_antigravity_models 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.
op_host_services::chat_claude::map_message (cyclomatic 21) crates/op-host-services/src/chat_claude.rs:349— op_host_services::chat_claude::map_message 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.
op_host_services::cli_model_discovery::parse_grok_models (cyclomatic 21) crates/op-host-services/src/cli_model_discovery.rs:210— op_host_services::cli_model_discovery::parse_grok_models 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.
op_host_services::image_relevance_judge_evidence::parse_verdict_text (cyclomatic 21) crates/op-host-services/src/image_relevance_judge_evidence.rs:19— op_host_services::image_relevance_judge_evidence::parse_verdict_text 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.
op_host_services::ai_proxy::proxy_builtin_for_identity (cyclomatic 20) crates/op-host-services/src/ai_proxy.rs:386— op_host_services::ai_proxy::proxy_builtin_for_identity 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.
op_host_services::web_credentials::validate_and_merge (cyclomatic 20) crates/op-host-services/src/web_credentials.rs:303— op_host_services::web_credentials::validate_and_merge 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.
op_host_services::design_md_evidence::evidence_provenance (cyclomatic 19) crates/op-host-services/src/design_md_evidence.rs:416— op_host_services::design_md_evidence::evidence_provenance 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.
op_host_services::design_md_evidence::validate_evidence (cyclomatic 19) crates/op-host-services/src/design_md_evidence.rs:535— op_host_services::design_md_evidence::validate_evidence 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.
op_host_services::web_canvas_server::serve_options::parse_serve_web_args_managed (cyclomatic 19) crates/op-host-services/src/web_canvas_server/serve_options.rs:113— op_host_services::web_canvas_server::serve_options::parse_serve_web_args_managed has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
op_host_services::export_html_structured::unexpressible (cyclomatic 18) crates/op-host-services/src/export_html_structured.rs:232— op_host_services::export_html_structured::unexpressible 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.
op_host_services::web_canvas_server::run_loop::run_web_canvas (cyclomatic 17) crates/op-host-services/src/web_canvas_server/run_loop.rs:28— op_host_services::web_canvas_server::run_loop::run_web_canvas 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.
op_host_services::chat_subprocess_parse::parse_line (cyclomatic 16) crates/op-host-services/src/chat_subprocess_parse.rs:10— op_host_services::chat_subprocess_parse::parse_line has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_host_services::design_md_evidence_roles::from_sanitized_json (cyclomatic 16) crates/op-host-services/src/design_md_evidence_roles.rs:11— op_host_services::design_md_evidence_roles::from_sanitized_json 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.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×23
Edited copy of a member (15 corresponding lines) crates/op-orchestrator/src/chip_label_adopt.rs:235— crates/op-orchestrator/src/chip_label_adopt.rs:235-249 | crates/op-orchestrator/src/cleanup_fixed_mobile_rail.rs:163-185 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) crates/op-editor-ui/src/widgets/git_panel_ssh_keys.rs:28— crates/op-editor-ui/src/widgets/git_panel_ssh_keys.rs:28-42 | crates/op-editor-ui/src/widgets/git_panel_tracked_picker.rs:48-68 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) crates/op-orchestrator/src/cleanup_root_and_nav.rs:258— crates/op-orchestrator/src/cleanup_root_and_nav.rs:258-284 | crates/op-orchestrator/src/cleanup_root_and_nav.rs:333-347 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) crates/op-cli/src/app_control_cli.rs:227— crates/op-cli/src/app_control_cli.rs:227-253 | crates/op-host-native/src/widget_host/press_helpers.rs:199-213 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) crates/op-design-lint/src/node_util.rs:365— crates/op-design-lint/src/node_util.rs:365-379 | crates/op-editor-core/src/variables_resolve.rs:90-104 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) crates/op-image-enrich/src/net/providers.rs:278— crates/op-image-enrich/src/net/providers.rs:278-295 | crates/op-image-enrich/src/net/providers.rs:304-318 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) crates/op-editor-core/src/color_picker.rs:64— crates/op-editor-core/src/color_picker.rs:64-82 | crates/op-editor-core/src/color_picker.rs:86-100 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) crates/op-editor-core/src/prompt_center_catalog.rs:114— crates/op-editor-core/src/prompt_center_catalog.rs:114-128 | crates/op-editor-core/src/scene_template_catalog.rs:243-257 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) crates/op-engine-ffi/src/text.rs:154— crates/op-engine-ffi/src/text.rs:154-168 | crates/op-engine-ffi/src/text.rs:180-195 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) crates/op-host-web/src/dom_io/html_directory_session.rs:344— crates/op-host-web/src/dom_io/html_directory_session.rs:344-361 | crates/op-host-web/src/dom_io/html_zip_session.rs:379-393 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) crates/op-editor-core/src/variant_wire.rs:86— crates/op-editor-core/src/variant_wire.rs:86-100 | crates/op-editor-core/src/variant_wire.rs:123-137 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) crates/op-host-desktop/src/keyboard_input.rs:442— crates/op-host-desktop/src/keyboard_input.rs:442-457 | crates/op-host-desktop/src/keyboard_input.rs:462-476 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) templates/step0/_generators/tpl_infographic_map.py:201— templates/step0/_generators/tpl_infographic_map.py:201-226 | templates/step0/_generators/tpl_infographic_weekly_review.py:196-210 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) crates/op-editor-core/src/prompt_center_keyboard.rs:13— crates/op-editor-core/src/prompt_center_keyboard.rs:13-27 | crates/op-editor-core/src/scene_template_keyboard.rs:18-32 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) crates/op-editor-core/src/svg_import/lexer.rs:51— crates/op-editor-core/src/svg_import/lexer.rs:51-68 | crates/op-html/src/html_encoding.rs:222-236 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) crates/op-design-lint/src/detectors/top_anchored_bars.rs:309— crates/op-design-lint/src/detectors/top_anchored_bars.rs:309-334 | crates/op-design-lint/src/detectors/top_anchored_bars.rs:339-353 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) crates/op-editor-ui/src/collab_avatar_runtime.rs:522— crates/op-editor-ui/src/collab_avatar_runtime.rs:522-539 | crates/op-editor-ui/src/collab_avatar_runtime.rs:551-565 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) crates/op-orchestrator/src/chip_repair.rs:71— crates/op-orchestrator/src/chip_repair.rs:71-85 | crates/op-orchestrator/src/chip_repair.rs:161-175 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) crates/op-auth-bridge/src/collab_claims.rs:98— crates/op-auth-bridge/src/collab_claims.rs:98-112 | crates/op-auth-bridge/src/collab_claims.rs:130-144 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) crates/op-host-native/src/widget_host/workspace.rs:419— crates/op-host-native/src/widget_host/workspace.rs:419-433 | crates/op-host-web/src/widget_host/studio_workspace.rs:332-346 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) crates/op-engine-ffi/src/editor_ime.rs:175— crates/op-engine-ffi/src/editor_ime.rs:175-189 | crates/op-engine-ffi/src/editor_ime.rs:199-214 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) crates/op-editor-ui/src/widgets/property_panel_flex.rs:624— crates/op-editor-ui/src/widgets/property_panel_flex.rs:624-638 | crates/op-editor-ui/src/widgets/property_panel_stroke.rs:136-150 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) templates/step0/_generators/tpl1.py:155— templates/step0/_generators/tpl1.py:155-169 | templates/step0/_generators/tpl2.py:134-152 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×23
Edited copy of a member (17 corresponding lines) crates/op-chat-agent/src/chat_attachments.rs:56— crates/op-chat-agent/src/chat_attachments.rs:56-72 | crates/op-host-services/src/chat_builtin_http_vision.rs:11-40 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) crates/op-engine-jni/src/callbacks.rs:102— crates/op-engine-jni/src/callbacks.rs:102-125 | crates/op-engine-jni/src/callbacks.rs:131-147 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) crates/op-editor-ui/src/widgets/toolbar.rs:135— crates/op-editor-ui/src/widgets/toolbar.rs:135-151 | crates/op-editor-ui/src/widgets/toolbar.rs:153-169 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) crates/op-config-store/src/lib.rs:302— crates/op-config-store/src/lib.rs:302-318 | crates/op-git/src/lib.rs:159-179 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) crates/op-host-native/src/backend/skia.rs:535— crates/op-host-native/src/backend/skia.rs:535-551 | crates/op-host-native/src/backend/skia.rs:564-582 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) crates/op-editor-core/src/state.rs:204— crates/op-editor-core/src/state.rs:204-223 | crates/op-editor-core/src/state.rs:235-251 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) crates/op-figma/src/tree.rs:53— crates/op-figma/src/tree.rs:53-69 | crates/op-figma/src/tree.rs:74-90 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) crates/op-editor-ui/src/widgets/home_surface_paint_panels.rs:348— crates/op-editor-ui/src/widgets/home_surface_paint_panels.rs:348-369 | crates/op-editor-ui/src/widgets/home_surface_paint_panels.rs:421-437 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) crates/op-editor-ui/src/widgets/canvas_viewport_image.rs:308— crates/op-editor-ui/src/widgets/canvas_viewport_image.rs:308-324 | crates/op-html/src/resources_image_metadata.rs:149-165 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) crates/op-mcp/src/selected_ops_tools.rs:20— crates/op-mcp/src/selected_ops_tools.rs:20-36 | crates/op-mcp/src/selected_ops_tools.rs:276-292 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) crates/op-design-lint/src/detectors/spacing.rs:259— crates/op-design-lint/src/detectors/spacing.rs:259-278 | crates/op-host-services/src/pre_validator.rs:138-154 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) crates/op-host-desktop/src/image_search_session.rs:51— crates/op-host-desktop/src/image_search_session.rs:51-67 | crates/op-host-services/src/mcp_serve/enrich_images_tool.rs:140-161 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) crates/op-editor-core/src/ref_resolve.rs:425— crates/op-editor-core/src/ref_resolve.rs:425-442 | crates/op-editor-core/src/uikit.rs:479-495 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) crates/op-html/src/special.rs:278— crates/op-html/src/special.rs:278-294 | crates/op-html/src/special.rs:342-358 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) crates/op-orchestrator/src/role_post_pass.rs:166— crates/op-orchestrator/src/role_post_pass.rs:166-182 | crates/op-orchestrator/src/role_post_pass.rs:204-220 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) crates/op-engine-jni/src/bindings_editor.rs:318— crates/op-engine-jni/src/bindings_editor.rs:318-334 | crates/op-engine-jni/src/bindings_editor.rs:509-525 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) crates/op-host-native/src/boolean_ops.rs:110— crates/op-host-native/src/boolean_ops.rs:110-126 | crates/op-host-native/src/boolean_ops.rs:128-144 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) crates/op-collab-transport/src/runtime.rs:408— crates/op-collab-transport/src/runtime.rs:408-424 | crates/op-collab-transport/src/runtime.rs:435-451 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) crates/op-editor-ui/src/widgets/collab_panel_interaction.rs:272— crates/op-editor-ui/src/widgets/collab_panel_interaction.rs:272-288 | crates/op-editor-ui/src/widgets/collab_panel_interaction.rs:292-312 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) crates/op-editor-ui/src/widgets/property_panel_color_variables.rs:46— crates/op-editor-ui/src/widgets/property_panel_color_variables.rs:46-63 | crates/op-editor-ui/src/widgets/property_panel_corner.rs:83-99 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) crates/op-host-services/src/web_image_generate.rs:319— crates/op-host-services/src/web_image_generate.rs:319-335 | crates/op-host-services/src/web_image_generate_atlas.rs:124-140 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) crates/op-engine-ffi/src/editor.rs:352— crates/op-engine-ffi/src/editor.rs:352-369 | crates/op-engine-ffi/src/editor_ime.rs:23-39 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) crates/op-host-native/src/widget_host/workspace.rs:576— crates/op-host-native/src/widget_host/workspace.rs:576-593 | crates/op-host-web/src/widget_host/studio_workspace.rs:473-489 — 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 (5 corresponding lines) · ×22
Edited copy of a member (5 corresponding lines) templates/step0/_generators/tpl_infographic_steps.py:263— templates/step0/_generators/tpl_infographic_steps.py:263-267 | templates/step0/_generators/tpl_infographic_timeline.py:307-312 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) templates/step0/_generators/appkit.py:80— templates/step0/_generators/appkit.py:80-85 | templates/step0/_generators/tpl_poster_city_music_fest.py:99-103 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) crates/op-orchestrator/src/app_shell_detect.rs:19— crates/op-orchestrator/src/app_shell_detect.rs:19-23 | crates/op-orchestrator/src/table_repair.rs:71-75 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) crates/op-collab-smoke/src/fault_transport.rs:127— crates/op-collab-smoke/src/fault_transport.rs:127-131 | crates/op-collab-smoke/src/owner.rs:305-309 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) crates/op-editor-core/src/walkers.rs:367— crates/op-editor-core/src/walkers.rs:367-371 | crates/op-orchestrator/src/variants.rs:463-469 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) crates/op-host-services/src/export_share.rs:85— crates/op-host-services/src/export_share.rs:85-90 | crates/op-host-services/src/export_pptx.rs:85-89 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) crates/op-codegen/src/ai/parse.rs:270— crates/op-codegen/src/ai/parse.rs:270-274 | crates/op-editor-ui/src/widgets/icon_catalog.rs:465-470 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) crates/op-host-services/src/mcp_live/design_md_route.rs:470— crates/op-host-services/src/mcp_live/design_md_route.rs:470-474 | crates/op-host-services/src/web_image_generate_workbench.rs:84-91 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) crates/op-editor-ui/src/widgets/collab_panel_paint.rs:243— crates/op-editor-ui/src/widgets/collab_panel_paint.rs:243-247 | crates/op-editor-ui/src/widgets/home_works_list.rs:164-169 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) crates/op-ai-skills/src/resolve_style.rs:346— crates/op-ai-skills/src/resolve_style.rs:346-350 | crates/op-ai-skills/src/style_guide/mapping.rs:35-44 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) crates/op-host-web/src/canvaskit/backend.rs:187— crates/op-host-web/src/canvaskit/backend.rs:187-191 | crates/op-host-web/src/canvaskit/ops.rs:40-52 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) crates/op-editor-ui/src/widgets/property_panel_snapshot.rs:58— crates/op-editor-ui/src/widgets/property_panel_snapshot.rs:58-62 | crates/op-orchestrator/src/variable_binding.rs:342-346 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) crates/op-figma/src/mask.rs:20— crates/op-figma/src/mask.rs:20-28 | crates/op-figma/src/vector_decoder.rs:347-351 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) crates/op-collab-relay-protocol/src/pairing.rs:295— crates/op-collab-relay-protocol/src/pairing.rs:295-299 | crates/op-collab-relay-protocol/src/sensitive.rs:55-59 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) crates/op-host-web/src/dom_io.rs:191— crates/op-host-web/src/dom_io.rs:191-195 | crates/op-host-web/src/dom_io/figma_import.rs:177-181 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) crates/op-orchestrator/src/chip_label_adopt.rs:260— crates/op-orchestrator/src/chip_label_adopt.rs:260-264 | crates/op-orchestrator/src/geometry_metadata_badges.rs:172-176 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) crates/op-orchestrator/src/cleanup_mobile_dense.rs:184— crates/op-orchestrator/src/cleanup_mobile_dense.rs:184-188 | crates/op-orchestrator/src/cleanup_root_and_nav.rs:155-164 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) crates/op-editor-ui/src/widgets/ai_chat_panel.rs:762— crates/op-editor-ui/src/widgets/ai_chat_panel.rs:762-766 | crates/op-editor-ui/src/widgets/property_panel_code_framework.rs:61-70 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) crates/op-editor-ui/src/widgets/property_panel_interactions.rs:137— crates/op-editor-ui/src/widgets/property_panel_interactions.rs:137-141 | crates/op-orchestrator/src/wire_screen_navigation.rs:678-682 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) crates/op-editor-ui/src/widgets/file_menu_paint.rs:248— crates/op-editor-ui/src/widgets/file_menu_paint.rs:248-255 | crates/op-editor-ui/src/widgets/layer_context_menu.rs:363-367 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) crates/op-engine-jni/src/bindings.rs:588— crates/op-engine-jni/src/bindings.rs:588-592 | crates/op-engine-napi/src/bindings.rs:528-533 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) crates/op-engine-ffi/src/viewport.rs:19— crates/op-engine-ffi/src/viewport.rs:19-23 | crates/op-html/src/mapper_margin.rs:82-86 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×21
Edited copy of a member (18 corresponding lines) crates/op-pen-loader/src/widget_payload.rs:119— crates/op-pen-loader/src/widget_payload.rs:119-136 | crates/op-pen-loader/src/widget_payload.rs:155-175 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) crates/op-engine-ffi/src/editor_builtin_provider.rs:394— crates/op-engine-ffi/src/editor_builtin_provider.rs:394-415 | crates/op-host-services/src/chat_builtin_http_wire.rs:121-138 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) crates/op-editor-ui/src/widgets/layer_panel.rs:235— crates/op-editor-ui/src/widgets/layer_panel.rs:235-257 | crates/op-editor-ui/src/widgets/layer_panel.rs:336-353 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) crates/op-orchestrator/src/radial_repair_preinsert_normalize.rs:102— crates/op-orchestrator/src/radial_repair_preinsert_normalize.rs:102-119 | crates/op-orchestrator/src/radial_repair_preinsert_normalize.rs:316-336 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) crates/op-orchestrator/src/request_dimensions.rs:172— crates/op-orchestrator/src/request_dimensions.rs:172-189 | crates/op-orchestrator/src/request_dimensions.rs:191-213 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) crates/op-orchestrator/src/motion_recipes.rs:382— crates/op-orchestrator/src/motion_recipes.rs:382-402 | crates/op-orchestrator/src/sibling_style_drift.rs:175-192 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) crates/op-engine-jni/src/bindings.rs:308— crates/op-engine-jni/src/bindings.rs:308-328 | crates/op-engine-napi/src/bindings.rs:88-105 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) crates/op-host-native/src/widget_host/touch_panel_gesture.rs:306— crates/op-host-native/src/widget_host/touch_panel_gesture.rs:306-323 | crates/op-host-native/src/widget_host/touch_panel_gesture.rs:330-348 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) templates/step0/_generators/tpl_compare_do_dont.py:159— templates/step0/_generators/tpl_compare_do_dont.py:159-176 | templates/step0/_generators/tpl_journal_card.py:137-154 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) crates/op-host-services/src/web_canvas_server/export_routes.rs:14— crates/op-host-services/src/web_canvas_server/export_routes.rs:14-31 | crates/op-host-services/src/web_canvas_server/export_routes.rs:141-158 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) crates/op-html/src/color.rs:322— crates/op-html/src/color.rs:322-342 | crates/op-html/src/srcset.rs:411-428 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) crates/op-editor-ui/src/widgets/prompt_center_panel_paint.rs:523— crates/op-editor-ui/src/widgets/prompt_center_panel_paint.rs:523-540 | crates/op-editor-ui/src/widgets/scene_template_panel_paint.rs:412-429 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) crates/op-editor-host-core/src/collab/guest.rs:344— crates/op-editor-host-core/src/collab/guest.rs:344-361 | crates/op-editor-host-core/src/collab/owner.rs:427-445 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) crates/op-host-services/src/provider_probe.rs:495— crates/op-host-services/src/provider_probe.rs:495-513 | crates/op-host-services/src/provider_probe_copilot.rs:85-102 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) crates/op-editor-ui/src/widgets/agent_settings_caret.rs:135— crates/op-editor-ui/src/widgets/agent_settings_caret.rs:135-152 | crates/op-editor-ui/src/widgets/property_panel_text_input.rs:53-71 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) crates/op-engine-ffi/src/editor_builtin_provider.rs:274— crates/op-engine-ffi/src/editor_builtin_provider.rs:274-291 | crates/op-engine-ffi/src/editor_builtin_provider.rs:296-314 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) crates/op-host-desktop/src/keyboard_input.rs:587— crates/op-host-desktop/src/keyboard_input.rs:587-609 | crates/op-host-desktop/src/keyboard_input.rs:643-660 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) crates/op-pen-loader/src/bin/pen2op.rs:88— crates/op-pen-loader/src/bin/pen2op.rs:88-107 | crates/op-pen-loader/src/payload/video_alias.rs:17-34 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) crates/op-editor-ui/src/widgets/property_panel_compositing.rs:438— crates/op-editor-ui/src/widgets/property_panel_compositing.rs:438-455 | crates/op-editor-ui/src/widgets/property_panel_compositing.rs:500-520 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) crates/op-mcp/src/component_tools.rs:26— crates/op-mcp/src/component_tools.rs:26-44 | crates/op-mcp/src/component_tools.rs:92-109 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) crates/op-orchestrator/src/run_tests_b4.rs:42— crates/op-orchestrator/src/run_tests_b4.rs:42-60 | crates/op-orchestrator/src/run_tests_b4.rs:63-80 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
op_html::css::selectors::pseudo_matches (cyclomatic 36) crates/op-html/src/css/selectors.rs:263— op_html::css::selectors::pseudo_matches has cyclomatic complexity 36 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_html::mapper_margin::finish_children (cyclomatic 28) crates/op-html/src/mapper_margin.rs:166— op_html::mapper_margin::finish_children 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.
op_html::css::declarations::expand_background (cyclomatic 26) crates/op-html/src/css/declarations.rs:359— op_html::css::declarations::expand_background has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: op_html::css::declarations::expand_declaration (cyclomatic 35) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
op_html::project_zip_range::parse_html_zip_central_directory (cyclomatic 24) crates/op-html/src/project_zip_range.rs:160— op_html::project_zip_range::parse_html_zip_central_directory 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.
op_html::transform::function_matrix (cyclomatic 23) crates/op-html/src/transform.rs:400— op_html::transform::function_matrix has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_html::css::declaration_syntax::split_whitespace_top_level (cyclomatic 22) crates/op-html/src/css/declaration_syntax.rs:215— op_html::css::declaration_syntax::split_whitespace_top_level 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.
op_html::mapper_grid::wrap_grid_rows (cyclomatic 20) crates/op-html/src/mapper_grid.rs:27— op_html::mapper_grid::wrap_grid_rows 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.
op_html::mapper_visual::map_gradient (cyclomatic 20) crates/op-html/src/mapper_visual.rs:307— op_html::mapper_visual::map_gradient 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.
op_html::html_encoding::encoding_from_meta_attributes (cyclomatic 19) crates/op-html/src/html_encoding.rs:73— op_html::html_encoding::encoding_from_meta_attributes 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.
op_html::srcset::parse_srcset (cyclomatic 19) crates/op-html/src/srcset.rs:188— op_html::srcset::parse_srcset 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.
op_html::resources_css_urls::unescape_css (cyclomatic 18) crates/op-html/src/resources_css_urls.rs:213— op_html::resources_css_urls::unescape_css 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.
op_html::special_image::apply_intrinsic_axes (cyclomatic 18) crates/op-html/src/special_image.rs:241— op_html::special_image::apply_intrinsic_axes 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.
op_html::special_image::parent_content_box (cyclomatic 18) crates/op-html/src/special_image.rs:354— op_html::special_image::parent_content_box has cyclomatic complexity 18 (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.
op_html::import_html_with_resources (cyclomatic 17) crates/op-html/src/lib.rs:188— op_html::import_html_with_resources 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.
op_html::css::declaration_syntax::split_top_level (cyclomatic 17) crates/op-html/src/css/declaration_syntax.rs:169— op_html::css::declaration_syntax::split_top_level has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (op_html::css::declaration_syntax::find_top_level) 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.
op_html::css::declaration_syntax::find_top_level (cyclomatic 17) crates/op-html/src/css/declaration_syntax.rs:287— op_html::css::declaration_syntax::find_top_level has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (op_html::css::declaration_syntax::split_top_level) 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.
op_html::mapper_grid::top_level_tokens (cyclomatic 17) crates/op-html/src/mapper_grid.rs:518— op_html::mapper_grid::top_level_tokens 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.
op_html::mapper_visual_syntax::split_whitespace_top_level (cyclomatic 17) crates/op-html/src/mapper_visual_syntax.rs:88— op_html::mapper_visual_syntax::split_whitespace_top_level 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.
op_html::css::cascade::compute_raw (cyclomatic 16) crates/op-html/src/css/cascade.rs:392— op_html::css::cascade::compute_raw 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.
op_html::css::selectors::attribute_matches (cyclomatic 16) crates/op-html/src/css/selectors.rs:233— op_html::css::selectors::attribute_matches 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.
Duplicated block (15 lines × 2) crates/op-collab-host/src/runtime/network/connection.rs:65— crates/op-collab-host/src/runtime/network/connection.rs:65-79 | crates/op-collab-host/src/runtime/network/connection.rs:218-232 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-collab-host/src/runtime/network/connection.rs:65` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) crates/op-collab-smoke/src/fault_guest.rs:76— crates/op-collab-smoke/src/fault_guest.rs:76-90 | crates/op-collab-smoke/src/fault_guest.rs:151-165 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) crates/op-editor-ui/src/widgets/ai_chat_transcript_design.rs:453— crates/op-editor-ui/src/widgets/ai_chat_transcript_design.rs:453-467 | crates/op-editor-ui/src/widgets/ai_chat_transcript_steps.rs:226-240 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (15 lines × 2) crates/op-engine-ffi/src/editor_model_discovery.rs:84— crates/op-engine-ffi/src/editor_model_discovery.rs:84-98 | crates/op-host-desktop/src/builtin_model_refresh_host.rs:61-75 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-engine-ffi/src/editor_model_discovery.rs:84` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) crates/op-engine-jni/src/bindings.rs:199— crates/op-engine-jni/src/bindings.rs:199-213 | crates/op-engine-napi/src/bindings.rs:211-225 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-engine-jni/src/bindings.rs:199` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) crates/op-host-native/src/widget_host/variables_preset_press.rs:236— crates/op-host-native/src/widget_host/variables_preset_press.rs:236-250 | crates/op-host-web/src/widget_host/keyboard_edit_ops.rs:72-86 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (15 lines × 2) crates/op-host-native/src/widget_host/workspace.rs:104— crates/op-host-native/src/widget_host/workspace.rs:104-118 | crates/op-host-web/src/widget_host/studio_workspace.rs:81-95 — before extracting anything, compare `crates/op-host-native/src/widget_host/workspace.rs` and `crates/op-host-web/src/widget_host/studio_workspace.rs` 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. 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 (15 lines × 2) crates/op-host-services/src/chat_spawn.rs:156— crates/op-host-services/src/chat_spawn.rs:156-170 | crates/op-host-services/src/provider_probe.rs:308-322 — before extracting anything, compare `crates/op-host-services/src/chat_spawn.rs` and `crates/op-host-services/src/provider_probe.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-services/src/chat_spawn.rs: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 (15 lines × 2) crates/op-host-services/src/web_canvas_server/connection.rs:210— crates/op-host-services/src/web_canvas_server/connection.rs:210-224 | crates/op-host-services/src/web_canvas_server/online_run_loop.rs:596-610 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-services/src/web_canvas_server/connection.rs:210` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) crates/op-host-services/src/web_canvas_server/online_run_loop.rs:526— crates/op-host-services/src/web_canvas_server/online_run_loop.rs:526-540 | crates/op-host-services/src/web_canvas_server/online_run_loop.rs:575-589 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (15 lines × 2) crates/op-orchestrator/src/card_inner_padding.rs:44— crates/op-orchestrator/src/card_inner_padding.rs:44-58 | crates/op-orchestrator/src/touch_target_floor.rs:23-37 — before extracting anything, compare `crates/op-orchestrator/src/card_inner_padding.rs` and `crates/op-orchestrator/src/touch_target_floor.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) crates/op-orchestrator/src/geometry_card_rail_fixes.rs:142— crates/op-orchestrator/src/geometry_card_rail_fixes.rs:142-156 | crates/op-orchestrator/src/geometry_diagnostics_collect.rs:344-358 — 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 (15 lines × 2) crates/op-preview-core/src/motion.rs:163— crates/op-preview-core/src/motion.rs:163-177 | crates/op-preview-core/src/motion.rs:226-240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) crates/op-cli/src/command_mappers.rs:233— crates/op-cli/src/command_mappers.rs:233-247 | crates/op-cli/src/command_mappers.rs:290-304 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) crates/op-host-native/src/widget_host/variables_panel_row_press.rs:98— crates/op-host-native/src/widget_host/variables_panel_row_press.rs:98-112 | crates/op-host-native/src/widget_host/variables_panel_row_press.rs:333-347 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) crates/op-host-web/src/widget_host/variables_panel_rows.rs:183— crates/op-host-web/src/widget_host/variables_panel_rows.rs:183-197 | crates/op-host-web/src/widget_host/variables_panel_rows.rs:287-301 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-web/src/widget_host/variables_panel_rows.rs: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.
Duplicated block (15 lines × 2) crates/op-html/src/text_children.rs:531— crates/op-html/src/text_children.rs:531-545 | crates/op-html/src/text_inline.rs:318-332 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (15 lines × 2) crates/op-editor-ui/src/widgets/icon_catalog.rs:394— crates/op-editor-ui/src/widgets/icon_catalog.rs:394-408 | crates/op-editor-ui/src/widgets/icon_catalog.rs:413-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/icon_catalog.rs:394` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-editor-ui/src/widgets/icon_catalog.rs:410` calls `num`, `attr`, `as_deref` and `crates/op-editor-ui/src/widgets/icon_catalog.rs:391` 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) templates/step0/_generators/tpl_qa_carousel.py:337— templates/step0/_generators/tpl_qa_carousel.py:337-351 | templates/step0/_generators/tpl_yearreview_carousel.py:404-418 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (15 lines × 2) packaging/ios/Sources/AuthCodeFormViewController.swift:201— packaging/ios/Sources/AuthCodeFormViewController.swift:201-215 | packaging/ios/Sources/NativeLoginViewController.swift:224-238 — 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 `packaging/ios/Sources/AuthCodeFormViewController.swift:201` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
op_editor_core::svg_import::path_data::parse_path_d (cyclomatic 30) crates/op-editor-core/src/svg_import/path_data.rs:12— op_editor_core::svg_import::path_data::parse_path_d 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.
op_editor_core::variables_resolve::replace::replace_in_node (cyclomatic 30) crates/op-editor-core/src/variables_resolve/replace.rs:43— op_editor_core::variables_resolve::replace::replace_in_node 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.
op_editor_core::workspace_edit::resolve_workspace_edit_scope (cyclomatic 29) crates/op-editor-core/src/workspace_edit.rs:270— op_editor_core::workspace_edit::resolve_workspace_edit_scope has cyclomatic complexity 29 (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.
op_editor_core::variables_resolve::resolve_node_for_canvas (cyclomatic 28) crates/op-editor-core/src/variables_resolve.rs:251— op_editor_core::variables_resolve::resolve_node_for_canvas 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.
op_editor_core::svg_path_data::absolute_segments (cyclomatic 27) crates/op-editor-core/src/svg_path_data.rs:55— op_editor_core::svg_path_data::absolute_segments has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_editor_core::host_settings_commit::commit_settings_focus (cyclomatic 26) crates/op-editor-core/src/host_settings_commit.rs:48— op_editor_core::host_settings_commit::commit_settings_focus 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.
op_editor_core::svg_import::style::parse_svg_color (cyclomatic 22) crates/op-editor-core/src/svg_import/style.rs:147— op_editor_core::svg_import::style::parse_svg_color has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_editor_core::svg_import::scale::scale_svg_path (cyclomatic 20) crates/op-editor-core/src/svg_import/scale.rs:46— op_editor_core::svg_import::scale::scale_svg_path 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.
op_editor_core::command_style_replace::apply_replacement (cyclomatic 19) crates/op-editor-core/src/command_style_replace.rs:185— op_editor_core::command_style_replace::apply_replacement 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.
op_editor_core::host_variables_commit::commit_row_draft (cyclomatic 19) crates/op-editor-core/src/host_variables_commit.rs:231— op_editor_core::host_variables_commit::commit_row_draft 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.
op_editor_core::scene_template_catalog::parse_scene_template_catalogue (cyclomatic 19) crates/op-editor-core/src/scene_template_catalog.rs:454— op_editor_core::scene_template_catalog::parse_scene_template_catalogue has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_editor_core::svg_import::lexer::parse_attrs (cyclomatic 19) crates/op-editor-core/src/svg_import/lexer.rs:87— op_editor_core::svg_import::lexer::parse_attrs has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
op_editor_core::icon_path_normalize::absolute_segments (cyclomatic 18) crates/op-editor-core/src/icon_path_normalize.rs:306— op_editor_core::icon_path_normalize::absolute_segments 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.
op_editor_core::prompt_center_catalog::parse_prompt_catalogue (cyclomatic 18) crates/op-editor-core/src/prompt_center_catalog.rs:285— op_editor_core::prompt_center_catalog::parse_prompt_catalogue 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.
op_editor_core::editor_ui_state::workspace_variants::variant_pick_commands (cyclomatic 17) crates/op-editor-core/src/editor_ui_state/workspace_variants.rs:211— op_editor_core::editor_ui_state::workspace_variants::variant_pick_commands 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.
op_editor_core::instance_override::route_display_state (cyclomatic 17) crates/op-editor-core/src/instance_override.rs:335— op_editor_core::instance_override::route_display_state 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.
op_editor_core::svg_import::path_data::tokenize_path (cyclomatic 16) crates/op-editor-core/src/svg_import/path_data.rs:270— op_editor_core::svg_import::path_data::tokenize_path 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.
op_editor_core::svg_path_data::tokenize_path (cyclomatic 16) crates/op-editor-core/src/svg_path_data.rs:416— op_editor_core::svg_path_data::tokenize_path 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.
op_editor_core::variables_resolve::roots_have_tokens::node_has_token (cyclomatic 16) crates/op-editor-core/src/variables_resolve.rs:379— op_editor_core::variables_resolve::roots_have_tokens::node_has_token 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.
Duplicated block (6 lines × 3) crates/op-auth-bridge/src/collab_claims.rs:507— crates/op-auth-bridge/src/collab_claims.rs:507-512 | crates/op-collab-transport/src/admission.rs:657-662 | crates/op-collab/src/profile_validation.rs:102-107 — before extracting anything, compare `crates/op-auth-bridge/src/collab_claims.rs` and `crates/op-collab-transport/src/admission.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-auth-bridge/src/collab_claims.rs:507` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-auth-bridge/src/collab_claims.rs:504` calls `is_empty`, `contains` and `crates/op-collab-transport/src/admission.rs:656` 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) crates/op-codegen/src/codegen_tailwind_jsx.rs:27— crates/op-codegen/src/codegen_tailwind_jsx.rs:27-32 | crates/op-util/src/xml_escape.rs:11-16 | crates/op-util/src/xml_escape.rs:26-31 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-codegen/src/codegen_tailwind_jsx.rs:27` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/op-util/src/xml_escape.rs:33` calls `push_str` and `crates/op-util/src/xml_escape.rs:18` 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) crates/op-editor-core/src/instance_override.rs:97— crates/op-editor-core/src/instance_override.rs:97-102 | crates/op-editor-core/src/ref_resolve.rs:227-233 | crates/op-editor-core/src/ref_resolve.rs:381-386 — before extracting anything, compare `crates/op-editor-core/src/instance_override.rs` and `crates/op-editor-core/src/ref_resolve.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) crates/op-host-services/src/doc_io.rs:298— crates/op-host-services/src/doc_io.rs:298-303 | crates/op-host-services/src/web_canvas_server/doc_routes.rs:123-128 | crates/op-host-web/src/file_actions.rs:390-395 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-services/src/doc_io.rs:298` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) crates/op-mcp/src/codegen_plan_store.rs:620— crates/op-mcp/src/codegen_plan_store.rs:620-625 | crates/op-mcp/src/codegen_plan_store_assembly.rs:79-84 | crates/op-mcp/src/codegen_plan_store_assembly.rs:96-101 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 3) crates/op-orchestrator/src/geometry_value_readers.rs:84— crates/op-orchestrator/src/geometry_value_readers.rs:84-89 | crates/op-orchestrator/src/role_layout_post_pass.rs:9-14 | crates/op-orchestrator/src/spacing_repair.rs:283-288 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (6 lines × 3) crates/op-editor-ui/src/widgets/layer_context_menu.rs:247— crates/op-editor-ui/src/widgets/layer_context_menu.rs:247-252 | crates/op-editor-ui/src/widgets/layer_context_menu.rs:284-289 | crates/op-editor-ui/src/widgets/path_anchor_context_menu.rs:68-73 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/layer_context_menu.rs:247` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) crates/op-chat-agent/src/backoff.rs:164— crates/op-chat-agent/src/backoff.rs:164-169 | crates/op-host-services/src/web_canvas_server/tenant.rs:731-736 | crates/op-host-web/src/listener.rs:74-79 — 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) crates/op-chat-agent/src/design_agent_tools/quality_scans.rs:562— crates/op-chat-agent/src/design_agent_tools/quality_scans.rs:562-567 | crates/op-host-desktop/src/design_loop_indicator.rs:310-315 | crates/op-orchestrator/src/subagent.rs:553-558 — 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) crates/op-chat-agent/src/design_agent_tools/root_seed.rs:192— crates/op-chat-agent/src/design_agent_tools/root_seed.rs:192-198 | crates/op-editor-core/src/tests_mutators/support.rs:14-19 | crates/op-host-services/src/mcp_serve/finalize_tool.rs:195-201 — 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) crates/op-codegen/src/lib.rs:147— crates/op-codegen/src/lib.rs:147-152 | crates/op-design-lint/src/fixes.rs:156-161 | crates/op-design-lint/src/plan.rs:194-199 — 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) crates/op-editor-core/src/svg_import.rs:73— crates/op-editor-core/src/svg_import.rs:73-78 | crates/op-editor-core/src/svg_import.rs:120-125 | crates/op-html/src/dom.rs:34-39 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 3) crates/op-editor-ui/src/widgets/agent_settings_panel_tests/chrome.rs:20— crates/op-editor-ui/src/widgets/agent_settings_panel_tests/chrome.rs:20-25 | crates/op-editor-ui/src/widgets/home_surface_focus.rs:24-29 | crates/op-editor-ui/src/widgets/workspace_surface_focus.rs:20-25 — 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) crates/op-engine-ffi/src/editor_codegen.rs:329— crates/op-engine-ffi/src/editor_codegen.rs:329-334 | crates/op-engine-ffi/src/editor_image_search.rs:264-273 | crates/op-engine-ffi/src/editor_model_discovery.rs:192-201 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `crate) fn pump_editor_codegen(&mut` in one and `crate) fn pump_editor_image_search(&mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (6 lines × 3) crates/op-mcp/src/batch_design_result.rs:246— crates/op-mcp/src/batch_design_result.rs:246-251 | crates/op-mcp/src/design_refine_result.rs:158-163 | crates/op-mcp/src/tools.rs:95-100 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (6 lines × 3) crates/op-mcp/src/batch_direct_ops.rs:378— crates/op-mcp/src/batch_direct_ops.rs:378-383 | crates/op-mcp/src/update_node_data.rs:152-157 | crates/op-mcp/src/write_tools.rs:634-639 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (6 lines × 3) crates/op-orchestrator/src/loop_finalize.rs:182— crates/op-orchestrator/src/loop_finalize.rs:182-187 | crates/op-orchestrator/src/role_post_pass/color_utils.rs:16-21 | crates/op-orchestrator/src/role_post_pass/color_utils.rs:29-34 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 3) templates/step0/_generators/tpl_gradient_tech.py:203— templates/step0/_generators/tpl_gradient_tech.py:203-208 | templates/step0/_generators/tpl_lecture_light.py:201-206 | templates/step0/_generators/tpl_pitch_dark.py:177-182 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `templates/step0/_generators/tpl_gradient_tech.py:211` calls `mono`, `text` and `templates/step0/_generators/tpl_lecture_light.py:210` 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) packaging/ios/Sources/ChatAttachmentCoordinator.swift:78— packaging/ios/Sources/ChatAttachmentCoordinator.swift:78-83 | packaging/ios/Sources/DocumentSaveCoordinator.swift:249-254 | packaging/ios/Sources/ImageImportCoordinator.swift:137-142 — 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.
Off the main sequence: @zseven-w/op-web-sdk — @zseven-w/op-web-sdk: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
Off the main sequence: op-config-store — op-config-store: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 8 project(s), so it's rigid to change.
Off the main sequence: op-figma — op-figma: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
Off the main sequence: op-i18n — op-i18n: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 8 project(s), so it's rigid to change.
Off the main sequence: op-opmerge — op-opmerge: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: op-process-io — op-process-io: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
Off the main sequence: op-rpc-transport — op-rpc-transport: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
Off the main sequence: op-util — op-util: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 15 project(s), so it's rigid to change.
Off the main sequence: op-collab-relay-protocol — op-collab-relay-protocol: abstractness 0.04, instability 0.00, distance 0.96 — zone of pain — concrete and depended on by 8 project(s), so it's rigid to change.
Off the main sequence: op-auth-bridge — op-auth-bridge: abstractness 0.06, instability 0.00, distance 0.94 — zone of pain — concrete and depended on by 10 project(s), so it's rigid to change.
Off the main sequence: op-ai-skills — op-ai-skills: abstractness 0.00, instability 0.09, distance 0.91 — zone of pain — concrete and depended on by 10 project(s), so it's rigid to change.
Off the main sequence: op-ai — op-ai: abstractness 0.10, instability 0.00, distance 0.90 — zone of pain — concrete and depended on by 11 project(s), so it's rigid to change.
Off the main sequence: op-html — op-html: abstractness 0.00, instability 0.13, distance 0.88 — zone of pain — concrete and depended on by 7 project(s), so it's rigid to change.
Off the main sequence: op-pen-loader — op-pen-loader: abstractness 0.00, instability 0.13, distance 0.88 — zone of pain — concrete and depended on by 14 project(s), so it's rigid to change.
Off the main sequence: op-editor-core — op-editor-core: abstractness 0.01, instability 0.13, distance 0.87 — zone of pain — concrete and depended on by 21 project(s), so it's rigid to change.
Off the main sequence: op-collab — op-collab: abstractness 0.00, instability 0.17, distance 0.83 — zone of pain — concrete and depended on by 5 project(s), so it's rigid to change.
Off the main sequence: op-collab-transport — op-collab-transport: abstractness 0.05, instability 0.20, distance 0.75 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
Off the main sequence: op-editor-ui — op-editor-ui: abstractness 0.00, instability 0.25, distance 0.75 — zone of pain — concrete and depended on by 12 project(s), so it's rigid to change.
Off the main sequence: op-design-lint — op-design-lint: abstractness 0.10, instability 0.17, distance 0.73 — zone of pain — concrete and depended on by 5 project(s), so it's rigid to change.
EditorState::apply_with_allocator (cognitive 173) crates/op-editor-core/src/command_apply.rs:55— EditorState::apply_with_allocator has cognitive complexity 173 (threshold 15). Drivers by points: if/else 72 (140 pts), boolean chains 20, match/switch 6 (13 pts) (nesting depth added 75). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorState::cmd_set_node_layout_prop (cognitive 78) crates/op-editor-core/src/command_layout_prop.rs:130— EditorState::cmd_set_node_layout_prop has cognitive complexity 78 (threshold 15). Drivers by points: if/else 39 (75 pts), match/switch 2, boolean chains 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.
EditorState::commit_property_edit_inner (cognitive 56) crates/op-editor-core/src/property_edit_mutators.rs:69— EditorState::commit_property_edit_inner has cognitive complexity 56 (threshold 15). Drivers by points: if/else 22 (42 pts), match/switch 6 (11 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorState::active_text_input (cognitive 37) crates/op-editor-core/src/text_input_focus.rs:12— EditorState::active_text_input has cognitive complexity 37 (threshold 15). Drivers by points: if/else 24 (27 pts), boolean chains 6, match/switch 2 (4 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
EditorState::active_text_input_mut (cognitive 30) crates/op-editor-core/src/text_input_focus.rs:119— EditorState::active_text_input_mut has cognitive complexity 30 (threshold 15). Drivers by points: if/else 21 (22 pts), boolean chains 6, match/switch 1 (2 pts) (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.
EditorState::resize_selected_bounds (cognitive 27) crates/op-editor-core/src/drag_mutators.rs:142— EditorState::resize_selected_bounds has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 3 (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.
EditorState::paste_clipboard_with_allocator (cognitive 24) crates/op-editor-core/src/clipboard.rs:73— EditorState::paste_clipboard_with_allocator has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (20 pts), match/switch 2 (3 pts), loops 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
EditorState::instantiate_kit_component_under_parent_with_allocator (cognitive 23) crates/op-editor-core/src/uikit_allocator.rs:54— EditorState::instantiate_kit_component_under_parent_with_allocator has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorState::move_node_to_drop_target (cognitive 22) crates/op-editor-core/src/drag_mutators.rs:298— EditorState::move_node_to_drop_target has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 4, match/switch 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.
EditorState::rebuild_chat_models (cognitive 20) crates/op-editor-core/src/chat_model_mutators.rs:34— EditorState::rebuild_chat_models has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 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.
EditorState::cmd_set_ellipse_arc (cognitive 20) crates/op-editor-core/src/command_node_attrs/state_ops.rs:337— EditorState::cmd_set_ellipse_arc has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 3, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorState::cancel_removed_hosted_pending_turns (cognitive 19) crates/op-editor-core/src/hosted_model_catalog.rs:263— EditorState::cancel_removed_hosted_pending_turns has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (18 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.
EditorState::cmd_batch_insert_with_allocator (cognitive 18) crates/op-editor-core/src/command_node/state_ops.rs:366— EditorState::cmd_batch_insert_with_allocator has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3, 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.
EditorState::rename_commit (cognitive 18) crates/op-editor-core/src/rename.rs:107— EditorState::rename_commit has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorState::cmd_insert_authored_subtree_with_root_policy (cognitive 17) crates/op-editor-core/src/command_authored_subtree.rs:28— EditorState::cmd_insert_authored_subtree_with_root_policy has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorState::cmd_update_node (cognitive 17) crates/op-editor-core/src/command_node/state_ops.rs:93— EditorState::cmd_update_node has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (17 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
EditorState::text_edit_caret_vertical (cognitive 17) crates/op-editor-core/src/text_edit.rs:264— EditorState::text_edit_caret_vertical has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorState::cmd_insert_node_with_allocator (cognitive 16) crates/op-editor-core/src/command_node/state_ops.rs:39— EditorState::cmd_insert_node_with_allocator has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
TooManyFields: EditorUiState crates/op-editor-core/src/editor_ui_state/state.rs:21— TooManyFields — 225 stored fields beside 112 methods. The bar is 30 stored fields; this is 195 over it, 7.50× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: WidgetHostNative crates/op-host-native/src/widget_host.rs:326— TooManyFields — 85 stored fields beside 727 methods. The bar is 30 stored fields; this is 55 over it, 2.83× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: DesktopApp crates/op-host-desktop/src/main.rs:175— TooManyFields — 85 stored fields beside 161 methods. The bar is 30 stored fields; this is 55 over it, 2.83× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: PropertyPanel crates/op-editor-ui/src/widgets/property_panel.rs:80— TooManyFields — 73 stored fields beside 87 methods. The bar is 30 stored fields; this is 43 over it, 2.43× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: WidgetHost crates/op-host-web/src/widget_host.rs:262— TooManyFields — 66 stored fields beside 506 methods. The bar is 30 stored fields; this is 36 over it, 2.20× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: AgentSettings crates/op-editor-core/src/agent_settings.rs:254— TooManyFields — 65 stored fields beside 73 methods. The bar is 30 stored fields; this is 35 over it, 2.17× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: StudioPalette crates/op-editor-ui/src/widgets/home_surface_palette.rs:9— TooManyFields — 62 stored fields beside 4 methods. The bar is 30 stored fields; this is 32 over it, 2.07× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: NodePayload crates/op-pen-loader/src/payload.rs:66— TooManyFields — 62 stored fields. The bar is 30 stored fields; this is 32 over it, 2.07× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: GitPanelState crates/op-editor-core/src/editor_ui_state/git_panel.rs:352— TooManyFields — 52 stored fields beside 5 methods. The bar is 30 stored fields; this is 22 over it, 1.73× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: NodeSnapshot crates/op-editor-ui/src/widgets/property_panel_snapshot.rs:81— TooManyFields — 47 stored fields. The bar is 30 stored fields; this is 17 over it, 1.57× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: HomeLayout crates/op-editor-ui/src/widgets/home_surface_layout.rs:94— TooManyFields — 45 stored fields beside 2 methods. The bar is 30 stored fields; this is 15 over it, 1.50× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: VisibleSections crates/op-editor-ui/src/widgets/property_panel_visibility.rs:218— TooManyFields — 42 stored fields. The bar is 30 stored fields; this is 12 over it, 1.40× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: AIChatPlaceholder crates/op-editor-ui/src/widgets/ai_chat_panel.rs:87— TooManyFields — 35 stored fields beside 52 methods. The bar is 30 stored fields; this is 5 over it, 1.17× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: CollabRuntime crates/op-collab-host/src/runtime.rs:72— TooManyFields — 33 stored fields beside 101 methods. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: PropertyLabels crates/op-editor-ui/src/widgets/property_panel_sections.rs:58— TooManyFields — 33 stored fields beside 1 method. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: ChatState crates/op-editor-core/src/chat.rs:189— TooManyFields — 32 stored fields beside 45 methods. The bar is 30 stored fields; this is 2 over it, 1.07× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: GuestSessionCore crates/op-collab/src/guest.rs:34— TooManyFields — 31 stored fields beside 47 methods. The bar is 30 stored fields; this is 1 over it, 1.03× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: WorkspaceState crates/op-editor-core/src/editor_ui_state/workspace.rs:149— TooManyFields — 31 stored fields beside 33 methods. The bar is 30 stored fields; this is 1 over it, 1.03× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFunctions: op_chrome_extension_core::wasm_api crates/op-chrome-extension-core/src/wasm_api.rs:29— TooManyFunctions — 59 free functions. The bar is 30 free functions; this is 29 over it, 1.97× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: op_engine_napi::bindings_editor crates/op-engine-napi/src/bindings_editor.rs:28— TooManyFunctions — 46 free functions. The bar is 30 free functions; this is 16 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: op_editor_core::host_keyboard_transitions crates/op-editor-core/src/host_keyboard_transitions.rs:47— TooManyFunctions — 38 free functions. The bar is 30 free functions; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: op_design_lint::node_util crates/op-design-lint/src/node_util.rs:65— TooManyFunctions — 37 free functions. The bar is 30 free functions; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: op_cli::app_control_cli crates/op-cli/src/app_control_cli.rs:45— TooManyFunctions — 36 free functions. The bar is 30 free functions; this is 6 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: op_image_enrich::fallback_policy crates/op-image-enrich/src/fallback_policy.rs:49— TooManyFunctions — 36 free functions. The bar is 30 free functions; this is 6 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: op_orchestrator::validation_dump crates/op-orchestrator/src/validation_dump.rs:23— TooManyFunctions — 36 free functions. The bar is 30 free functions; this is 6 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: op_html::color crates/op-html/src/color.rs:11— TooManyFunctions — 35 free functions. The bar is 30 free functions; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: op_html::css::selectors crates/op-html/src/css/selectors.rs:68— TooManyFunctions — 35 free functions. The bar is 30 free functions; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: op_orchestrator::motion_recipes crates/op-orchestrator/src/motion_recipes.rs:38— TooManyFunctions — 35 free functions. The bar is 30 free functions; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: op_editor_core::agent_indicators crates/op-editor-core/src/agent_indicators.rs:136— TooManyFunctions — 34 free functions. The bar is 30 free functions; 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.
TooManyFunctions: op_editor_core::command_style_replace crates/op-editor-core/src/command_style_replace.rs:95— TooManyFunctions — 34 free functions. The bar is 30 free functions; 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.
TooManyFunctions: op_host_desktop::mcp_integrations crates/op-host-desktop/src/mcp_integrations.rs:25— TooManyFunctions — 34 free functions. The bar is 30 free functions; 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.
TooManyFunctions: op_host_web::web_fonts crates/op-host-web/src/web_fonts.rs:24— TooManyFunctions — 33 free functions. The bar is 30 free functions; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: op_orchestrator::table_repair crates/op-orchestrator/src/table_repair.rs:27— TooManyFunctions — 33 free functions. The bar is 30 free functions; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: op_chrome_extension_core::design_md_validate crates/op-chrome-extension-core/src/design_md_validate.rs:16— TooManyFunctions — 32 free functions. The bar is 30 free functions; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: op_orchestrator::cleanup_mobile_chrome crates/op-orchestrator/src/cleanup_mobile_chrome.rs:17— TooManyFunctions — 32 free functions. The bar is 30 free functions; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: op_design_lint::detectors::spacing crates/op-design-lint/src/detectors/spacing.rs:54— TooManyFunctions — 31 free functions. The bar is 30 free functions; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication· Edited copy of a member (21 corresponding lines) · ×18
Edited copy of a member (21 corresponding lines) crates/op-orchestrator/src/subtask_completeness_list_rows.rs:79— crates/op-orchestrator/src/subtask_completeness_list_rows.rs:79-99 | crates/op-orchestrator/src/subtask_completeness_reviews.rs:89-111 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) crates/op-ai-skills/src/style_guide/design_md_import.rs:347— crates/op-ai-skills/src/style_guide/design_md_import.rs:347-378 | crates/op-ai-skills/src/style_guide/token_table.rs:203-223 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) crates/op-cli/src/export_cli.rs:101— crates/op-cli/src/export_cli.rs:101-121 | crates/op-cli/src/export_cli.rs:173-193 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) crates/op-editor-ui/src/widgets/ai_chat_transcript_steps.rs:136— crates/op-editor-ui/src/widgets/ai_chat_transcript_steps.rs:136-161 | crates/op-editor-ui/src/widgets/ai_chat_transcript_steps.rs:175-195 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) crates/op-render-export/src/lib.rs:225— crates/op-render-export/src/lib.rs:225-248 | crates/op-render-export/src/pdf.rs:60-80 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) crates/op-editor-core/src/fills/primary.rs:63— crates/op-editor-core/src/fills/primary.rs:63-83 | crates/op-editor-core/src/fills/primary.rs:89-109 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) crates/op-host-native/src/widget_host/font_picker_dispatch.rs:192— crates/op-host-native/src/widget_host/font_picker_dispatch.rs:192-212 | crates/op-host-native/src/widget_host/font_picker_dispatch.rs:384-410 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) crates/op-mcp/src/component_tools.rs:58— crates/op-mcp/src/component_tools.rs:58-78 | crates/op-mcp/src/component_tools.rs:123-153 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) crates/op-chat-agent/src/design_agent_diagnostics.rs:427— crates/op-chat-agent/src/design_agent_diagnostics.rs:427-447 | crates/op-image-enrich/src/targets.rs:116-137 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) crates/op-host-native/src/widget_host/slides_panel.rs:103— crates/op-host-native/src/widget_host/slides_panel.rs:103-126 | crates/op-host-web/src/widget_host/slides_panel.rs:52-72 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) crates/op-orchestrator/src/text_contrast_gradient.rs:193— crates/op-orchestrator/src/text_contrast_gradient.rs:193-213 | crates/op-preview-core/src/animation.rs:436-456 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) crates/op-collab/src/apply_tree.rs:149— crates/op-collab/src/apply_tree.rs:149-169 | crates/op-collab/src/apply_tree.rs:175-195 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) crates/op-editor-core/src/uikit.rs:127— crates/op-editor-core/src/uikit.rs:127-147 | crates/op-editor-core/src/uikit.rs:192-219 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) crates/op-collab-relay-client/src/bridge/guest.rs:101— crates/op-collab-relay-client/src/bridge/guest.rs:101-129 | crates/op-collab-relay-client/src/bridge/owner.rs:146-166 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) crates/op-chrome-extension-core/src/design_md.rs:213— crates/op-chrome-extension-core/src/design_md.rs:213-233 | crates/op-chrome-extension-core/src/design_md.rs:281-303 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) crates/op-collab-host/src/runtime/network.rs:422— crates/op-collab-host/src/runtime/network.rs:422-448 | crates/op-collab-host/src/runtime/network.rs:455-475 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) crates/op-host-native/src/widget_host/preview_slideshow.rs:267— crates/op-host-native/src/widget_host/preview_slideshow.rs:267-287 | crates/op-host-web/src/widget_host/preview_slideshow.rs:422-446 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) templates/step0/_generators/tpl_datareport_carousel.py:226— templates/step0/_generators/tpl_datareport_carousel.py:226-246 | templates/step0/_generators/tpl_yearreview_carousel.py:342-362 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (4 corresponding lines) · ×18
Edited copy of a member (4 corresponding lines) templates/step0/_generators/tpl_infographic_blank_vs_example.py:167— templates/step0/_generators/tpl_infographic_blank_vs_example.py:167-171 | templates/step0/_generators/tpl_infographic_weekly_review.py:173-176 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) crates/op-html/src/css/selectors.rs:539— crates/op-html/src/css/selectors.rs:539-542 | crates/op-html/src/css/selectors.rs:544-548 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) crates/op-editor-core/src/agent_settings/config_types.rs:375— crates/op-editor-core/src/agent_settings/config_types.rs:375-378 | crates/op-i18n/src/locale.rs:161-164 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) crates/op-figma/src/container.rs:62— crates/op-figma/src/container.rs:62-65 | crates/op-figma/src/zip_reader.rs:51-54 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) templates/step0/_generators/tpl_datareport_carousel.py:164— templates/step0/_generators/tpl_datareport_carousel.py:164-168 | templates/step0/_generators/tpl_yearreview_carousel.py:211-214 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) crates/op-editor-ui/src/widgets/property_panel_code.rs:222— crates/op-editor-ui/src/widgets/property_panel_code.rs:222-225 | crates/op-editor-ui/src/widgets/property_panel_code_error.rs:255-258 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) crates/op-orchestrator/src/radial_repair_preinsert_normalize.rs:379— crates/op-orchestrator/src/radial_repair_preinsert_normalize.rs:379-382 | crates/op-orchestrator/src/ring_repair.rs:346-349 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) templates/step0/_generators/cardlib.py:107— templates/step0/_generators/cardlib.py:107-115 | templates/step0/_generators/tpl_card_spine.py:98-101 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) crates/op-orchestrator/src/chip_repair.rs:57— crates/op-orchestrator/src/chip_repair.rs:57-60 | crates/op-orchestrator/src/geometry_sidebar_rail.rs:21-27 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) templates/step0/_generators/tpl_deck_banxin.py:168— templates/step0/_generators/tpl_deck_banxin.py:168-173 | templates/step0/_generators/tpl_deck_gridpaper.py:201-204 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) templates/step0/_generators/tpl_deck_banxin.py:206— templates/step0/_generators/tpl_deck_banxin.py:206-213 | templates/step0/_generators/tpl_event_deck.py:135-138 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) crates/op-host-native/src/widget_host/slides_panel.rs:434— crates/op-host-native/src/widget_host/slides_panel.rs:434-437 | crates/op-host-web/src/widget_host/slides_panel.rs:332-335 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) crates/op-chrome-extension-core/src/design_md_validate.rs:560— crates/op-chrome-extension-core/src/design_md_validate.rs:560-563 | crates/op-host-services/src/mcp_live/design_md_output.rs:370-373 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) crates/op-editor-core/src/web_assets.rs:66— crates/op-editor-core/src/web_assets.rs:66-69 | crates/op-i18n/src/i18n/runtime.rs:19-22 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) crates/op-host-services/src/export_pptx/media.rs:120— crates/op-host-services/src/export_pptx/media.rs:120-123 | crates/op-host-web/src/vf_normalize.rs:114-117 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) crates/op-render-export/src/pdf.rs:237— crates/op-render-export/src/pdf.rs:237-240 | crates/op-render-export/src/svg.rs:42-45 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) crates/op-collab-relay-control-plane/src/service.rs:120— crates/op-collab-relay-control-plane/src/service.rs:120-123 | crates/op-collab-relay-locator-server/src/http.rs:101-104 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (4 corresponding lines) crates/op-preview-core/src/tests_clock_gate.rs:55— crates/op-preview-core/src/tests_clock_gate.rs:55-58 | crates/op-preview-core/src/tests_swipe.rs:66-69 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
ClassTooLong: CanvasKitBackend crates/op-host-web/src/canvaskit/backend.rs:24— ClassTooLong — 547 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 10 methods, 2 blocks, lines 24-716. The bar is 400 significant lines; this is 147 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CollabRuntime crates/op-collab-host/src/runtime.rs:72— ClassTooLong — 526 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 101 methods, 3 blocks, lines 72-799. The bar is 400 significant lines; this is 126 over it, 1.32× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: NativeFrameBackend crates/op-host-native/src/backend/frame_backend.rs:14— ClassTooLong — 512 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 7 methods, 2 blocks, lines 14-710. The bar is 400 significant lines; this is 112 over it, 1.28× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: OpEngineHost packaging/ios/Sources/OpEngineHost.swift:6— ClassTooLong — 502 significant lines (blank, comment-only and punctuation-only lines excluded), 60 methods. The bar is 400 significant lines; this is 102 over it, 1.26× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: OpPlayerView packaging/ios/Sources/OpPlayerView.swift:10— ClassTooLong — 488 significant lines (blank, comment-only and punctuation-only lines excluded), 53 methods. The bar is 400 significant lines; this is 88 over it, 1.22× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: LayerPanel crates/op-editor-ui/src/widgets/layer_panel.rs:78— ClassTooLong — 471 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 16 methods, 3 blocks, lines 78-793. The bar is 400 significant lines; this is 71 over it, 1.18× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: NativeLoginViewController packaging/ios/Sources/NativeLoginViewController.swift:16— ClassTooLong — 466 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods. The bar is 400 significant lines; this is 66 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: MainActivity packaging/android/app/src/main/kotlin/tech/zseven/openpencil/MainActivity.kt:43— ClassTooLong — 451 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. The bar is 400 significant lines; this is 51 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.
ClassTooLong: CollabPanel crates/op-editor-ui/src/widgets/collab_panel.rs:81— ClassTooLong — 450 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 27 methods, 3 blocks, lines 81-648. The bar is 400 significant lines; this is 50 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.
ClassTooLong: Icon crates/op-editor-ui/src/widgets/icons.rs:33— ClassTooLong — 449 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 2 methods, 2 blocks, lines 33-608. The bar is 400 significant lines; this is 49 over it, 1.12× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CodegenPipeline crates/op-codegen/src/ai/pipeline.rs:65— ClassTooLong — 446 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 41 methods, 2 blocks, lines 65-755. The bar is 400 significant lines; this is 46 over it, 1.12× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ConnectionDriver crates/op-collab-transport/src/driver.rs:129— ClassTooLong — 432 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 32 methods, 3 blocks, lines 129-687. The bar is 400 significant lines; this is 32 over it, 1.08× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: OpSurfaceView packaging/android/app/src/main/kotlin/tech/zseven/openpencil/OpSurfaceView.kt:45— ClassTooLong — 430 significant lines (blank, comment-only and punctuation-only lines excluded), 62 methods. The bar is 400 significant lines; this is 30 over it, 1.08× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Session crates/op-engine-ffi/src/lifecycle.rs:29— ClassTooLong — 421 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 65 methods, 2 blocks, lines 29-719. The bar is 400 significant lines; this is 21 over it, 1.05× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: VariablesPanel crates/op-editor-ui/src/widgets/variables_panel.rs:127— ClassTooLong — 421 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 47 methods, 3 blocks, lines 127-776. The bar is 400 significant lines; this is 21 over it, 1.05× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SubprocessProvider crates/op-host-services/src/chat_subprocess.rs:65— ClassTooLong — 415 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 7 methods, 4 blocks, lines 65-783. The bar is 400 significant lines; this is 15 over it, 1.04× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: NativeLoginOverlay packaging/android/app/src/main/kotlin/tech/zseven/openpencil/NativeLoginOverlay.kt:36— ClassTooLong — 404 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods. The bar is 400 significant lines; this is 4 over it, 1.01× 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.
op_mcp::parser::arguments_field (cyclomatic 55) crates/op-mcp/src/parser.rs:173— op_mcp::parser::arguments_field has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_mcp::script_runner::repair_truncated_script (cyclomatic 39) crates/op-mcp/src/script_runner.rs:510— op_mcp::script_runner::repair_truncated_script 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.
op_mcp::parser::parse_flat_object_body (cyclomatic 37) crates/op-mcp/src/parser.rs:393— op_mcp::parser::parse_flat_object_body 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.
op_mcp::batch_layered_guidelines::generate_section_guidelines (cyclomatic 26) crates/op-mcp/src/batch_layered_guidelines.rs:7— op_mcp::batch_layered_guidelines::generate_section_guidelines has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
op_mcp::script_runner::escape_raw_newlines_in_quoted_strings (cyclomatic 25) crates/op-mcp/src/script_runner.rs:132— op_mcp::script_runner::escape_raw_newlines_in_quoted_strings 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.
op_mcp::batch_design_wire::parse_item (cyclomatic 23) crates/op-mcp/src/batch_design_wire.rs:70— op_mcp::batch_design_wire::parse_item 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.
op_mcp::script_runner::balance_brackets (cyclomatic 22) crates/op-mcp/src/script_runner.rs:422— op_mcp::script_runner::balance_brackets 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.
op_mcp::batch_program_exec_ops::execute_image (cyclomatic 21) crates/op-mcp/src/batch_program_exec_ops.rs:236— op_mcp::batch_program_exec_ops::execute_image 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.
op_mcp::batch_design_normalize::normalize_pencil_autolayout_dialect (cyclomatic 20) crates/op-mcp/src/batch_design_normalize.rs:92— op_mcp::batch_design_normalize::normalize_pencil_autolayout_dialect 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.
op_mcp::script_runner_dotted_keys::repair_dotted_object_keys (cyclomatic 20) crates/op-mcp/src/script_runner_dotted_keys.rs:29— op_mcp::script_runner_dotted_keys::repair_dotted_object_keys 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.
op_mcp::codegen_plan_store::submit_chunk_result (cyclomatic 19) crates/op-mcp/src/codegen_plan_store.rs:514— op_mcp::codegen_plan_store::submit_chunk_result 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.
op_mcp::batch_program::explicitly_sized_append_lines (cyclomatic 17) crates/op-mcp/src/batch_program.rs:418— op_mcp::batch_program::explicitly_sized_append_lines 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.
op_mcp::codegen_plan_store::validate_plan (cyclomatic 17) crates/op-mcp/src/codegen_plan_store.rs:173— op_mcp::codegen_plan_store::validate_plan 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.
op_mcp::batch_get::resolve_refs_in_node (cyclomatic 16) crates/op-mcp/src/batch_get.rs:171— op_mcp::batch_get::resolve_refs_in_node has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: op_mcp::batch_get::node_type (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
op_mcp::script_runner_fences::extract (cyclomatic 16) crates/op-mcp/src/script_runner_fences.rs:11— op_mcp::script_runner_fences::extract 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.
op_mcp::script_runner_overlay::restore (cyclomatic 16) crates/op-mcp/src/script_runner_overlay.rs:46— op_mcp::script_runner_overlay::restore 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.
op_host_desktop::mcp_integrations_dsh::update_dsh_patch_config (cognitive 57) crates/op-host-desktop/src/mcp_integrations_dsh.rs:98— op_host_desktop::mcp_integrations_dsh::update_dsh_patch_config has cognitive complexity 57 (threshold 15). Drivers by points: if/else 16 (39 pts), loops 3 (10 pts), match/switch 3 (5 pts), boolean chains 3 (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.
op_host_desktop::design_session_workers::finish_design_success (cognitive 45) crates/op-host-desktop/src/design_session_workers.rs:290— op_host_desktop::design_session_workers::finish_design_success has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (36 pts), loops 4 (5 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_desktop::persistence::run_action (cognitive 39) crates/op-host-desktop/src/persistence.rs:372— op_host_desktop::persistence::run_action has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (30 pts), match/switch 5 (9 pts) (nesting depth added 20). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
op_host_desktop::chat_session::execute_tool_requests (cognitive 33) crates/op-host-desktop/src/chat_session.rs:289— op_host_desktop::chat_session::execute_tool_requests has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (31 pts), boolean chains 1, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_desktop::chat_session_launch::launch_if_pending_inner (cognitive 31) crates/op-host-desktop/src/chat_session_launch.rs:112— op_host_desktop::chat_session_launch::launch_if_pending_inner has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (25 pts), boolean chains 6 (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.
op_host_desktop::design_session::pump_commands (cognitive 31) crates/op-host-desktop/src/design_session.rs:42— op_host_desktop::design_session::pump_commands has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 4, match/switch 2 (4 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_desktop::chat_acp::run_acp_turn (cognitive 27) crates/op-host-desktop/src/chat_acp.rs:457— op_host_desktop::chat_acp::run_acp_turn has cognitive complexity 27 (threshold 15). Drivers by points: match/switch 10 (13 pts), if/else 4 (12 pts), loops 2 (nesting depth added 11). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
op_host_desktop::chat_session::pump_with_channel_interleave (cognitive 24) crates/op-host-desktop/src/chat_session.rs:132— op_host_desktop::chat_session::pump_with_channel_interleave has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 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.
op_host_desktop::design_md_host::run_mcp_design_md_provider_blocking (cognitive 22) crates/op-host-desktop/src/design_md_host.rs:156— op_host_desktop::design_md_host::run_mcp_design_md_provider_blocking has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 2, loops 2, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_desktop::commit_diff_semantic::compute_commit_diff (cognitive 20) crates/op-host-desktop/src/commit_diff_semantic.rs:74— op_host_desktop::commit_diff_semantic::compute_commit_diff has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2, match/switch 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.
op_host_desktop::image_decode_host::decode_worker (cognitive 18) crates/op-host-desktop/src/image_decode_host.rs:196— op_host_desktop::image_decode_host::decode_worker has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 2 (5 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.
op_host_desktop::mcp_integrations::update_zcode_config (cognitive 17) crates/op-host-desktop/src/mcp_integrations.rs:448— op_host_desktop::mcp_integrations::update_zcode_config has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (17 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.
op_host_desktop::render_cli::prefetch_remote_images (cognitive 17) crates/op-host-desktop/src/render_cli.rs:187— op_host_desktop::render_cli::prefetch_remote_images has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4, boolean chains 2 (nesting depth added 4). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to one function item inside it that branches (collect). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
op_host_desktop::sub_agent_session::pump_sub_agents (cognitive 17) crates/op-host-desktop/src/sub_agent_session.rs:316— op_host_desktop::sub_agent_session::pump_sub_agents has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (17 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.
op_host_desktop::init_auth_runtime (cognitive 16) crates/op-host-desktop/src/main.rs:522— op_host_desktop::init_auth_runtime has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (15 pts), boolean chains 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
op_host_desktop::render_cli::run_cli_if_requested (cognitive 16) crates/op-host-desktop/src/render_cli.rs:30— op_host_desktop::render_cli::run_cli_if_requested has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, match/switch 3 (4 pts), loops 2 (3 pts) (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.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×16
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/op-ai-skills/src/style_guide/token_table.rs:493— crates/op-ai-skills/src/style_guide/token_table.rs:493-523 | crates/op-orchestrator/src/design_type.rs:160-201 | crates/op-orchestrator/src/plan.rs:524-555 | crates/op-orchestrator/src/plan_fallback_card.rs:22-52 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/op-collab-smoke/src/fault_guest.rs:46— crates/op-collab-smoke/src/fault_guest.rs:46-175 | crates/op-collab-smoke/src/fault_guest.rs:181-238 | crates/op-collab-smoke/src/fault_guest.rs:356-410 | crates/op-collab-smoke/src/fault_guest.rs:448-470 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/op-design-lint/src/node_util.rs:555— crates/op-design-lint/src/node_util.rs:555-570 | crates/op-editor-core/src/property_edit_mutators.rs:742-755 | crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:279-297 | crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:299-313 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/op-editor-core/src/color_picker_snapshot.rs:24— crates/op-editor-core/src/color_picker_snapshot.rs:24-41 | crates/op-editor-ui/src/widgets/variables_panel.rs:327-348 | crates/op-host-native/src/widget_host/variables_panel_row_press.rs:378-394 | crates/op-host-web/src/widget_host/variables_panel_rows.rs:320-336 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/op-editor-core/src/command_style_replace.rs:416— crates/op-editor-core/src/command_style_replace.rs:416-438 | crates/op-editor-core/src/fills/access.rs:157-179 | crates/op-figma/src/clipboard.rs:561-574 | crates/op-orchestrator/src/variable_binding.rs:352-374 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/op-editor-core/src/host_image_panel_transitions.rs:256— crates/op-editor-core/src/host_image_panel_transitions.rs:256-269 | crates/op-editor-core/src/host_image_panel_transitions.rs:278-294 | crates/op-editor-core/src/host_image_panel_transitions.rs:303-319 | crates/op-editor-core/src/host_image_panel_transitions.rs:322-335 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/op-editor-core/src/image_crop.rs:224— crates/op-editor-core/src/image_crop.rs:224-238 | crates/op-editor-core/src/property_edit_mutators.rs:667-684 | crates/op-editor-core/src/property_edit_mutators.rs:703-720 | crates/op-editor-core/src/property_edit_mutators.rs:722-739 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/op-editor-ui/src/widgets/property_panel_input_layout.rs:58— crates/op-editor-ui/src/widgets/property_panel_input_layout.rs:58-370 | crates/op-editor-ui/src/widgets/property_panel_layout.rs:226-606 | crates/op-editor-ui/src/widgets/property_panel_sections.rs:466-586 | crates/op-editor-ui/src/widgets/property_panel_sections.rs:604-705 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:184— crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:184-207 | crates/op-html/src/mapper_node_access.rs:87-110 | crates/op-orchestrator/src/validation_dump.rs:283-297 | crates/op-orchestrator/src/validation_fixes_apply.rs:577-592 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/op-host-web/src/agent_indicator_sync.rs:65— crates/op-host-web/src/agent_indicator_sync.rs:65-90 | crates/op-host-web/src/preview_pump.rs:47-89 | crates/op-host-web/src/studio_web.rs:242-275 | crates/op-host-web/src/tooltip_pump.rs:32-70 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/op-html/src/layout_heuristics.rs:23— crates/op-html/src/layout_heuristics.rs:23-54 | crates/op-html/src/mapper_text_scope.rs:100-124 | crates/op-html/src/text.rs:273-343 | crates/op-html/src/text_children.rs:128-227 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/op-html/src/mapper_box.rs:145— crates/op-html/src/mapper_box.rs:145-157 | crates/op-html/src/mapper_margin.rs:351-375 | crates/op-html/src/mapper_margin.rs:665-677 | crates/op-html/src/mapper_wrap.rs:190-217 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/op-mcp/src/batch_get.rs:239— crates/op-mcp/src/batch_get.rs:239-251 | crates/op-mcp/src/read_nodes.rs:102-114 | crates/op-mcp/src/style_ops_tools.rs:157-169 | crates/op-mcp/src/style_ops_tools.rs:173-185 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/op-orchestrator/src/table_filter_contract.rs:226— crates/op-orchestrator/src/table_filter_contract.rs:226-358 | crates/op-orchestrator/src/table_filter_contract.rs:360-374 | crates/op-orchestrator/src/table_filter_contract.rs:436-450 | crates/op-orchestrator/src/table_filter_contract.rs:452-466 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/op-preview-core/src/present.rs:277— crates/op-preview-core/src/present.rs:277-382 | crates/op-preview-core/src/session_paint.rs:52-81 | crates/op-preview-core/src/session_paint.rs:107-153 | crates/op-preview-core/src/transition.rs:295-459 — 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) templates/step0/_generators/tpl_infographic_blank_vs_example.py:136— templates/step0/_generators/tpl_infographic_blank_vs_example.py:136-144 | templates/step0/_generators/tpl_infographic_idea_flow.py:121-129 | templates/step0/_generators/tpl_infographic_steps.py:133-143 | templates/step0/_generators/tpl_infographic_weekly_review.py:142-152 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Edited copy of a member (25 corresponding lines) · ×16
Edited copy of a member (25 corresponding lines) crates/op-design-lint/src/missing_progress_ring.rs:267— crates/op-design-lint/src/missing_progress_ring.rs:267-291 | crates/op-pen-loader/src/legacy_payload_repair.rs:111-135 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) crates/op-collab/src/apply_tree.rs:344— crates/op-collab/src/apply_tree.rs:344-368 | crates/op-orchestrator/src/validation_dump.rs:187-211 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) crates/op-design-lint/src/node_mut.rs:161— crates/op-design-lint/src/node_mut.rs:161-185 | crates/op-figma/src/layout_positioning.rs:105-129 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) crates/op-editor-core/src/export_name.rs:162— crates/op-editor-core/src/export_name.rs:162-186 | crates/op-mcp/src/tools.rs:34-58 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) crates/op-orchestrator/src/cleanup_empty_content_bar.rs:166— crates/op-orchestrator/src/cleanup_empty_content_bar.rs:166-190 | crates/op-orchestrator/src/hero_bleed.rs:642-680 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) crates/op-collab/src/codec.rs:229— crates/op-collab/src/codec.rs:229-255 | crates/op-collab/src/codec.rs:350-374 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) crates/op-host-web/src/dom_io/html_directory_session.rs:402— crates/op-host-web/src/dom_io/html_directory_session.rs:402-426 | crates/op-html/src/project.rs:134-164 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) crates/op-collab/src/apply_tree.rs:52— crates/op-collab/src/apply_tree.rs:52-79 | crates/op-collab/src/apply_tree.rs:86-110 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) crates/op-figma/src/mappers.rs:506— crates/op-figma/src/mappers.rs:506-531 | crates/op-figma/src/mappers.rs:534-558 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) crates/op-collab-transport/src/discovery_bonjour.rs:39— crates/op-collab-transport/src/discovery_bonjour.rs:39-69 | crates/op-collab-transport/src/discovery_bonjour_browser.rs:52-76 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) crates/op-editor-core/src/mutators.rs:549— crates/op-editor-core/src/mutators.rs:549-573 | crates/op-editor-core/src/mutators.rs:575-602 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) crates/op-collab-relay-locator-hsm/src/server.rs:275— crates/op-collab-relay-locator-hsm/src/server.rs:275-299 | crates/op-collab-relay-locator-server/src/hsm.rs:252-278 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) crates/op-editor-ui/src/widgets/agent_settings_fonts.rs:195— crates/op-editor-ui/src/widgets/agent_settings_fonts.rs:195-219 | crates/op-editor-ui/src/widgets/agent_settings_fonts.rs:277-310 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) crates/op-ai-skills/src/style_guide/design_md_import.rs:154— crates/op-ai-skills/src/style_guide/design_md_import.rs:154-180 | crates/op-chrome-extension-core/src/design_md_render.rs:532-556 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) crates/op-host-services/src/web_canvas_server/connection.rs:651— crates/op-host-services/src/web_canvas_server/connection.rs:651-685 | crates/op-host-services/src/web_static.rs:313-337 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) crates/op-orchestrator/src/orchestration_self_check.rs:535— crates/op-orchestrator/src/orchestration_self_check.rs:535-568 | crates/op-orchestrator/src/role_post_pass/mobile_cards.rs:17-41 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (20 corresponding lines) · ×15
Edited copy of a member (20 corresponding lines) crates/op-editor-ui/src/widgets/git_panel_ready.rs:203— crates/op-editor-ui/src/widgets/git_panel_ready.rs:203-226 | crates/op-editor-ui/src/widgets/git_panel_tracked_picker.rs:123-142 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) crates/op-orchestrator/src/subtask_completeness_list_rows.rs:254— crates/op-orchestrator/src/subtask_completeness_list_rows.rs:254-274 | crates/op-orchestrator/src/subtask_completeness_reviews.rs:113-132 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) crates/op-collab-relay-locator-hsm/src/server.rs:150— crates/op-collab-relay-locator-hsm/src/server.rs:150-174 | crates/op-collab-relay-locator-hsm/src/server.rs:176-195 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) crates/op-codegen/src/codegen_tailwind.rs:258— crates/op-codegen/src/codegen_tailwind.rs:258-279 | crates/op-codegen/src/codegen_tailwind_jsx.rs:213-232 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) crates/op-editor-core/src/property_edit_mutators.rs:549— crates/op-editor-core/src/property_edit_mutators.rs:549-568 | crates/op-editor-core/src/property_edit_mutators.rs:574-599 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) templates/step0/_generators/tpl_deck_banxin.py:124— templates/step0/_generators/tpl_deck_banxin.py:124-151 | templates/step0/_generators/tpl_deck_gridpaper.py:109-128 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) crates/op-host-web/src/dom_io/html_directory_session.rs:438— crates/op-host-web/src/dom_io/html_directory_session.rs:438-457 | crates/op-html/src/project.rs:249-268 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) crates/op-editor-core/src/agent_settings/mutators.rs:46— crates/op-editor-core/src/agent_settings/mutators.rs:46-65 | crates/op-editor-core/src/agent_settings/mutators.rs:69-92 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) crates/op-collab/src/serde_context.rs:97— crates/op-collab/src/serde_context.rs:97-120 | crates/op-collab/src/serde_context.rs:122-141 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) packaging/ios/Sources/DocumentExportCoordinator.swift:171— packaging/ios/Sources/DocumentExportCoordinator.swift:171-190 | packaging/ios/Sources/DocumentSaveCoordinator.swift:226-247 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) packaging/ios/Sources/OpPlayerView.swift:458— packaging/ios/Sources/OpPlayerView.swift:458-479 | packaging/ios/Sources/OpPlayerView.swift:481-500 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) crates/op-editor-ui/src/widgets/toolbar.rs:451— crates/op-editor-ui/src/widgets/toolbar.rs:451-470 | crates/op-editor-ui/src/widgets/top_bar_paint.rs:686-705 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) crates/op-cli/src/html_cli.rs:12— crates/op-cli/src/html_cli.rs:12-31 | crates/op-cli/src/html_cli.rs:98-124 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) crates/op-chrome-extension-core/src/design_md_validate.rs:232— crates/op-chrome-extension-core/src/design_md_validate.rs:232-251 | crates/op-host-services/src/design_md_evidence.rs:773-792 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) crates/op-host-native/src/widget_host/preview_slideshow.rs:66— crates/op-host-native/src/widget_host/preview_slideshow.rs:66-85 | crates/op-host-web/src/widget_host/preview_slideshow.rs:70-90 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (8 lines × 3) crates/op-brand/src/color.rs:125— crates/op-brand/src/color.rs:125-132 | crates/op-html/src/color.rs:122-129 | crates/op-html/src/color.rs:176-183 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-brand/src/color.rs:125` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (8 lines × 3) crates/op-collab-relay-locator-server/src/http.rs:363— crates/op-collab-relay-locator-server/src/http.rs:363-370 | crates/op-collab-relay-locator-server/src/http.rs:438-445 | crates/op-collab-relay-locator-server/src/http.rs:503-510 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-collab-relay-locator-server/src/http.rs:363` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) crates/op-editor-core/src/agent_indicators.rs:707— crates/op-editor-core/src/agent_indicators.rs:707-714 | crates/op-editor-host-core/src/chat.rs:109-116 | crates/op-editor-host-core/src/chat.rs:133-142 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/agent_indicators.rs:707` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) crates/op-mcp/src/write_tools.rs:459— crates/op-mcp/src/write_tools.rs:459-466 | crates/op-mcp/src/write_tools.rs:513-520 | crates/op-mcp/src/write_tools.rs:583-590 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-mcp/src/write_tools.rs:459` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (8 lines × 3) crates/op-orchestrator/src/cleanup_empty_content_bar.rs:46— crates/op-orchestrator/src/cleanup_empty_content_bar.rs:46-53 | crates/op-orchestrator/src/cleanup_light_plate_on_dark.rs:42-49 | crates/op-orchestrator/src/hero_bleed.rs:74-81 — before extracting anything, compare `crates/op-orchestrator/src/cleanup_empty_content_bar.rs` and `crates/op-orchestrator/src/hero_bleed.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) crates/op-orchestrator/src/cleanup_section_margins.rs:139— crates/op-orchestrator/src/cleanup_section_margins.rs:139-146 | crates/op-orchestrator/src/cleanup_slide_padding.rs:133-140 | crates/op-orchestrator/src/cleanup_slide_padding.rs:495-502 — before extracting anything, compare `crates/op-orchestrator/src/cleanup_section_margins.rs` and `crates/op-orchestrator/src/cleanup_slide_padding.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) crates/op-editor-ui/src/widgets/account_menu.rs:132— crates/op-editor-ui/src/widgets/account_menu.rs:132-139 | crates/op-editor-ui/src/widgets/export_quick_menu.rs:144-151 | crates/op-editor-ui/src/widgets/file_menu_paint.rs:37-44 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (8 lines × 3) crates/op-html/src/mapper_visual.rs:611— crates/op-html/src/mapper_visual.rs:611-618 | crates/op-html/src/text.rs:504-511 | crates/op-html/src/transform.rs:307-314 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (8 lines × 3) crates/op-orchestrator/src/geometry_validation.rs:149— crates/op-orchestrator/src/geometry_validation.rs:149-156 | crates/op-orchestrator/src/image_fallback_policy.rs:22-29 | crates/op-orchestrator/src/radial_repair_sink.rs:49-56 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (8 lines × 3) crates/op-orchestrator/src/square_ring_repair.rs:164— crates/op-orchestrator/src/square_ring_repair.rs:164-171 | crates/op-orchestrator/src/stub_repair.rs:221-228 | crates/op-orchestrator/src/text_contrast_repair.rs:590-597 — before extracting anything, compare `crates/op-orchestrator/src/square_ring_repair.rs` and `crates/op-orchestrator/src/stub_repair.rs` as WHOLE FILES: this scan already matched 5 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. If that is what happened, the fix is to keep one copy and have the 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 `state` to `&op_editor_core::EditorState` in one and `&EditorState` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8 lines × 3) crates/op-design-lint/src/node_mut.rs:151— crates/op-design-lint/src/node_mut.rs:151-158 | crates/op-editor-core/src/state.rs:346-353 | crates/op-orchestrator/src/validation_dump.rs:443-450 — 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 `node` to `&mut PenNode` in one and `&PenNode` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8 lines × 3) crates/op-host-services/src/cli_model_discovery.rs:74— crates/op-host-services/src/cli_model_discovery.rs:74-81 | crates/op-host-services/src/cli_model_discovery.rs:149-156 | crates/op-host-services/src/model_discovery.rs:398-405 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-services/src/cli_model_discovery.rs:74` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The 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) crates/op-pen-loader/src/widget_payload.rs:121— crates/op-pen-loader/src/widget_payload.rs:121-128 | crates/op-pen-loader/src/widget_payload.rs:157-164 | crates/op-pen-loader/src/widget_payload.rs:179-186 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-pen-loader/src/widget_payload.rs:121` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) templates/step0/_generators/tpl_tutorial_photo.py:316— templates/step0/_generators/tpl_tutorial_photo.py:316-324 | templates/step0/_generators/tpl_tutorial_skincare.py:219-226 | templates/step0/_generators/tpl_tutorial_storage.py:214-221 — 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 `templates/step0/_generators/tpl_tutorial_photo.py:316` it does not close everything it opens, so those 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, `templates/step0/_generators/tpl_tutorial_photo.py:326` calls `col` and `templates/step0/_generators/tpl_tutorial_skincare.py:228` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 3) templates/step0/_generators/tpl_tutorial_photo.py:316— templates/step0/_generators/tpl_tutorial_photo.py:316-324 | templates/step0/_generators/tpl_tutorial_skincare.py:172-179 | templates/step0/_generators/tpl_tutorial_storage.py:179-186 — 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 `templates/step0/_generators/tpl_tutorial_photo.py:316` it does not close everything it opens, so those 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, `templates/step0/_generators/tpl_tutorial_photo.py:326` calls `col` and `templates/step0/_generators/tpl_tutorial_skincare.py:181` 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.
op_design_lint::detectors::spacing::walk_edge_section_padding (cognitive 48) crates/op-design-lint/src/detectors/spacing.rs:441— op_design_lint::detectors::spacing::walk_edge_section_padding has cognitive complexity 48 (threshold 15). Drivers by points: if/else 12 (33 pts), loops 4 (11 pts), boolean chains 4 (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.
op_design_lint::detectors::typography::first_solid_color (cognitive 41) crates/op-design-lint/src/detectors/typography.rs:268— op_design_lint::detectors::typography::first_solid_color has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (34 pts), match/switch 2 (6 pts), loops 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_design_lint::detectors::siblings::walk_sibling_inconsistencies (cognitive 39) crates/op-design-lint/src/detectors/siblings.rs:73— op_design_lint::detectors::siblings::walk_sibling_inconsistencies has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 6 (13 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_design_lint::detectors::siblings::check_consistency (cognitive 39) crates/op-design-lint/src/detectors/siblings.rs:167— op_design_lint::detectors::siblings::check_consistency has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 11, loops 3 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_design_lint::detectors::siblings::walk_mixed_corner_radius (cognitive 35) crates/op-design-lint/src/detectors/siblings.rs:315— op_design_lint::detectors::siblings::walk_mixed_corner_radius has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 4 (9 pts), boolean chains 3 (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.
op_design_lint::detectors::siblings::walk_mixed_padding (cognitive 34) crates/op-design-lint/src/detectors/siblings.rs:406— op_design_lint::detectors::siblings::walk_mixed_padding has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 4 (9 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_design_lint::detectors::structural_quality::walk_redundant_wrappers (cognitive 34) crates/op-design-lint/src/detectors/structural_quality.rs:41— op_design_lint::detectors::structural_quality::walk_redundant_wrappers has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (31 pts), boolean chains 2, loops 1 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
op_design_lint::detectors::shader_budget::shader_issues (cognitive 24) crates/op-design-lint/src/detectors/shader_budget.rs:118— op_design_lint::detectors::shader_budget::shader_issues has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_design_lint::detectors::top_anchored_bars::find_bar_groups (cognitive 23) crates/op-design-lint/src/detectors/top_anchored_bars.rs:94— op_design_lint::detectors::top_anchored_bars::find_bar_groups has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_design_lint::detectors::spacing::walk_stacked_horizontal_padding (cognitive 22) crates/op-design-lint/src/detectors/spacing.rs:582— op_design_lint::detectors::spacing::walk_stacked_horizontal_padding has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (4 pts), boolean chains 3 (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.
op_design_lint::plan::detect_and_plan (cognitive 21) crates/op-design-lint/src/plan.rs:94— op_design_lint::plan::detect_and_plan has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 6 (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.
op_design_lint::detectors::typography::collect_low_contrast (cognitive 18) crates/op-design-lint/src/detectors/typography.rs:104— op_design_lint::detectors::typography::collect_low_contrast 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, 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.
op_design_lint::design_form::classify_root_form (cognitive 16) crates/op-design-lint/src/design_form.rs:105— op_design_lint::design_form::classify_root_form has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_design_lint::detectors::motion_budget::collect (cognitive 16) crates/op-design-lint/src/detectors/motion_budget.rs:26— op_design_lint::detectors::motion_budget::collect has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D30 · Dependency Vulnerabilities· Medium CVE · ×14
Change coupling: click.rs ↔ press.rs crates/op-host-native/src/widget_host/click.rs:1— `crates/op-host-native/src/widget_host/click.rs` and `crates/op-host-web/src/widget_host/press.rs` change together 73% of the time (19 of the 26 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 `3dc64c1a` fix(editor): defer transient row actions until release; `d0a7d5e7` refactor(editor): clear remaining button hover fills; `45340f10` refactor(editor): add shared button press feedback — run `git show` on any of them.
Change coupling: agent_settings.rs ↔ settings_io.rs crates/op-editor-core/src/agent_settings.rs:1— `crates/op-editor-core/src/agent_settings.rs` and `crates/op-host-desktop/src/settings_io.rs` change together 71% of the time (10 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `194c7d01` feat(editor): gate preview mode and widget config behind experimental…; `26e812db` fix(settings): track image generation test status; `ec03f06c` fix(settings): infer ark coding preset by model — run `git show` on any of them.
Change coupling: paint.rs ↔ paint.rs crates/op-host-native/src/widget_host/paint.rs:1— `crates/op-host-native/src/widget_host/paint.rs` and `crates/op-host-web/src/widget_host/paint.rs` change together 66% of the time (25 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 25 shared commits counted here, the most recent 3 are `af15f6cd` feat(editor): canvas toast banner surfaces the online recovery notice; `08f2dc5d` feat(editor): add delayed top-bar tooltips; `ecebc3e7` refactor(editor): move the collab join field onto the unified text input — run `git show` on any of them.
Change coupling: agent_settings_images.rs ↔ press_helpers.rs crates/op-editor-ui/src/widgets/agent_settings_images.rs:1— `crates/op-editor-ui/src/widgets/agent_settings_images.rs` and `crates/op-host-native/src/widget_host/press_helpers.rs` change together 65% of the time (11 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `a922bd2d` feat(editor): open the Openverse register link from Settings → Images; `26e812db` fix(settings): track image generation test status; `0c61ba5b` fix(settings): track image search test status — run `git show` on any of them.
Change coupling: tests.rs ↔ lib.rs crates/op-host-services/src/mcp_serve/tests.rs:1— `crates/op-host-services/src/mcp_serve/tests.rs` and `crates/op-mcp/src/lib.rs` change together 61% of the time (27 of the 44 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 27 shared commits counted here, the most recent 3 are `3461b43f` feat(ai): verify photo captions and project confirmed screenshot anno…; `388bd2af` feat(mcp): run generator programs in the script sandbox and expose MC…; `fbb5c552` feat(codegen): expose deterministic code export over MCP and the CLI — run `git show` on any of them.
Change coupling: ai_chat_hit.rs ↔ press.rs crates/op-editor-ui/src/widgets/ai_chat_hit.rs:1— `crates/op-editor-ui/src/widgets/ai_chat_hit.rs` and `crates/op-host-web/src/widget_host/press.rs` change together 57% of the time (8 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `d0a7d5e7` refactor(editor): clear remaining button hover fills; `b846a292` fix(ai): apply rust chat design blocks; `b9d5639a` fix(ai): disable chat input while streaming — run `git show` on any of them.
Change coupling: property_panel_layout.rs ↔ property_dispatch.rs crates/op-editor-ui/src/widgets/property_panel_layout.rs:1— `crates/op-editor-ui/src/widgets/property_panel_layout.rs` and `crates/op-host-native/src/widget_host/property_dispatch.rs` change together 55% of the time (12 of the 22 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 12 shared commits counted here, the most recent 3 are `3480abaa` feat(editor): merge effect adds into one "+" with a Shadow/Blur menu; `d187eb72` feat(editor): add a Layer Blur button to the effects section; `e2ca2f03` feat(panels): per-fill multi-fill Fill editor (stack/add/delete fills) — run `git show` on any of them.
Change coupling: run_tests_b4.rs ↔ subagent.rs crates/op-orchestrator/src/run_tests_b4.rs:1— `crates/op-orchestrator/src/run_tests_b4.rs` and `crates/op-orchestrator/src/subagent.rs` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `096feaf0` refactor(ai): collapse subagent protocols onto script-gen via the sha…; `5b33f8f5` feat(agent): orchestrator scaffold, subagent, and validation fixes; `6fb5ff58` feat(orchestrator): mobile screen plans, typography cleanup, parse fixes — run `git show` on any of them.
Change coupling: prompt.rs ↔ run_tests_b4.rs crates/op-orchestrator/src/prompt.rs:1— `crates/op-orchestrator/src/prompt.rs` and `crates/op-orchestrator/src/run_tests_b4.rs` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `096feaf0` refactor(ai): collapse subagent protocols onto script-gen via the sha…; `387385fc` fix(orchestrator): resolve scaffold root after replacement; `6fb5ff58` feat(orchestrator): mobile screen plans, typography cleanup, parse fixes — run `git show` on any of them.
Change coupling: main.rs ↔ command.rs crates/op-cli/src/main.rs:1— `crates/op-cli/src/main.rs` and `crates/op-editor-core/src/command.rs` change together 52% of the time (12 of the 23 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `507510ee` feat(mcp): expose the scene template catalogue to MCP and the CLI; `a26e1b0f` fix(mcp): support ts move copy targets; `dd34ca85` fix(mcp): accept ts delete page targets — run `git show` on any of them.
Change coupling: main.rs ↔ command_apply.rs crates/op-cli/src/main.rs:1— `crates/op-cli/src/main.rs` and `crates/op-editor-core/src/command_apply.rs` change together 50% of the time (12 of the 24 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — 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 12 shared commits counted here, the most recent 3 are `507510ee` feat(mcp): expose the scene template catalogue to MCP and the CLI; `a26e1b0f` fix(mcp): support ts move copy targets; `dd34ca85` fix(mcp): accept ts delete page targets — run `git show` on any of them.
Change coupling: property_panel_fill.rs ↔ property_dispatch.rs crates/op-editor-ui/src/widgets/property_panel_fill.rs:1— `crates/op-editor-ui/src/widgets/property_panel_fill.rs` and `crates/op-host-native/src/widget_host/property_dispatch.rs` change together 50% of the time (7 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `cb0842a5` feat(panels): reorder multiple fill layers; `e2ca2f03` feat(panels): per-fill multi-fill Fill editor (stack/add/delete fills); `c68aec25` refactor(editor): migrate fill type picker to shared select — run `git show` on any of them.
Change coupling: git_panel_menus.rs ↔ keyboard.rs crates/op-editor-ui/src/widgets/git_panel_menus.rs:1— `crates/op-editor-ui/src/widgets/git_panel_menus.rs` and `crates/op-host-native/src/widget_host/keyboard.rs` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — 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 `94f8be68` refactor(editor): migrate file and git menus to shared menu; `7133ab24` refactor(editor): migrate git auxiliary inputs to shared text state; `82d48154` feat(panels): git-panel commit-detail diff, overflow menu, signature … — run `git show` on any of them.
Change coupling: command.rs ↔ command_node.rs crates/op-editor-core/src/command.rs:1— `crates/op-editor-core/src/command.rs` and `crates/op-editor-core/src/command_node.rs` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `89fbee20` feat(editor-core): mesh/shader fill state + ref id-remap + chat-sessi…; `0282283c` feat(editor): command-layer ops for MCP layered design; `a26e1b0f` fix(mcp): support ts move copy targets — run `git show` on any of them.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×14
Edited copy of a member (19 corresponding lines) crates/op-pen-loader/src/style_payload.rs:474— crates/op-pen-loader/src/style_payload.rs:474-514 | crates/op-preview-core/src/session_paint.rs:533-566 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) crates/op-pen-loader/src/widget_payload.rs:27— crates/op-pen-loader/src/widget_payload.rs:27-45 | crates/op-pen-loader/src/widget_payload.rs:47-65 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) crates/op-host-desktop/src/user_style_store.rs:123— crates/op-host-desktop/src/user_style_store.rs:123-141 | crates/op-host-desktop/src/user_template_store.rs:90-108 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) crates/op-editor-ui/src/widgets/canvas_viewport_layer_bounds.rs:76— crates/op-editor-ui/src/widgets/canvas_viewport_layer_bounds.rs:76-97 | crates/op-editor-ui/src/widgets/canvas_viewport_layer_bounds.rs:238-256 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) crates/op-html/src/css_encoding.rs:12— crates/op-html/src/css_encoding.rs:12-30 | crates/op-html/src/html_encoding.rs:14-32 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) templates/step0/_generators/tpl_cards.py:185— templates/step0/_generators/tpl_cards.py:185-203 | templates/step0/_generators/tpl_cards.py:212-231 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) crates/op-mcp/src/page_tools.rs:134— crates/op-mcp/src/page_tools.rs:134-152 | crates/op-mcp/src/page_tools.rs:244-262 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) crates/op-orchestrator/src/orchestration_self_check.rs:141— crates/op-orchestrator/src/orchestration_self_check.rs:141-160 | crates/op-orchestrator/src/orchestration_self_check.rs:162-180 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) crates/op-html/src/mapper_intrinsic.rs:35— crates/op-html/src/mapper_intrinsic.rs:35-53 | crates/op-html/src/mapper_intrinsic.rs:89-109 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) crates/op-host-web/src/web_settings.rs:548— crates/op-host-web/src/web_settings.rs:548-566 | crates/op-i18n/src/locale.rs:45-63 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) crates/op-engine-ffi/src/editor_model_discovery.rs:61— crates/op-engine-ffi/src/editor_model_discovery.rs:61-81 | crates/op-host-desktop/src/builtin_model_refresh_host.rs:40-58 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) crates/op-html/src/mapper_grid_place.rs:121— crates/op-html/src/mapper_grid_place.rs:121-139 | crates/op-html/src/mapper_wrap.rs:220-239 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/DouyinNativeSignIn.kt:30— packaging/android/app/src/main/kotlin/tech/zseven/openpencil/DouyinNativeSignIn.kt:30-52 | packaging/android/app/src/main/kotlin/tech/zseven/openpencil/WechatNativeSignIn.kt:40-58 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) crates/op-editor-ui/src/widgets/canvas_viewport_paint/entry.rs:90— crates/op-editor-ui/src/widgets/canvas_viewport_paint/entry.rs:90-110 | crates/op-editor-ui/src/widgets/property_panel_typography_paint.rs:83-101 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×14
Edited copy of a member (23 corresponding lines) crates/op-editor-core/src/fills/access.rs:39— crates/op-editor-core/src/fills/access.rs:39-61 | crates/op-editor-core/src/fills/access.rs:123-146 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) templates/step0/_generators/tpl_deck43_openpencil_intro.py:90— templates/step0/_generators/tpl_deck43_openpencil_intro.py:90-112 | templates/step0/_generators/tpl_deck_openpencil_intro.py:92-114 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) crates/op-mcp/src/conversion_tools.rs:56— crates/op-mcp/src/conversion_tools.rs:56-82 | crates/op-mcp/src/conversion_tools.rs:96-118 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) crates/op-host-web/src/vscode_bridge.rs:165— crates/op-host-web/src/vscode_bridge.rs:165-187 | crates/op-host-web/src/vscode_bridge/early_listener.rs:111-135 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) crates/op-editor-ui/src/widgets/property_panel_generator.rs:393— crates/op-editor-ui/src/widgets/property_panel_generator.rs:393-415 | crates/op-editor-ui/src/widgets/property_panel_image_node.rs:342-366 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) crates/op-editor-core/src/instance_child_override.rs:15— crates/op-editor-core/src/instance_child_override.rs:15-38 | crates/op-editor-core/src/ref_resolve.rs:483-505 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) crates/op-host-services/src/web_static.rs:65— crates/op-host-services/src/web_static.rs:65-87 | crates/op-host-services/src/web_static.rs:101-125 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) crates/op-editor-core/src/chat/message.rs:109— crates/op-editor-core/src/chat/message.rs:109-131 | crates/op-editor-core/src/chat/message.rs:135-157 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) crates/op-editor-ui/src/svg_export.rs:551— crates/op-editor-ui/src/svg_export.rs:551-573 | crates/op-host-services/src/export_html_structured/vector.rs:320-346 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) crates/op-engine-jni/src/bindings_chat_attachment.rs:27— crates/op-engine-jni/src/bindings_chat_attachment.rs:27-54 | crates/op-engine-jni/src/bindings_editor.rs:33-55 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) crates/op-mcp/src/page_tools.rs:587— crates/op-mcp/src/page_tools.rs:587-609 | crates/op-mcp/src/selected_ops_tools.rs:203-226 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) crates/op-orchestrator/src/cleanup_mobile_chrome.rs:158— crates/op-orchestrator/src/cleanup_mobile_chrome.rs:158-180 | crates/op-orchestrator/src/cleanup_section_sizing.rs:13-38 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) crates/op-image-enrich/src/net/fetch_entry.rs:128— crates/op-image-enrich/src/net/fetch_entry.rs:128-154 | crates/op-image-enrich/src/net/resolve.rs:91-113 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) crates/op-figma/src/node_build.rs:87— crates/op-figma/src/node_build.rs:87-109 | crates/op-figma/src/node_build.rs:146-171 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 8+ corresponding lines) · ×14
Edited copies of one member (3 members, 8+ corresponding lines) crates/op-html/src/css/cascade_conditions.rs:503— crates/op-html/src/css/cascade_conditions.rs:503-510 | crates/op-html/src/mapper_visual_syntax.rs:1-9 | crates/op-html/src/resources_css_imports.rs:204-211 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) crates/op-chrome-extension-core/src/design_md_palette.rs:242— crates/op-chrome-extension-core/src/design_md_palette.rs:242-254 | crates/op-editor-ui/src/widgets/home_surface_brand.rs:96-103 | crates/op-host-services/src/design_md_evidence_roles.rs:131-138 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) crates/op-editor-ui/src/widgets/canvas_collab_presence.rs:95— crates/op-editor-ui/src/widgets/canvas_collab_presence.rs:95-102 | crates/op-host-native/src/widget_host/preview_slideshow.rs:38-46 | crates/op-host-web/src/widget_host/preview_slideshow.rs:42-50 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) crates/op-chat-agent/src/design_agent_diagnostics.rs:624— crates/op-chat-agent/src/design_agent_diagnostics.rs:624-631 | crates/op-html/src/mapper_wrap.rs:358-365 | crates/op-orchestrator/src/cleanup_layout.rs:95-102 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) crates/op-editor-ui/src/widgets/ai_chat_panel.rs:510— crates/op-editor-ui/src/widgets/ai_chat_panel.rs:510-517 | crates/op-editor-ui/src/widgets/property_panel_fill_picker.rs:31-38 | crates/op-editor-ui/src/widgets/variables_panel.rs:404-411 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) crates/op-editor-ui/src/widgets/agent_settings_builtin_layout.rs:104— crates/op-editor-ui/src/widgets/agent_settings_builtin_layout.rs:104-111 | crates/op-editor-ui/src/widgets/agent_settings_builtin_model_menu.rs:186-199 | crates/op-editor-ui/src/widgets/agent_settings_builtin_parts.rs:387-406 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) crates/op-editor-core/src/compositing.rs:123— crates/op-editor-core/src/compositing.rs:123-130 | crates/op-editor-core/src/compositing.rs:134-141 | crates/op-editor-core/src/compositing.rs:145-152 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) packaging/ios/Sources/OpEngineHost+Pointer.swift:51— packaging/ios/Sources/OpEngineHost+Pointer.swift:51-60 | packaging/ios/Sources/OpEngineHost.swift:295-304 | packaging/ios/Sources/OpEngineHost.swift:350-357 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) crates/op-editor-ui/src/widgets/canvas_collab_presence.rs:142— crates/op-editor-ui/src/widgets/canvas_collab_presence.rs:142-149 | crates/op-editor-ui/src/widgets/collab_avatar_paint.rs:90-97 | crates/op-editor-ui/src/widgets/property_panel_image_popovers.rs:25-32 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) crates/op-orchestrator/src/board_trailing_void.rs:139— crates/op-orchestrator/src/board_trailing_void.rs:139-146 | crates/op-orchestrator/src/cleanup_section_margins.rs:306-313 | crates/op-orchestrator/src/cleanup_slide_padding.rs:433-441 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) crates/op-engine-jni/src/bindings_editor_back.rs:16— crates/op-engine-jni/src/bindings_editor_back.rs:16-23 | crates/op-engine-napi/src/bindings.rs:499-507 | crates/op-engine-napi/src/bindings_editor.rs:214-222 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) crates/op-editor-core/src/web_sync.rs:540— crates/op-editor-core/src/web_sync.rs:540-547 | crates/op-engine-ffi/src/editor_chat.rs:446-454 | crates/op-engine-ffi/src/editor_chat_hosted_design.rs:63-71 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) crates/op-ai/src/chat_sse.rs:113— crates/op-ai/src/chat_sse.rs:113-120 | crates/op-host-services/src/chat_runtime.rs:226-234 | crates/op-host-services/src/chat_subprocess_parse.rs:67-74 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) crates/op-editor-core/src/host_support_allocator.rs:394— crates/op-editor-core/src/host_support_allocator.rs:394-401 | crates/op-editor-core/src/svg_import/style.rs:89-96 | crates/op-figma/src/clipboard.rs:539-546 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
op_host_web::canvaskit::mount_keyboard::register_keyboard_listeners (cognitive 86) crates/op-host-web/src/canvaskit/mount_keyboard.rs:12— op_host_web::canvaskit::mount_keyboard::register_keyboard_listeners has cognitive complexity 86 (threshold 15). Drivers by points: if/else 24 (47 pts), boolean chains 38, match/switch 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_web::canvaskit::mount::mount_ck (cognitive 54) crates/op-host-web/src/canvaskit/mount.rs:14— op_host_web::canvaskit::mount::mount_ck has cognitive complexity 54 (threshold 15). Drivers by points: if/else 38 (48 pts), boolean chains 3, match/switch 3 (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.
op_host_web::dom_io::handle_paste_event (cognitive 41) crates/op-host-web/src/dom_io.rs:553— op_host_web::dom_io::handle_paste_event has cognitive complexity 41 (threshold 15). Drivers by points: if/else 18 (34 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_web::web_settings_storage::apply_stored_snapshots (cognitive 24) crates/op-host-web/src/web_settings_storage.rs:227— op_host_web::web_settings_storage::apply_stored_snapshots has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (21 pts), match/switch 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.
op_host_web::web_settings_validation::validate_credential_semantics (cognitive 24) crates/op-host-web/src/web_settings_validation.rs:487— op_host_web::web_settings_validation::validate_credential_semantics has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 4, loops 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_web::widget_host::group_ops::trace_grid_contours (cognitive 21) crates/op-host-web/src/widget_host/group_ops.rs:172— op_host_web::widget_host::group_ops::trace_grid_contours has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 4 (6 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_web::web_fonts::collect_text_font_families (cognitive 20) crates/op-host-web/src/web_fonts.rs:281— op_host_web::web_fonts::collect_text_font_families has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (5 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_web::dom_io::drop_entries::collect_files (cognitive 19) crates/op-host-web/src/dom_io/drop_entries.rs:112— op_host_web::dom_io::drop_entries::collect_files has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (8 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_web::live_sync_glue::push_document_if_changed (cognitive 18) crates/op-host-web/src/live_sync_glue.rs:470— op_host_web::live_sync_glue::push_document_if_changed has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (17 pts), match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
op_host_web::web_auth_sync::apply_login_status (cognitive 18) crates/op-host-web/src/web_auth_sync.rs:348— op_host_web::web_auth_sync::apply_login_status has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 2 (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.
op_host_web::web_settings::apply_payload (cognitive 18) crates/op-host-web/src/web_settings.rs:414— op_host_web::web_settings::apply_payload has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17 (18 pts) (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.
op_host_web::codegen_host::receive (cognitive 16) crates/op-host-web/src/codegen_host.rs:128— op_host_web::codegen_host::receive has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 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.
op_host_web::web_chat::start_pump (cognitive 16) crates/op-host-web/src/web_chat.rs:230— op_host_web::web_chat::start_pump has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 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.
D4 · Code Duplication· Edited copy of a member (27 corresponding lines) · ×13
Edited copy of a member (27 corresponding lines) crates/op-host-web/src/file_actions.rs:132— crates/op-host-web/src/file_actions.rs:132-166 | crates/op-host-web/src/file_actions.rs:194-220 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) crates/op-host-native/src/backend/skia/gradient.rs:76— crates/op-host-native/src/backend/skia/gradient.rs:76-109 | crates/op-host-native/src/backend/skia/path.rs:520-546 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) crates/op-auth-bridge/src/collab_claims.rs:503— crates/op-auth-bridge/src/collab_claims.rs:503-529 | crates/op-collab/src/profile_validation.rs:98-124 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) crates/op-ai-skills/src/style_guide/card.rs:88— crates/op-ai-skills/src/style_guide/card.rs:88-114 | crates/op-ai-skills/src/style_guide/summary.rs:64-96 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) crates/op-mcp/src/batch_direct_ops.rs:152— crates/op-mcp/src/batch_direct_ops.rs:152-178 | crates/op-mcp/src/batch_direct_ops.rs:180-207 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) crates/op-host-web/src/widget_host/studio_workspace_run.rs:82— crates/op-host-web/src/widget_host/studio_workspace_run.rs:82-108 | crates/op-host-web/src/widget_host/studio_workspace_run.rs:120-157 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) crates/op-collab-host/src/runtime/network/guest_confirmation.rs:35— crates/op-collab-host/src/runtime/network/guest_confirmation.rs:35-74 | crates/op-collab-host/src/runtime/network/owner.rs:581-607 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) crates/op-editor-ui/src/widgets/agent_settings_acp.rs:432— crates/op-editor-ui/src/widgets/agent_settings_acp.rs:432-458 | crates/op-editor-ui/src/widgets/agent_settings_acp_presets.rs:192-218 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) packaging/ios/Sources/DocumentExportCoordinator.swift:99— packaging/ios/Sources/DocumentExportCoordinator.swift:99-131 | packaging/ios/Sources/DocumentSaveCoordinator.swift:300-326 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) crates/op-orchestrator/src/card_inner_padding.rs:42— crates/op-orchestrator/src/card_inner_padding.rs:42-68 | crates/op-orchestrator/src/touch_target_floor.rs:17-47 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) crates/op-engine-ffi/src/editor_model_discovery.rs:83— crates/op-engine-ffi/src/editor_model_discovery.rs:83-109 | crates/op-host-desktop/src/builtin_model_refresh_host.rs:60-87 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) packaging/ios/Sources/DocumentSaveCoordinator.swift:188— packaging/ios/Sources/DocumentSaveCoordinator.swift:188-222 | packaging/ios/Sources/ImageImportCoordinator.swift:109-135 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) templates/step0/_generators/tpl_datareport_carousel.py:258— templates/step0/_generators/tpl_datareport_carousel.py:258-284 | templates/step0/_generators/tpl_yearreview_carousel.py:431-457 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (5 lines × 3) crates/op-editor-core/src/svg_path_data.rs:348— crates/op-editor-core/src/svg_path_data.rs:348-352 | crates/op-editor-core/src/svg_path_data.rs:357-361 | crates/op-editor-core/src/svg_path_data.rs:364-368 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/op-editor-core/src/svg_path_data.rs:363` calls `Quad`, `push` and `crates/op-editor-core/src/svg_path_data.rs:353` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 3) crates/op-engine-ffi/src/editor.rs:286— crates/op-engine-ffi/src/editor.rs:286-290 | crates/op-engine-ffi/src/editor.rs:322-326 | crates/op-engine-ffi/src/editor_transform.rs:80-84 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-engine-ffi/src/editor.rs:286` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-engine-ffi/src/editor.rs:283` calls `editor_transform_captured`, `Ok` and `crates/op-engine-ffi/src/editor_transform.rs:79` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 3) crates/op-host-services/src/design_md_llm.rs:76— crates/op-host-services/src/design_md_llm.rs:76-80 | crates/op-orchestrator/src/design_system.rs:385-389 | crates/op-orchestrator/src/run.rs:445-449 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-services/src/design_md_llm.rs: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 (5 lines × 3) crates/op-chat-agent/src/chat_agent_context.rs:138— crates/op-chat-agent/src/chat_agent_context.rs:138-142 | crates/op-image-enrich/src/net/downscale.rs:191-195 | crates/op-image-enrich/src/net/downscale.rs:237-241 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-chat-agent/src/chat_agent_context.rs:138` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-chat-agent/src/chat_agent_context.rs:138` calls `raster_n32_premul` and `crates/op-image-enrich/src/net/downscale.rs:237` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 3) crates/op-auth-bridge/src/collab_claims.rs:531— crates/op-auth-bridge/src/collab_claims.rs:531-535 | crates/op-collab-transport/src/admission.rs:700-704 | crates/op-collab/src/profile_validation.rs:126-130 — before extracting anything, compare `crates/op-auth-bridge/src/collab_claims.rs` and `crates/op-collab-transport/src/admission.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 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 (5 lines × 3) crates/op-editor-ui/src/widgets/home_surface_paint_cards.rs:48— crates/op-editor-ui/src/widgets/home_surface_paint_cards.rs:48-52 | crates/op-editor-ui/src/widgets/works_reader_paint.rs:27-31 | crates/op-editor-ui/src/widgets/workspace_surface_paint.rs:33-37 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/home_surface_paint_cards.rs:48` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) crates/op-host-native/src/backend/skia/image.rs:524— crates/op-host-native/src/backend/skia/image.rs:524-528 | crates/op-host-web/src/canvaskit/convert.rs:65-69 | crates/op-pen-loader/src/layout_scene.rs:573-577 — 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 × 3) crates/op-collab-smoke/src/fault_owner.rs:89— crates/op-collab-smoke/src/fault_owner.rs:89-93 | crates/op-collab-smoke/src/fault_owner.rs:185-189 | crates/op-collab-smoke/src/fault_owner.rs:254-258 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) crates/op-orchestrator/src/category_grid_density.rs:203— crates/op-orchestrator/src/category_grid_density.rs:203-207 | crates/op-orchestrator/src/repair_record.rs:429-433 | crates/op-orchestrator/src/role_post_pass/mobile_category_row.rs:81-85 — 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 × 3) crates/op-host-web/src/file_actions.rs:135— crates/op-host-web/src/file_actions.rs:135-139 | crates/op-host-web/src/file_actions.rs:197-201 | crates/op-host-web/src/file_actions/save_payload.rs:182-186 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-web/src/file_actions.rs:135` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) crates/op-design-lint/src/node_util.rs:506— crates/op-design-lint/src/node_util.rs:506-510 | crates/op-orchestrator/src/validation_dump.rs:284-288 | crates/op-orchestrator/src/validation_fixes_apply.rs:579-583 — before extracting anything, compare `crates/op-design-lint/src/node_util.rs` and `crates/op-orchestrator/src/validation_dump.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-design-lint/src/node_util.rs:506` it does not close everything it opens, so those 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 `node` to `&PenNode` in one and `&jian_ops_schema::node::PenNode` 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) crates/op-orchestrator/src/mobile_action_bar_full_page.rs:364— crates/op-orchestrator/src/mobile_action_bar_full_page.rs:364-368 | crates/op-orchestrator/src/mobile_action_bar_plan.rs:89-93 | crates/op-orchestrator/src/subtask_completeness_bottom_action.rs:39-43 — 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 (5 lines × 3) templates/step0/_generators/tpl_brand_concept_sheet.py:54— templates/step0/_generators/tpl_brand_concept_sheet.py:54-58 | templates/step0/_generators/tpl_brand_concept_sheet.py:63-67 | templates/step0/_generators/tpl_logo_qa_board.py:98-102 — 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. 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.
op_figma::instance::apply_instance_overrides_cached (cyclomatic 102) crates/op-figma/src/instance.rs:102— op_figma::instance::apply_instance_overrides_cached has cyclomatic complexity 102 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_figma::instance::fingerprint::score (cyclomatic 31) crates/op-figma/src/instance/fingerprint.rs:202— op_figma::instance::fingerprint::score 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.
op_figma::instance::apply::apply_to_node (cyclomatic 28) crates/op-figma/src/instance/apply.rs:188— op_figma::instance::apply::apply_to_node 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.
op_figma::boolean_fallback::apply_result_paint_to_artwork (cyclomatic 25) crates/op-figma/src/boolean_fallback.rs:264— op_figma::boolean_fallback::apply_result_paint_to_artwork has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
op_figma::node_mapper::style_references::resolve_on_node (cyclomatic 23) crates/op-figma/src/node_mapper/style_references.rs:121— op_figma::node_mapper::style_references::resolve_on_node 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.
op_figma::vector_decoder::scale_command_path (cyclomatic 23) crates/op-figma/src/vector_decoder.rs:96— op_figma::vector_decoder::scale_command_path 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.
op_figma::instance::swap_filter::filter_swap_stale_derived (cyclomatic 21) crates/op-figma/src/instance/swap_filter.rs:23— op_figma::instance::swap_filter::filter_swap_stale_derived 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.
op_figma::clipboard::parse_clipboard_html_styles (cyclomatic 19) crates/op-figma/src/clipboard.rs:333— op_figma::clipboard::parse_clipboard_html_styles 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.
op_figma::converters::convert_vector (cyclomatic 17) crates/op-figma/src/converters.rs:562— op_figma::converters::convert_vector 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.
op_figma::instance::assignment::seed_assignments_from_instances::collect_geom (cyclomatic 16) crates/op-figma/src/instance/assignment.rs:127— op_figma::instance::assignment::seed_assignments_from_instances::collect_geom 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.
op_figma::text_mapper::parse_font_weight (cyclomatic 16) crates/op-figma/src/text_mapper.rs:243— op_figma::text_mapper::parse_font_weight 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.
op_figma::vector_decoder::decode_vector_network_blob (cyclomatic 16) crates/op-figma/src/vector_decoder.rs:490— op_figma::vector_decoder::decode_vector_network_blob 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.
Duplicated block (9–10 lines × 2) crates/op-design-lint/src/detectors/spacing.rs:55— crates/op-design-lint/src/detectors/spacing.rs:55-64 | crates/op-design-lint/src/detectors/spacing.rs:70-78 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (9–10 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_builtin_form.rs:119— crates/op-editor-ui/src/widgets/agent_settings_builtin_form.rs:119-127 | crates/op-editor-ui/src/widgets/agent_settings_images/paint.rs:740-749 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/agent_settings_builtin_form.rs:119` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 2) crates/op-editor-ui/src/widgets/canvas_viewport.rs:282— crates/op-editor-ui/src/widgets/canvas_viewport.rs:282-290 | crates/op-editor-ui/src/widgets/path_anchor_context_menu.rs:130-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/canvas_viewport.rs:282` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: `crates/op-editor-ui/src/widgets/canvas_viewport.rs:282` is reached only past a guard at line 171 that tests `rect.size.x` and leaves the function early, and `crates/op-editor-ui/src/widgets/path_anchor_context_menu.rs:130` reads `rect.size.x` with no such check. What separates these copies is not which lines they run but which PRECONDITION they enforce, so one of them is operating on state the other one refuses. Decide which is intended BEFORE unifying them — extract the shared part and whichever copy is missing the check keeps running unchecked, and if the guard is the correct behaviour then that hole is already live.
Duplicated block (9–10 lines × 2) crates/op-editor-ui/src/widgets/prompt_center_panel_paint.rs:170— crates/op-editor-ui/src/widgets/prompt_center_panel_paint.rs:170-179 | crates/op-editor-ui/src/widgets/prompt_center_panel_paint.rs:295-303 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/prompt_center_panel_paint.rs:170` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 2) crates/op-host-services/src/mcp_serve/sniff.rs:15— crates/op-host-services/src/mcp_serve/sniff.rs:15-24 | crates/op-host-services/src/mcp_serve/sniff.rs:33-41 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 2) crates/op-host-web/src/dom_io/html_directory_session.rs:207— crates/op-host-web/src/dom_io/html_directory_session.rs:207-216 | crates/op-host-web/src/dom_io/html_zip_session.rs:179-187 — before extracting anything, compare `crates/op-host-web/src/dom_io/html_directory_session.rs` and `crates/op-host-web/src/dom_io/html_zip_session.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-web/src/dom_io/html_directory_session.rs:207` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9–10 lines × 2) crates/op-mcp/src/batch_get.rs:354— crates/op-mcp/src/batch_get.rs:354-362 | crates/op-mcp/src/style_ops_tools.rs:354-363 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-mcp/src/batch_get.rs:354` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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–10 lines × 2) crates/op-orchestrator/src/cleanup_root_and_nav.rs:270— crates/op-orchestrator/src/cleanup_root_and_nav.rs:270-279 | crates/op-orchestrator/src/cleanup_root_and_nav.rs:336-344 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-orchestrator/src/cleanup_root_and_nav.rs:270` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9–10 lines × 2) crates/op-orchestrator/src/map_viewport.rs:139— crates/op-orchestrator/src/map_viewport.rs:139-147 | crates/op-orchestrator/src/plan_map_budget.rs:48-57 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-orchestrator/src/map_viewport.rs:139` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 2) crates/op-orchestrator/src/validation_fixes_apply.rs:248— crates/op-orchestrator/src/validation_fixes_apply.rs:248-256 | crates/op-orchestrator/src/validation_fixes_apply.rs:297-306 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-orchestrator/src/validation_fixes_apply.rs:248` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 2) crates/op-preview-core/src/present.rs:180— crates/op-preview-core/src/present.rs:180-188 | crates/op-preview-core/src/present.rs:190-199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-preview-core/src/present.rs:180` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9–10 lines × 2) templates/step0/_generators/tpl_tutorial_skincare.py:244— templates/step0/_generators/tpl_tutorial_skincare.py:244-252 | templates/step0/_generators/tpl_tutorial_storage.py:254-263 — before extracting anything, compare `templates/step0/_generators/tpl_tutorial_skincare.py` and `templates/step0/_generators/tpl_tutorial_storage.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `templates/step0/_generators/tpl_tutorial_skincare.py:244` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) crates/op-builtin-model-discovery/src/lib.rs:217— crates/op-builtin-model-discovery/src/lib.rs:217-223 | crates/op-host-services/src/hub_auth_client.rs:211-217 | crates/op-host-services/src/web_credentials.rs:151-157 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-builtin-model-discovery/src/lib.rs:217` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) crates/op-editor-ui/src/widgets/design_md_line_cache.rs:85— crates/op-editor-ui/src/widgets/design_md_line_cache.rs:85-91 | crates/op-editor-ui/src/widgets/font_picker_cache.rs:77-83 | crates/op-editor-ui/src/widgets/layer_panel_cache.rs:215-221 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/design_md_line_cache.rs:85` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) crates/op-editor-ui/src/widgets/toolbar.rs:205— crates/op-editor-ui/src/widgets/toolbar.rs:205-211 | crates/op-editor-ui/src/widgets/toolbar.rs:249-255 | crates/op-editor-ui/src/widgets/toolbar.rs:346-352 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/toolbar.rs:205` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) crates/op-host-desktop/src/mcp_integrations.rs:453— crates/op-host-desktop/src/mcp_integrations.rs:453-459 | crates/op-host-desktop/src/mcp_integrations.rs:462-468 | crates/op-host-desktop/src/mcp_integrations.rs:511-517 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-desktop/src/mcp_integrations.rs:453` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 × 3) crates/op-host-services/src/chat_spawn.rs:159— crates/op-host-services/src/chat_spawn.rs:159-165 | crates/op-host-services/src/cli_probe_support.rs:97-107 | crates/op-host-services/src/provider_probe.rs:311-317 — before extracting anything, compare `crates/op-host-services/src/chat_spawn.rs` and `crates/op-host-services/src/provider_probe.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-services/src/chat_spawn.rs:159` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) crates/op-host-services/src/profile_avatar_fetch.rs:187— crates/op-host-services/src/profile_avatar_fetch.rs:187-193 | crates/op-host-services/src/public_https_client.rs:38-44 | crates/op-host-services/src/public_https_client.rs:62-68 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-services/src/profile_avatar_fetch.rs:187` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) crates/op-host-web/src/codegen_web.rs:298— crates/op-host-web/src/codegen_web.rs:298-304 | crates/op-host-web/src/codegen_web.rs:326-334 | crates/op-host-web/src/codegen_web.rs:677-683 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) crates/op-host-web/src/preview_pump.rs:66— crates/op-host-web/src/preview_pump.rs:66-72 | crates/op-host-web/src/studio_web.rs:253-259 | crates/op-host-web/src/tooltip_pump.rs:50-58 — before extracting anything, compare `crates/op-host-web/src/preview_pump.rs` and `crates/op-host-web/src/tooltip_pump.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-web/src/preview_pump.rs:66` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) crates/op-orchestrator/src/geometry_row_fixes.rs:448— crates/op-orchestrator/src/geometry_row_fixes.rs:448-454 | crates/op-orchestrator/src/geometry_row_fixes.rs:594-600 | crates/op-orchestrator/src/geometry_starved_row.rs:146-152 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-orchestrator/src/geometry_row_fixes.rs:448` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) crates/op-host-services/src/web_image_generate.rs:391— crates/op-host-services/src/web_image_generate.rs:391-397 | crates/op-host-services/src/web_image_generate.rs:460-466 | crates/op-host-services/src/web_image_generate.rs:530-538 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-services/src/web_image_generate.rs:391` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) crates/op-editor-ui/src/widgets/agent_settings_images_parts.rs:477— crates/op-editor-ui/src/widgets/agent_settings_images_parts.rs:477-484 | crates/op-editor-ui/src/widgets/ai_chat_panel_paint.rs:56-62 | crates/op-editor-ui/src/widgets/settings_form.rs:38-45 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/agent_settings_images_parts.rs:477` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) templates/step0/_generators/tpl1.py:60— templates/step0/_generators/tpl1.py:60-66 | templates/step0/_generators/tpl2.py:80-86 | templates/step0/_generators/tpl3.py:47-53 — 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 `templates/step0/_generators/tpl1.py:60` it begins part-way through the construct above it, so those 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.
op_host_desktop::persistence::run_action (cyclomatic 42) crates/op-host-desktop/src/persistence.rs:372— op_host_desktop::persistence::run_action has cyclomatic complexity 42 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_host_desktop::design_session::apply_progress (cyclomatic 31) crates/op-host-desktop/src/design_session.rs:321— op_host_desktop::design_session::apply_progress has cyclomatic complexity 31 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_host_desktop::chat_session_launch::launch_if_pending_inner (cyclomatic 24) crates/op-host-desktop/src/chat_session_launch.rs:112— op_host_desktop::chat_session_launch::launch_if_pending_inner has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_host_desktop::mcp_integrations_dsh::update_dsh_patch_config (cyclomatic 24) crates/op-host-desktop/src/mcp_integrations_dsh.rs:98— op_host_desktop::mcp_integrations_dsh::update_dsh_patch_config 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.
op_host_desktop::chat_acp::run_acp_turn (cyclomatic 22) crates/op-host-desktop/src/chat_acp.rs:457— op_host_desktop::chat_acp::run_acp_turn has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_host_desktop::design_md_host::run_mcp_design_md_provider_blocking (cyclomatic 20) crates/op-host-desktop/src/design_md_host.rs:156— op_host_desktop::design_md_host::run_mcp_design_md_provider_blocking 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.
op_host_desktop::design_session::pump_commands (cyclomatic 20) crates/op-host-desktop/src/design_session.rs:42— op_host_desktop::design_session::pump_commands 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.
op_host_desktop::design_session_workers::finish_design_success (cyclomatic 20) crates/op-host-desktop/src/design_session_workers.rs:290— op_host_desktop::design_session_workers::finish_design_success 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.
op_host_desktop::figma_import_session::pump (cyclomatic 17) crates/op-host-desktop/src/figma_import_session.rs:411— op_host_desktop::figma_import_session::pump has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_host_desktop::mcp_integrations::config_path (cyclomatic 17) crates/op-host-desktop/src/mcp_integrations.rs:143— op_host_desktop::mcp_integrations::config_path has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_host_desktop::chat_session::execute_tool_requests (cyclomatic 16) crates/op-host-desktop/src/chat_session.rs:289— op_host_desktop::chat_session::execute_tool_requests 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.
op_chat_agent::chat_agent_loop::openai::run_openai_agent_loop_inner (cognitive 75) crates/op-chat-agent/src/chat_agent_loop/openai.rs:37— op_chat_agent::chat_agent_loop::openai::run_openai_agent_loop_inner has cognitive complexity 75 (threshold 15). Drivers by points: if/else 24 (56 pts), loops 5 (11 pts), boolean chains 5, match/switch 1 (3 pts) (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_chat_agent::chat_agent_loop::anthropic::run_anthropic_agent_loop_inner (cognitive 73) crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:80— op_chat_agent::chat_agent_loop::anthropic::run_anthropic_agent_loop_inner has cognitive complexity 73 (threshold 15). Drivers by points: if/else 20 (50 pts), loops 6 (15 pts), boolean chains 5, match/switch 1 (3 pts) (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_chat_agent::design_agent_tools::execute_design_tool_with_root_seed_guard (cognitive 60) crates/op-chat-agent/src/design_agent_tools.rs:173— op_chat_agent::design_agent_tools::execute_design_tool_with_root_seed_guard has cognitive complexity 60 (threshold 15). Drivers by points: if/else 30 (57 pts), boolean chains 3 (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.
op_chat_agent::design_context::collect_design_facts (cognitive 30) crates/op-chat-agent/src/design_context.rs:84— op_chat_agent::design_context::collect_design_facts has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (6 pts), boolean chains 5 (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.
op_chat_agent::backoff::send_with_backoff (cognitive 22) crates/op-chat-agent/src/backoff.rs:171— op_chat_agent::backoff::send_with_backoff has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (18 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_chat_agent::chat_agent_loop::pump_sse (cognitive 21) crates/op-chat-agent/src/chat_agent_loop.rs:395— op_chat_agent::chat_agent_loop::pump_sse has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_chat_agent::chat_modify::run_modify_turn_inner (cognitive 21) crates/op-chat-agent/src/chat_modify.rs:462— op_chat_agent::chat_modify::run_modify_turn_inner has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (18 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.
op_chat_agent::design_agent_tools::quality_scans::scan_header_icon_row_issues::walk (cognitive 18) crates/op-chat-agent/src/design_agent_tools/quality_scans.rs:113— op_chat_agent::design_agent_tools::quality_scans::scan_header_icon_row_issues::walk has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (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.
op_chat_agent::design_agent_tools::root_seed::seed_root_frame_if_needed (cognitive 18) crates/op-chat-agent/src/design_agent_tools/root_seed.rs:426— op_chat_agent::design_agent_tools::root_seed::seed_root_frame_if_needed has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 5, 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.
op_chat_agent::design_agent_diagnostics::scan_container_intent (cognitive 17) crates/op-chat-agent/src/design_agent_diagnostics.rs:204— op_chat_agent::design_agent_diagnostics::scan_container_intent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 6 (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.
op_chat_agent::design_agent_tools::quality_scans::scan_empty_shells::walk (cognitive 17) crates/op-chat-agent/src/design_agent_tools/quality_scans.rs:152— op_chat_agent::design_agent_tools::quality_scans::scan_empty_shells::walk has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 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.
D4 · Code Duplication· Edited copy of a member (22 corresponding lines) · ×11
Edited copy of a member (22 corresponding lines) crates/op-editor-core/src/svg_import/style.rs:98— crates/op-editor-core/src/svg_import/style.rs:98-119 | crates/op-editor-core/src/svg_import/style.rs:121-143 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) crates/op-mcp/src/bulk_vars.rs:51— crates/op-mcp/src/bulk_vars.rs:51-75 | crates/op-mcp/src/bulk_vars.rs:89-110 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) crates/op-host-native/src/widget_host/slides_panel.rs:269— crates/op-host-native/src/widget_host/slides_panel.rs:269-291 | crates/op-host-web/src/widget_host/slides_panel.rs:154-175 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) crates/op-editor-core/src/host_preset_name_draft.rs:46— crates/op-editor-core/src/host_preset_name_draft.rs:46-67 | crates/op-editor-core/src/host_preset_name_draft.rs:71-92 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) crates/op-orchestrator/src/category_grid_reflow.rs:181— crates/op-orchestrator/src/category_grid_reflow.rs:181-204 | crates/op-orchestrator/src/repair_record.rs:485-506 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) crates/op-figma/src/converters.rs:165— crates/op-figma/src/converters.rs:165-186 | crates/op-figma/src/converters.rs:192-222 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) crates/op-auth-bridge/src/collab_claims.rs:537— crates/op-auth-bridge/src/collab_claims.rs:537-558 | crates/op-collab/src/profile_validation.rs:139-160 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) crates/op-design-lint/src/detectors/structure.rs:103— crates/op-design-lint/src/detectors/structure.rs:103-124 | crates/op-design-lint/src/detectors/text.rs:62-83 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) crates/op-host-native/src/widget_host/variables_panel_row_press.rs:137— crates/op-host-native/src/widget_host/variables_panel_row_press.rs:137-161 | crates/op-host-native/src/widget_host/variables_panel_row_press.rs:214-235 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) templates/step0/_generators/tpl1.py:205— templates/step0/_generators/tpl1.py:205-231 | templates/step0/_generators/tpl2.py:190-211 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) crates/op-editor-ui/src/widgets/canvas_viewport_paint/entry.rs:170— crates/op-editor-ui/src/widgets/canvas_viewport_paint/entry.rs:170-191 | crates/op-editor-ui/src/widgets/canvas_viewport_paint/entry.rs:295-318 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (21 lines × 2) crates/op-auth-bridge/src/collab_claims.rs:424— crates/op-auth-bridge/src/collab_claims.rs:424-444 | crates/op-collab-transport/src/admission.rs:588-608 — before extracting anything, compare `crates/op-auth-bridge/src/collab_claims.rs` and `crates/op-collab-transport/src/admission.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (21 lines × 2) crates/op-engine-ffi/src/editor_chat_design_launch.rs:71— crates/op-engine-ffi/src/editor_chat_design_launch.rs:71-91 | crates/op-host-services/src/chat_builtin_http.rs:438-458 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-engine-ffi/src/editor_chat_design_launch.rs:71` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 2) crates/op-host-native/src/widget_host/preview_slideshow.rs:352— crates/op-host-native/src/widget_host/preview_slideshow.rs:352-372 | crates/op-host-web/src/widget_host/preview_slideshow.rs:511-531 — before extracting anything, compare `crates/op-host-native/src/widget_host/preview_slideshow.rs` and `crates/op-host-web/src/widget_host/preview_slideshow.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 171 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (21 lines × 2) crates/op-html/src/css/cascade.rs:626— crates/op-html/src/css/cascade.rs:626-646 | crates/op-html/src/css/declarations_deferred.rs:87-107 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-html/src/css/cascade.rs:626` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 2) crates/op-image-enrich/src/net/fetch.rs:200— crates/op-image-enrich/src/net/fetch.rs:200-220 | crates/op-image-enrich/src/net/fetch.rs:222-242 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) crates/op-orchestrator/src/category_grid_reflow.rs:184— crates/op-orchestrator/src/category_grid_reflow.rs:184-204 | crates/op-orchestrator/src/repair_record.rs:486-506 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (21 lines × 2) crates/op-host-services/src/export_html_structured/fallback.rs:78— crates/op-host-services/src/export_html_structured/fallback.rs:78-98 | crates/op-host-services/src/export_pptx/fallback.rs:61-81 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (21 lines × 2) crates/op-chrome-extension-core/src/design_md_palette.rs:141— crates/op-chrome-extension-core/src/design_md_palette.rs:141-161 | crates/op-chrome-extension-core/src/design_md_render.rs:282-302 — 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 (21 lines × 2) crates/op-editor-host-core/src/settings_io_checked.rs:40— crates/op-editor-host-core/src/settings_io_checked.rs:40-60 | crates/op-host-web/src/web_settings_validation.rs:368-388 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-host-core/src/settings_io_checked.rs:40` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 2) crates/op-codegen/src/codegen_html.rs:86— crates/op-codegen/src/codegen_html.rs:86-106 | crates/op-codegen/src/codegen_targets.rs:335-355 — before extracting anything, compare `crates/op-codegen/src/codegen_html.rs` and `crates/op-codegen/src/codegen_targets.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-codegen/src/codegen_html.rs:86` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (21 lines × 2) templates/step0/_generators/tpl_tutorial_diy.py:302— templates/step0/_generators/tpl_tutorial_diy.py:302-322 | templates/step0/_generators/tpl_tutorial_report.py:270-290 — 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 `templates/step0/_generators/tpl_tutorial_diy.py:302` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 3) crates/op-editor-core/src/fills/primary.rs:42— crates/op-editor-core/src/fills/primary.rs:42-50 | crates/op-editor-core/src/fills/primary.rs:64-72 | crates/op-editor-core/src/fills/primary.rs:90-98 — all 3 copies are in the same file, so extract the block into one function there and call 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 (9 lines × 3) crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs:456— crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs:456-464 | crates/op-editor-ui/src/widgets/home_surface_paint_panels.rs:201-209 | crates/op-editor-ui/src/widgets/workspace_surface_banner.rs:106-114 — before extracting anything, compare `crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs` and `crates/op-editor-ui/src/widgets/home_surface_paint_panels.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 197 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs:456` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) crates/op-host-services/src/design_session.rs:55— crates/op-host-services/src/design_session.rs:55-63 | crates/op-host-services/src/design_session.rs:314-322 | crates/op-host-services/src/design_variants.rs:44-52 — before extracting anything, compare `crates/op-host-services/src/design_session.rs` and `crates/op-host-services/src/design_variants.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) crates/op-host-services/src/doc_io.rs:185— crates/op-host-services/src/doc_io.rs:185-193 | crates/op-host-services/src/doc_io/clean_copy.rs:62-70 | crates/op-host-services/src/doc_io/clean_copy.rs:124-132 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-services/src/doc_io.rs:185` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) crates/op-image-enrich/src/net/fetch.rs:294— crates/op-image-enrich/src/net/fetch.rs:294-302 | crates/op-image-enrich/src/net/fetch.rs:374-382 | crates/op-image-enrich/src/net/providers.rs:458-466 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9 lines × 3) crates/op-orchestrator/src/map_viewport.rs:142— crates/op-orchestrator/src/map_viewport.rs:142-150 | crates/op-orchestrator/src/plan_detail_budget.rs:44-52 | crates/op-orchestrator/src/plan_map_budget.rs:52-60 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-orchestrator/src/map_viewport.rs:142` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 3) crates/op-pen-loader/src/widget_payload.rs:28— crates/op-pen-loader/src/widget_payload.rs:28-36 | crates/op-pen-loader/src/widget_payload.rs:48-56 | crates/op-pen-loader/src/widget_payload.rs:68-76 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-pen-loader/src/widget_payload.rs:28` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) crates/op-mcp/src/node_attr_tools.rs:469— crates/op-mcp/src/node_attr_tools.rs:469-477 | crates/op-mcp/src/page_tools.rs:495-503 | crates/op-mcp/src/write_tools.rs:279-289 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-mcp/src/node_attr_tools.rs:469` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) crates/op-collab-smoke/src/fault_owner.rs:78— crates/op-collab-smoke/src/fault_owner.rs:78-86 | crates/op-collab-smoke/src/fault_owner.rs:115-123 | crates/op-collab-smoke/src/fault_owner.rs:168-176 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-collab-smoke/src/fault_owner.rs:78` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) crates/op-editor-core/src/command_node_attrs/slots.rs:112— crates/op-editor-core/src/command_node_attrs/slots.rs:112-120 | crates/op-editor-core/src/fills/access.rs:65-73 | crates/op-orchestrator/src/variable_binding.rs:377-385 — before extracting anything, compare `crates/op-editor-core/src/fills/access.rs` and `crates/op-orchestrator/src/variable_binding.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/command_node_attrs/slots.rs:112` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/op-editor-core/src/command_node_attrs/slots.rs:121` calls `IconFont`, `Some` and `crates/op-orchestrator/src/variable_binding.rs:386` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 3) crates/op-editor-core/src/fills/access.rs:233— crates/op-editor-core/src/fills/access.rs:233-241 | crates/op-host-services/src/pre_validator.rs:308-316 | crates/op-pen-loader/src/effects.rs:128-136 — 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 before the matched lines, `crates/op-editor-core/src/fills/access.rs:232` calls `Image`, `as_deref` and `crates/op-pen-loader/src/effects.rs:127` 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.
TodoComment crates/op-orchestrator/src/cleanup_nav_surface_tests.rs:105— // TODO(reconcile w/ Kayshen e3ed2f1e "normalize mobile bottom tabs"): 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 crates/op-orchestrator/src/validation_fixes_b3.rs:135— // TODO: wire a real IconResolver trait when host-side icon lookup — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/op-orchestrator/src/validation_fixes_b3.rs:410— // TODO: resolve icon d-string via an `IconResolver` trait when available. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/op-orchestrator/src/validation_fixes_b3.rs:430— // TODO: icon resolver — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/op-orchestrator/src/validation_fixes_b3.rs:431— // TODO: icon resolver — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/op-host-services/src/cli_provider_probe.rs:47— /// TODO(follow-up, needs `provider_probe.rs`): have `connect_provider` forward — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/op-host-native/src/widget_host/home.rs:297— // TODO(hosted-quota): the free tier becomes its own — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/op-host-desktop/src/design_session.rs:111— // TODO(host): wire into op-editor-core history batch mode — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/op-editor-ui/src/widgets/property_panel_interactions.rs:10— //! route path is read-only here; editing it is a v2 TODO). — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crates/op-codegen/src/ai/assets.rs:8— //! PARITY TODO: consumer-view enrichment (enrichNodeLocallyForAIConsumerView) — 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.
op_ai_skills::frontmatter::entries (cognitive 38) crates/op-ai-skills/src/frontmatter.rs:119— op_ai_skills::frontmatter::entries has cognitive complexity 38 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 4 (14 pts), match/switch 1 (6 pts), boolean chains 3 (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.
op_ai_skills::style_guide::design_md_import::header_tags (cognitive 25) crates/op-ai-skills/src/style_guide/design_md_import.rs:279— op_ai_skills::style_guide::design_md_import::header_tags has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (7 pts), match/switch 1 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_ai_skills::frontmatter::parse_skill_frontmatter (cognitive 24) crates/op-ai-skills/src/frontmatter.rs:189— op_ai_skills::frontmatter::parse_skill_frontmatter has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 4 (14 pts), if/else 5 (9 pts), loops 1 (nesting depth added 14). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
op_ai_skills::budget::trim_by_budget_pinned (cognitive 23) crates/op-ai-skills/src/budget.rs:121— op_ai_skills::budget::trim_by_budget_pinned has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 4, 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.
op_ai_skills::style_guide::parser::extract_radius (cognitive 23) crates/op-ai-skills/src/style_guide/parser.rs:251— op_ai_skills::style_guide::parser::extract_radius has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_ai_skills::style_guide::token_table::extract_table_colors (cognitive 21) crates/op-ai-skills/src/style_guide/token_table.rs:288— op_ai_skills::style_guide::token_table::extract_table_colors has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 15, if/else 1 (3 pts), loops 2 (3 pts) (nesting depth added 3). 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.
op_ai_skills::style_guide::key_aesthetics::signature_recipes (cognitive 19) crates/op-ai-skills/src/style_guide/key_aesthetics.rs:44— op_ai_skills::style_guide::key_aesthetics::signature_recipes has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (18 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.
op_ai_skills::style_guide::parser::extract_typography (cognitive 19) crates/op-ai-skills/src/style_guide/parser.rs:168— op_ai_skills::style_guide::parser::extract_typography has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, loops 2, match/switch 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.
op_ai_skills::style_guide::design_md_import::scan_hex_colors (cognitive 16) crates/op-ai-skills/src/style_guide/design_md_import.rs:347— op_ai_skills::style_guide::design_md_import::scan_hex_colors has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_ai_skills::style_guide::token_table::extract_prose_radius (cognitive 16) crates/op-ai-skills/src/style_guide/token_table.rs:449— op_ai_skills::style_guide::token_table::extract_prose_radius has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), boolean chains 5, 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.
D4 · Code Duplication· Edited copy of a member (29 corresponding lines) · ×10
Edited copy of a member (29 corresponding lines) crates/op-editor-core/src/svg_import/lexer.rs:10— crates/op-editor-core/src/svg_import/lexer.rs:10-47 | crates/op-editor-core/src/svg_import/xml.rs:95-166 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) crates/op-editor-ui/src/widgets/missing_fonts_panel.rs:284— crates/op-editor-ui/src/widgets/missing_fonts_panel.rs:284-320 | crates/op-editor-ui/src/widgets/property_panel_code_error.rs:267-295 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) crates/op-editor-ui/src/widgets/layer_panel.rs:201— crates/op-editor-ui/src/widgets/layer_panel.rs:201-229 | crates/op-editor-ui/src/widgets/layer_panel_walkers.rs:122-152 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) crates/op-editor-ui/src/widgets/property_panel_sections.rs:721— crates/op-editor-ui/src/widgets/property_panel_sections.rs:721-749 | crates/op-editor-ui/src/widgets/property_panel_video.rs:240-273 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) crates/op-host-desktop/src/design_session_workers.rs:227— crates/op-host-desktop/src/design_session_workers.rs:227-258 | crates/op-host-desktop/src/design_session_workers.rs:260-288 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) crates/op-editor-ui/src/widgets/property_panel_flex.rs:371— crates/op-editor-ui/src/widgets/property_panel_flex.rs:371-399 | crates/op-editor-ui/src/widgets/property_panel_text.rs:615-643 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) crates/op-ai-skills/src/style_guide/key_aesthetics.rs:11— crates/op-ai-skills/src/style_guide/key_aesthetics.rs:11-39 | crates/op-ai-skills/src/style_guide/key_aesthetics.rs:44-83 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) crates/op-html/src/mapper_margin.rs:377— crates/op-html/src/mapper_margin.rs:377-411 | crates/op-html/src/mapper_offset.rs:174-202 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) crates/op-design-lint/src/detectors/structural_quality.rs:96— crates/op-design-lint/src/detectors/structural_quality.rs:96-124 | crates/op-design-lint/src/detectors/structural_quality.rs:143-180 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) crates/op-collab/src/codec.rs:390— crates/op-collab/src/codec.rs:390-423 | crates/op-pen-loader/src/payload.rs:457-485 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (30 corresponding lines) · ×10
Edited copy of a member (30 corresponding lines) crates/op-engine-ffi/src/editor_chat_design_tools.rs:62— crates/op-engine-ffi/src/editor_chat_design_tools.rs:62-96 | crates/op-host-desktop/src/chat_session.rs:564-593 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) crates/op-editor-ui/src/widgets/agent_settings_panel/layout.rs:82— crates/op-editor-ui/src/widgets/agent_settings_panel/layout.rs:82-118 | crates/op-editor-ui/src/widgets/agent_settings_panel/layout.rs:120-149 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) crates/op-engine-ffi/src/editor_chat_prepare.rs:62— crates/op-engine-ffi/src/editor_chat_prepare.rs:62-91 | crates/op-host-desktop/src/chat_session_launch_providers.rs:247-282 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) crates/op-editor-ui/src/widgets/property_panel_effects.rs:158— crates/op-editor-ui/src/widgets/property_panel_effects.rs:158-187 | crates/op-editor-ui/src/widgets/property_panel_interactions.rs:408-438 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) crates/op-host-desktop/src/app_state.rs:569— crates/op-host-desktop/src/app_state.rs:569-605 | crates/op-host-desktop/src/persistence_replace_guard.rs:27-56 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) templates/step0/_generators/tpl_deck_gridpaper.py:340— templates/step0/_generators/tpl_deck_gridpaper.py:340-371 | templates/step0/_generators/tpl_deck_gridpaper.py:573-602 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) crates/op-host-desktop/src/persistence_export_html.rs:16— crates/op-host-desktop/src/persistence_export_html.rs:16-45 | crates/op-host-desktop/src/persistence_export_pptx.rs:16-45 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) crates/op-editor-ui/src/widgets/agent_settings_builtin_parts.rs:236— crates/op-editor-ui/src/widgets/agent_settings_builtin_parts.rs:236-267 | crates/op-editor-ui/src/widgets/canvas_collab_presence.rs:111-140 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) crates/op-editor-ui/src/widgets/top_bar.rs:582— crates/op-editor-ui/src/widgets/top_bar.rs:582-611 | crates/op-editor-ui/src/widgets/top_bar.rs:637-666 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) crates/op-engine-jni/src/bindings.rs:271— crates/op-engine-jni/src/bindings.rs:271-300 | crates/op-engine-napi/src/bindings.rs:270-300 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (20 lines × 2) crates/op-editor-core/src/chat/message.rs:112— crates/op-editor-core/src/chat/message.rs:112-131 | crates/op-editor-core/src/chat/message.rs:138-157 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/chat/message.rs:112` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) crates/op-host-native/src/widget_host/variables_preset_press.rs:45— crates/op-host-native/src/widget_host/variables_preset_press.rs:45-64 | crates/op-host-web/src/widget_host/variables_preset_press.rs:22-41 — before extracting anything, compare `crates/op-host-native/src/widget_host/variables_preset_press.rs` and `crates/op-host-web/src/widget_host/variables_preset_press.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (20 lines × 2) crates/op-host-services/src/export_html_structured.rs:106— crates/op-host-services/src/export_html_structured.rs:106-125 | crates/op-host-services/src/export_pptx.rs:153-172 — before extracting anything, compare `crates/op-host-services/src/export_html_structured.rs` and `crates/op-host-services/src/export_pptx.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-services/src/export_html_structured.rs:106` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) crates/op-orchestrator/src/card_inner_padding.rs:278— crates/op-orchestrator/src/card_inner_padding.rs:278-297 | crates/op-orchestrator/src/touch_target_floor.rs:206-225 — before extracting anything, compare `crates/op-orchestrator/src/card_inner_padding.rs` and `crates/op-orchestrator/src/touch_target_floor.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (20 lines × 2) crates/op-orchestrator/src/finalize_enforce_status_bar.rs:209— crates/op-orchestrator/src/finalize_enforce_status_bar.rs:209-228 | crates/op-orchestrator/src/finalize_enforce_status_bar.rs:273-292 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-orchestrator/src/finalize_enforce_status_bar.rs:209` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) crates/op-figma/src/instance/fingerprint.rs:381— crates/op-figma/src/instance/fingerprint.rs:381-400 | crates/op-figma/src/instance/fingerprint.rs:434-453 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) crates/op-host-native/src/widget_host/workspace.rs:492— crates/op-host-native/src/widget_host/workspace.rs:492-511 | crates/op-host-web/src/widget_host/studio_workspace.rs:398-417 — before extracting anything, compare `crates/op-host-native/src/widget_host/workspace.rs` and `crates/op-host-web/src/widget_host/studio_workspace.rs` 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-native/src/widget_host/workspace.rs:492` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) crates/op-pen-loader/src/adapter/geometry.rs:72— crates/op-pen-loader/src/adapter/geometry.rs:72-91 | crates/op-pen-loader/src/layout_repair.rs:706-725 — 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) templates/step0/_generators/tpl_tutorial_diy.py:161— templates/step0/_generators/tpl_tutorial_diy.py:161-180 | templates/step0/_generators/tpl_tutorial_workout.py:159-178 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from 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 (20 lines × 2) packaging/ios/Sources/DocumentExportCoordinator.swift:150— packaging/ios/Sources/DocumentExportCoordinator.swift:150-169 | packaging/ios/Sources/DocumentSaveCoordinator.swift:330-349 — 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–12 lines × 2) crates/op-design-lint/src/detectors/spacing.rs:211— crates/op-design-lint/src/detectors/spacing.rs:211-221 | crates/op-orchestrator/src/hero_bleed.rs:696-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. 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) crates/op-editor-ui/src/widgets/agent_settings_account.rs:98— crates/op-editor-ui/src/widgets/agent_settings_account.rs:98-109 | crates/op-editor-ui/src/widgets/agent_settings_account.rs:253-263 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) crates/op-editor-ui/src/widgets/component_browser_panel.rs:546— crates/op-editor-ui/src/widgets/component_browser_panel.rs:546-557 | crates/op-editor-ui/src/widgets/prompt_center_panel_paint.rs:124-134 — 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–12 lines × 2) crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs:513— crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs:513-524 | crates/op-editor-ui/src/widgets/home_surface_paint_panels.rs:273-283 — before extracting anything, compare `crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs` and `crates/op-editor-ui/src/widgets/home_surface_paint_panels.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 197 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11–12 lines × 2) crates/op-engine-ffi/src/editor_chat.rs:307— crates/op-engine-ffi/src/editor_chat.rs:307-318 | crates/op-engine-ffi/src/editor_chat_hosted.rs:70-80 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-engine-ffi/src/editor_chat.rs: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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/op-engine-ffi/src/editor_chat_hosted.rs:81` calls `as_ref`, `page_identity`, `editor_state` and `crates/op-engine-ffi/src/editor_chat.rs:319` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11–12 lines × 2) crates/op-engine-jni/src/callbacks.rs:297— crates/op-engine-jni/src/callbacks.rs:297-308 | crates/op-engine-jni/src/callbacks.rs:357-367 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-engine-jni/src/callbacks.rs:297` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-engine-jni/src/callbacks.rs:296` calls `write` and `crates/op-engine-jni/src/callbacks.rs:356` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11–12 lines × 2) crates/op-host-native/src/backend/skia/path.rs:439— crates/op-host-native/src/backend/skia/path.rs:439-449 | crates/op-host-native/src/backend/skia/path.rs:532-543 — both copies are in the same file, so extract the 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 (11–12 lines × 2) crates/op-mcp/src/parser.rs:174— crates/op-mcp/src/parser.rs:174-184 | crates/op-mcp/src/parser.rs:395-406 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-mcp/src/parser.rs:174` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 2) crates/op-pen-loader/src/style_payload.rs:544— crates/op-pen-loader/src/style_payload.rs:544-554 | crates/op-preview-core/src/session_paint.rs:610-621 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-pen-loader/src/style_payload.rs:544` it begins part-way through the construct above it, so those 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 (11–12 lines × 2) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AuthCodeFormOverlay.kt:98— packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AuthCodeFormOverlay.kt:98-109 | packaging/android/app/src/main/kotlin/tech/zseven/openpencil/NativeLoginOverlay.kt:188-198 — before extracting anything, compare `packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AuthCodeFormOverlay.kt` and `packaging/android/app/src/main/kotlin/tech/zseven/openpencil/NativeLoginOverlay.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AuthCodeFormOverlay.kt:98` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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.
op_pen_loader::payload::legacy_normalize::normalize_node_value (cognitive 74) crates/op-pen-loader/src/payload/legacy_normalize.rs:179— op_pen_loader::payload::legacy_normalize::normalize_node_value has cognitive complexity 74 (threshold 15). Drivers by points: if/else 14 (60 pts), match/switch 2 (6 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 52). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
op_pen_loader::payload::legacy_normalize::auto_layout_order_evidence (cognitive 45) crates/op-pen-loader/src/payload/legacy_normalize.rs:76— op_pen_loader::payload::legacy_normalize::auto_layout_order_evidence has cognitive complexity 45 (threshold 15). Drivers by points: if/else 8 (34 pts), loops 2 (5 pts), match/switch 2 (5 pts), boolean chains 1 (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.
op_pen_loader::initial_text_snapshot::visit (cognitive 31) crates/op-pen-loader/src/initial_text_snapshot.rs:43— op_pen_loader::initial_text_snapshot::visit has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (29 pts), boolean chains 1, loops 1 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
op_pen_loader::full_content_snapshot::expand (cognitive 27) crates/op-pen-loader/src/full_content_snapshot.rs:89— op_pen_loader::full_content_snapshot::expand has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 5, loops 1, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
op_pen_loader::layout_repair::repair_inferred_horizontal_container (cognitive 27) crates/op-pen-loader/src/layout_repair.rs:191— op_pen_loader::layout_repair::repair_inferred_horizontal_container has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (17 pts), match/switch 3 (6 pts), boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_pen_loader::style_payload::shader_payload (cognitive 27) crates/op-pen-loader/src/style_payload.rs:300— op_pen_loader::style_payload::shader_payload has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (20 pts), match/switch 2 (4 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_pen_loader::table_default_snapshot::evaluate (cognitive 25) crates/op-pen-loader/src/table_default_snapshot.rs:16— op_pen_loader::table_default_snapshot::evaluate has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
op_pen_loader::editor_scene::full_scene (cognitive 24) crates/op-pen-loader/src/editor_scene.rs:29— op_pen_loader::editor_scene::full_scene has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 2 (6 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.
op_pen_loader::style_payload::fill_fallback_color (cognitive 20) crates/op-pen-loader/src/style_payload.rs:409— op_pen_loader::style_payload::fill_fallback_color has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 2 (3 pts) (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
op_image_enrich::net::providers::catalog::fetch_openverse_json (cognitive 37) crates/op-image-enrich/src/net/providers/catalog.rs:104— op_image_enrich::net::providers::catalog::fetch_openverse_json has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (32 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 19). 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.
op_image_enrich::net::fetch_aspect::search_original_aspects (cognitive 34) crates/op-image-enrich/src/net/fetch_aspect.rs:104— op_image_enrich::net::fetch_aspect::search_original_aspects has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (29 pts), match/switch 1 (3 pts), boolean chains 1, loops 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.
op_image_enrich::net::providers::relevance_intent::intent_rewrite (cognitive 30) crates/op-image-enrich/src/net/providers/relevance_intent.rs:121— op_image_enrich::net::providers::relevance_intent::intent_rewrite has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 5, loops 2, match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_image_enrich::net::fetch::fetch_first_image_url_with_judge (cognitive 26) crates/op-image-enrich/src/net/fetch.rs:69— op_image_enrich::net::fetch::fetch_first_image_url_with_judge has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 1, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_image_enrich::targets::page_context::heading_description::walk (cognitive 26) crates/op-image-enrich/src/targets/page_context.rs:106— op_image_enrich::targets::page_context::heading_description::walk has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (5 pts), match/switch 2 (5 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.
op_image_enrich::net::providers::catalog::fetch_openverse_token_with_source (cognitive 24) crates/op-image-enrich/src/net/providers/catalog.rs:475— op_image_enrich::net::providers::catalog::fetch_openverse_token_with_source has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (20 pts), match/switch 1 (2 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.
op_image_enrich::apply::apply_result (cognitive 18) crates/op-image-enrich/src/apply.rs:49— op_image_enrich::apply::apply_result has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), match/switch 3 (5 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
op_image_enrich::net::judge::select_with_judge_before (cognitive 18) crates/op-image-enrich/src/net/judge.rs:157— op_image_enrich::net::judge::select_with_judge_before has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 2 (5 pts), loops 2 (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.
op_image_enrich::net::original_delivery::upgrade_selected_with (cognitive 17) crates/op-image-enrich/src/net/original_delivery.rs:28— op_image_enrich::net::original_delivery::upgrade_selected_with has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (16 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.
D4 · Code Duplication· Edited copy of a member (26 corresponding lines) · ×9
Edited copy of a member (26 corresponding lines) crates/op-image-enrich/src/net/downscale.rs:85— crates/op-image-enrich/src/net/downscale.rs:85-110 | crates/op-image-enrich/src/net/downscale.rs:115-143 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) crates/op-editor-core/src/ref_resolve.rs:341— crates/op-editor-core/src/ref_resolve.rs:341-370 | crates/op-editor-core/src/ref_resolve.rs:448-473 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) crates/op-host-desktop/src/figma_import_session/publish.rs:64— crates/op-host-desktop/src/figma_import_session/publish.rs:64-91 | crates/op-host-desktop/src/legacy_op_upgrade.rs:163-188 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) crates/op-collab-relay-protocol/src/invite.rs:65— crates/op-collab-relay-protocol/src/invite.rs:65-93 | crates/op-collab-relay-protocol/src/locator.rs:245-270 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) crates/op-engine-ffi/src/editor_chat_turn.rs:330— crates/op-engine-ffi/src/editor_chat_turn.rs:330-355 | crates/op-host-services/src/chat_builtin_http_wire.rs:92-119 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) crates/op-editor-ui/src/widgets/property_panel_typography.rs:141— crates/op-editor-ui/src/widgets/property_panel_typography.rs:141-169 | crates/op-figma/src/clipboard.rs:471-496 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) crates/op-editor-core/src/editor_ui_state/workspace.rs:284— crates/op-editor-core/src/editor_ui_state/workspace.rs:284-314 | crates/op-editor-core/src/editor_ui_state/workspace.rs:488-513 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) crates/op-editor-ui/src/widgets/collab_panel_interaction.rs:366— crates/op-editor-ui/src/widgets/collab_panel_interaction.rs:366-391 | crates/op-editor-ui/src/widgets/collab_panel_interaction.rs:398-423 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) crates/op-editor-ui/src/widgets/property_panel_typography_paint.rs:38— crates/op-editor-ui/src/widgets/property_panel_typography_paint.rs:38-63 | crates/op-editor-ui/src/widgets/property_panel_typography_paint.rs:122-148 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (28 corresponding lines) · ×9
Edited copy of a member (28 corresponding lines) crates/op-host-native/src/backend/skia/path.rs:722— crates/op-host-native/src/backend/skia/path.rs:722-751 | crates/op-host-native/src/boolean_ops.rs:180-207 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) crates/op-pen-loader/src/style_payload.rs:541— crates/op-pen-loader/src/style_payload.rs:541-569 | crates/op-preview-core/src/session_paint.rs:604-631 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) crates/op-editor-core/src/variables_resolve/replace.rs:146— crates/op-editor-core/src/variables_resolve/replace.rs:146-173 | crates/op-orchestrator/src/variable_binding.rs:247-281 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) crates/op-html/src/css/cascade.rs:625— crates/op-html/src/css/cascade.rs:625-652 | crates/op-html/src/css/declarations_deferred.rs:86-113 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) crates/op-design-lint/src/detectors/spacing.rs:167— crates/op-design-lint/src/detectors/spacing.rs:167-199 | crates/op-orchestrator/src/mobile_content_rail_detect.rs:169-196 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) crates/op-pen-loader/src/adapter/entry.rs:22— crates/op-pen-loader/src/adapter/entry.rs:22-54 | crates/op-pen-loader/src/adapter/entry.rs:63-90 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) crates/op-host-services/src/import_html_url.rs:237— crates/op-host-services/src/import_html_url.rs:237-264 | crates/op-host-services/src/web_credentials.rs:148-176 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) crates/op-html/src/css/cascade_parser.rs:390— crates/op-html/src/css/cascade_parser.rs:390-417 | crates/op-html/src/css/cascade_shared.rs:42-71 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) crates/op-host-native/src/widget_host/workspace.rs:436— crates/op-host-native/src/widget_host/workspace.rs:436-471 | crates/op-host-web/src/widget_host/studio_workspace.rs:349-376 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 6+ corresponding lines) · ×9
Edited copies of one member (3 members, 6+ corresponding lines) crates/op-orchestrator/src/subtask_completeness_list_rows.rs:40— crates/op-orchestrator/src/subtask_completeness_list_rows.rs:40-45 | crates/op-orchestrator/src/subtask_completeness_media_items.rs:45-50 | crates/op-orchestrator/src/subtask_completeness_reviews.rs:48-53 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) crates/op-editor-host-core/src/settings_io.rs:535— crates/op-editor-host-core/src/settings_io.rs:535-542 | crates/op-editor-host-core/src/settings_payload.rs:232-239 | crates/op-host-services/src/web_credentials.rs:563-568 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) crates/op-editor-ui/src/widgets/agent_settings_account.rs:41— crates/op-editor-ui/src/widgets/agent_settings_account.rs:41-46 | crates/op-editor-ui/src/widgets/html_import_diagnostics_panel.rs:135-140 | crates/op-editor-ui/src/widgets/variables_panel.rs:379-387 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) crates/op-auth-bridge/prebuilt_provenance.rs:454— crates/op-auth-bridge/prebuilt_provenance.rs:454-459 | crates/op-chrome-extension-core/src/design_md_job.rs:154-159 | crates/op-chrome-extension-core/src/design_md_validate.rs:565-571 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) crates/op-pen-loader/src/editor_meta.rs:128— crates/op-pen-loader/src/editor_meta.rs:128-135 | crates/op-pen-loader/src/editor_meta_family.rs:18-23 | crates/op-pen-loader/src/editor_meta_import.rs:30-35 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) crates/op-editor-ui/src/widgets/agent_settings_acp_presets.rs:220— crates/op-editor-ui/src/widgets/agent_settings_acp_presets.rs:220-225 | crates/op-editor-ui/src/widgets/agent_settings_builtin_layout.rs:180-185 | crates/op-editor-ui/src/widgets/variables_preset_menu.rs:362-367 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) crates/op-editor-ui/src/widgets/property_panel_code.rs:232— crates/op-editor-ui/src/widgets/property_panel_code.rs:232-237 | crates/op-editor-ui/src/widgets/property_panel_code_complete.rs:411-416 | crates/op-editor-ui/src/widgets/property_panel_instance.rs:61-66 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) crates/op-host-web/src/dom_io/browser_files.rs:18— crates/op-host-web/src/dom_io/browser_files.rs:18-23 | crates/op-host-web/src/dom_io/html_directory_session.rs:377-385 | crates/op-host-web/src/dom_io/html_zip_session.rs:395-400 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) crates/op-orchestrator/src/geometry_interaction_backfill.rs:334— crates/op-orchestrator/src/geometry_interaction_backfill.rs:334-339 | crates/op-orchestrator/src/role_post_pass/micro_surface_radius.rs:7-12 | crates/op-orchestrator/src/sidebar_archetype.rs:456-461 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (17 lines × 2) crates/op-collab-host/src/runtime/network/connection.rs:83— crates/op-collab-host/src/runtime/network/connection.rs:83-99 | crates/op-collab-host/src/runtime/network/connection.rs:266-282 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-collab-host/src/runtime/network/connection.rs:83` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/op-collab-host/src/runtime/network/connection.rs:287` calls `Ok`, `OwnerIdentityDecision` and `crates/op-collab-host/src/runtime/network/connection.rs:100` 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 × 2) crates/op-collab-relay-server/src/connection_reauth.rs:262— crates/op-collab-relay-server/src/connection_reauth.rs:262-278 | crates/op-collab-relay-server/src/connection_reauth.rs:306-322 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-collab-relay-server/src/connection_reauth.rs:262` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) crates/op-editor-core/src/svg_import/scale.rs:51— crates/op-editor-core/src/svg_import/scale.rs:51-67 | crates/op-figma/src/vector_decoder.rs:105-121 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/svg_import/scale.rs:51` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) crates/op-figma/src/converters.rs:167— crates/op-figma/src/converters.rs:167-183 | crates/op-figma/src/converters.rs:203-219 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-figma/src/converters.rs:167` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) crates/op-host-services/src/mcp_serve/design_agent_run_tool.rs:148— crates/op-host-services/src/mcp_serve/design_agent_run_tool.rs:148-164 | crates/op-smoke/src/loop_mode.rs:235-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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (17 lines × 2) crates/op-host-web/src/web_settings.rs:550— crates/op-host-web/src/web_settings.rs:550-566 | crates/op-i18n/src/locale.rs:47-63 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-web/src/web_settings.rs:550` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) crates/op-html/src/lib.rs:416— crates/op-html/src/lib.rs:416-432 | crates/op-html/src/mapper_pseudo.rs:91-107 — 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) crates/op-mcp/src/batch_design_result.rs:222— crates/op-mcp/src/batch_design_result.rs:222-238 | crates/op-mcp/src/design_refine_result.rs:61-77 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (17 lines × 2) crates/op-cli/src/export_cli.rs:102— crates/op-cli/src/export_cli.rs:102-118 | crates/op-cli/src/export_cli.rs:174-190 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-cli/src/export_cli.rs:102` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
DesktopApp::handle_key_pressed (cyclomatic 143) crates/op-host-desktop/src/keyboard_input.rs:15— DesktopApp::handle_key_pressed has cyclomatic complexity 143 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
DesktopApp::on_redraw_requested (cyclomatic 85) crates/op-host-desktop/src/app_handler/redraw.rs:35— DesktopApp::on_redraw_requested has cyclomatic complexity 85 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DesktopApp::drain_git_action (cyclomatic 64) crates/op-host-desktop/src/git_host.rs:166— DesktopApp::drain_git_action has cyclomatic complexity 64 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DesktopApp::on_left_press (cyclomatic 39) crates/op-host-desktop/src/app_handler/pointer_events.rs:109— DesktopApp::on_left_press 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.
DesktopApp::handle_menu_action (cyclomatic 39) crates/op-host-desktop/src/menu_action.rs:68— DesktopApp::handle_menu_action has cyclomatic complexity 39 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
DesktopApp::window_event (cyclomatic 35) crates/op-host-desktop/src/app_handler.rs:435— DesktopApp::window_event has cyclomatic complexity 35 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
DesktopApp::resumed (cyclomatic 32) crates/op-host-desktop/src/app_handler.rs:96— DesktopApp::resumed 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.
DesktopApp::on_cursor_moved (cyclomatic 22) crates/op-host-desktop/src/app_handler/pointer_events.rs:30— DesktopApp::on_cursor_moved 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.
op_host_web::canvaskit::mount_keyboard::register_keyboard_listeners (cyclomatic 94) crates/op-host-web/src/canvaskit/mount_keyboard.rs:12— op_host_web::canvaskit::mount_keyboard::register_keyboard_listeners has cyclomatic complexity 94 (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.
op_host_web::canvaskit::mount::mount_ck (cyclomatic 47) crates/op-host-web/src/canvaskit/mount.rs:14— op_host_web::canvaskit::mount::mount_ck has cyclomatic complexity 47 (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.
op_host_web::dom_io::handle_paste_event (cyclomatic 22) crates/op-host-web/src/dom_io.rs:553— op_host_web::dom_io::handle_paste_event 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.
op_host_web::web_settings_validation::validate_credential_semantics (cyclomatic 20) crates/op-host-web/src/web_settings_validation.rs:487— op_host_web::web_settings_validation::validate_credential_semantics has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: SettingsValidationError::fmt (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
op_host_web::live_sync_glue::push_document_if_changed (cyclomatic 17) crates/op-host-web/src/live_sync_glue.rs:470— op_host_web::live_sync_glue::push_document_if_changed 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.
op_host_web::web_auth_sync::apply_login_status (cyclomatic 17) crates/op-host-web/src/web_auth_sync.rs:348— op_host_web::web_auth_sync::apply_login_status 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.
op_host_web::web_settings::apply_payload (cyclomatic 17) crates/op-host-web/src/web_settings.rs:414— op_host_web::web_settings::apply_payload 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.
op_host_web::widget_host::group_ops::trace_grid_contours (cyclomatic 16) crates/op-host-web/src/widget_host/group_ops.rs:172— op_host_web::widget_host::group_ops::trace_grid_contours 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.
DesktopApp::handle_key_pressed (cognitive 100) crates/op-host-desktop/src/keyboard_input.rs:15— DesktopApp::handle_key_pressed has cognitive complexity 100 (threshold 15). Drivers by points: if/else 18 (42 pts), boolean chains 37, match/switch 6 (13 pts), loops 2 (8 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DesktopApp::on_redraw_requested (cognitive 98) crates/op-host-desktop/src/app_handler/redraw.rs:35— DesktopApp::on_redraw_requested has cognitive complexity 98 (threshold 15). Drivers by points: if/else 68 (84 pts), boolean chains 9, loops 2 (3 pts), match/switch 2 (nesting depth added 17). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
DesktopApp::drain_git_action (cognitive 71) crates/op-host-desktop/src/git_host.rs:166— DesktopApp::drain_git_action has cognitive complexity 71 (threshold 15). Drivers by points: if/else 20 (45 pts), match/switch 6 (21 pts), boolean chains 5 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DesktopApp::on_left_press (cognitive 70) crates/op-host-desktop/src/app_handler/pointer_events.rs:109— DesktopApp::on_left_press has cognitive complexity 70 (threshold 15). Drivers by points: if/else 32 (61 pts), match/switch 2 (8 pts), boolean chains 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.
DesktopApp::resumed (cognitive 47) crates/op-host-desktop/src/app_handler.rs:96— DesktopApp::resumed has cognitive complexity 47 (threshold 15). Drivers by points: if/else 25 (41 pts), boolean chains 3, match/switch 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DesktopApp::handle_menu_action (cognitive 28) crates/op-host-desktop/src/menu_action.rs:68— DesktopApp::handle_menu_action has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (21 pts), match/switch 2 (4 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.
DesktopApp::on_cursor_moved (cognitive 25) crates/op-host-desktop/src/app_handler/pointer_events.rs:30— DesktopApp::on_cursor_moved has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 1 (4 pts), boolean chains 3 (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.
DesktopApp::reconcile_mcp_cli_integrations (cognitive 16) crates/op-host-desktop/src/mcp_runtime.rs:248— DesktopApp::reconcile_mcp_cli_integrations has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 4, match/switch 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.
GitPanel::hit_test (cognitive 88) crates/op-editor-ui/src/widgets/git_panel_hit.rs:14— GitPanel::hit_test has cognitive complexity 88 (threshold 15). Drivers by points: if/else 45 (73 pts), loops 5 (7 pts), match/switch 2 (5 pts), boolean chains 3 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GitPanel::paint (cognitive 46) crates/op-editor-ui/src/widgets/git_panel/paint.rs:12— GitPanel::paint has cognitive complexity 46 (threshold 15). Drivers by points: if/else 23 (36 pts), loops 4 (8 pts), boolean chains 1, match/switch 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GitPanel::branch_picker_hit (cognitive 26) crates/op-editor-ui/src/widgets/git_panel_menus/branch_picker.rs:311— GitPanel::branch_picker_hit has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GitPanel::ready_hit (cognitive 24) crates/op-editor-ui/src/widgets/git_panel_ready.rs:686— GitPanel::ready_hit has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 4, 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.
GitPanel::paint_branch_picker (cognitive 23) crates/op-editor-ui/src/widgets/git_panel_menus/branch_picker.rs:111— GitPanel::paint_branch_picker has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 2, loops 1, match/switch 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.
GitPanel::paint_tracked_picker (cognitive 22) crates/op-editor-ui/src/widgets/git_panel_tracked_picker.rs:157— GitPanel::paint_tracked_picker has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (20 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.
GitPanel::paint_ready (cognitive 18) crates/op-editor-ui/src/widgets/git_panel_ready.rs:300— GitPanel::paint_ready has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (16 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.
GitPanel::paint_empty_card (cognitive 16) crates/op-editor-ui/src/widgets/git_panel_empty.rs:196— GitPanel::paint_empty_card has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, boolean chains 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.
op_codegen::codegen_tailwind_shadcn::emit (cognitive 29) crates/op-codegen/src/codegen_tailwind_shadcn.rs:230— op_codegen::codegen_tailwind_shadcn::emit has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 10, loops 1 (2 pts), match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
op_codegen::codegen_html::emit_node_html (cognitive 27) crates/op-codegen/src/codegen_html.rs:40— op_codegen::codegen_html::emit_node_html has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (20 pts), loops 2 (6 pts), boolean chains 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.
op_codegen::ai::pipeline_preflight::plan_structure_issue (cognitive 24) crates/op-codegen/src/ai/pipeline_preflight.rs:225— op_codegen::ai::pipeline_preflight::plan_structure_issue has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 5 (7 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.
op_codegen::codegen_targets::emit_node_jsx (cognitive 22) crates/op-codegen/src/codegen_targets.rs:294— op_codegen::codegen_targets::emit_node_jsx has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (15 pts), loops 2 (6 pts), boolean chains 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.
op_codegen::codegen_tailwind_widgets::emit (cognitive 19) crates/op-codegen/src/codegen_tailwind_widgets.rs:52— op_codegen::codegen_tailwind_widgets::emit has cognitive complexity 19 (threshold 15). Drivers by points: loops 5 (10 pts), match/switch 3 (6 pts), if/else 2 (3 pts) (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
op_codegen::ai::parse::infer_imports_from_code (cognitive 16) crates/op-codegen/src/ai/parse.rs:149— op_codegen::ai::parse::infer_imports_from_code has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (14 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
op_codegen::codegen_tailwind_style::padding (cognitive 16) crates/op-codegen/src/codegen_tailwind_style.rs:532— op_codegen::codegen_tailwind_style::padding has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, loops 1, match/switch 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.
op_codegen::codegen_tailwind_style::border (cognitive 16) crates/op-codegen/src/codegen_tailwind_style.rs:599— op_codegen::codegen_tailwind_style::border has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 1 (2 pts), match/switch 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.
D4 · Code Duplication· Edited copy of a member (24 corresponding lines) · ×8
Edited copy of a member (24 corresponding lines) crates/op-editor-core/src/history_snapshot.rs:354— crates/op-editor-core/src/history_snapshot.rs:354-380 | crates/op-editor-core/src/history_snapshot.rs:383-406 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) crates/op-host-native/src/widget_host/slides_panel.rs:302— crates/op-host-native/src/widget_host/slides_panel.rs:302-326 | crates/op-host-web/src/widget_host/slides_panel.rs:184-207 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) crates/op-host-native/src/widget_host/workspace.rs:547— crates/op-host-native/src/widget_host/workspace.rs:547-573 | crates/op-host-web/src/widget_host/studio_workspace.rs:447-470 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) crates/op-image-enrich/src/targets.rs:450— crates/op-image-enrich/src/targets.rs:450-483 | crates/op-image-enrich/src/targets.rs:612-635 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) templates/step0/_generators/tpl_deck43_openpencil_intro.py:151— templates/step0/_generators/tpl_deck43_openpencil_intro.py:151-174 | templates/step0/_generators/tpl_deck_openpencil_intro.py:146-175 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) crates/op-host-desktop/src/figma_import_session/publish.rs:124— crates/op-host-desktop/src/figma_import_session/publish.rs:124-147 | crates/op-host-desktop/src/legacy_op_upgrade.rs:136-161 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) crates/op-mcp/src/node_attr_tools.rs:378— crates/op-mcp/src/node_attr_tools.rs:378-404 | crates/op-mcp/src/page_tools.rs:168-191 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) crates/op-orchestrator/src/plan_coverage.rs:286— crates/op-orchestrator/src/plan_coverage.rs:286-315 | crates/op-editor-core/src/icon_path_normalize.rs:462-485 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 11+ corresponding lines) · ×8
Edited copies of one member (3 members, 11+ corresponding lines) crates/op-host-native/src/backend/skia.rs:32— crates/op-host-native/src/backend/skia.rs:32-46 | crates/op-host-native/src/backend/skia/image.rs:24-38 | crates/op-host-web/src/widget_host/studio_workspace_paint.rs:127-137 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) crates/op-mcp/src/read_tools_extra.rs:166— crates/op-mcp/src/read_tools_extra.rs:166-178 | crates/op-mcp/src/read_tools_extra.rs:207-217 | crates/op-mcp/src/tools.rs:573-583 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) crates/op-html/src/css/declarations.rs:312— crates/op-html/src/css/declarations.rs:312-332 | crates/op-html/src/css/declarations.rs:626-636 | crates/op-html/src/css/declarations.rs:638-648 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) crates/op-chrome-extension-core/src/design_md_palette.rs:256— crates/op-chrome-extension-core/src/design_md_palette.rs:256-269 | crates/op-host-services/src/design_md_evidence_roles.rs:140-153 | crates/op-orchestrator/src/hero_bleed.rs:587-597 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) crates/op-brand/src/color.rs:59— crates/op-brand/src/color.rs:59-69 | crates/op-design-lint/src/color.rs:31-41 | crates/op-editor-ui/src/widgets/canvas_viewport_widget_tests/label_foreground.rs:12-22 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) crates/op-engine-ffi/src/editor_chat_lifetime.rs:78— crates/op-engine-ffi/src/editor_chat_lifetime.rs:78-91 | crates/op-engine-ffi/src/editor_chat_workspace.rs:107-117 | crates/op-host-desktop/src/chat_session_launch.rs:100-110 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) crates/op-collab-relay-server/src/observe.rs:175— crates/op-collab-relay-server/src/observe.rs:175-185 | crates/op-collab-relay-server/src/observe.rs:187-198 | crates/op-collab-relay-server/src/observe.rs:200-211 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) crates/op-engine-ffi/src/editor_builtin_provider.rs:417— crates/op-engine-ffi/src/editor_builtin_provider.rs:417-427 | crates/op-host-desktop/src/chat_acp.rs:283-293 | crates/op-host-services/src/chat_attachment.rs:226-236 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 4+ corresponding lines) · ×8
Edited copies of one member (3 members, 4+ corresponding lines) templates/step0/_generators/tpl_app_budget_ledger.py:95— templates/step0/_generators/tpl_app_budget_ledger.py:95-98 | templates/step0/_generators/tpl_app_coffee_order.py:88-91 | templates/step0/_generators/tpl_app_habit_fitness.py:84-87 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) crates/op-figma/src/vector_decoder.rs:176— crates/op-figma/src/vector_decoder.rs:176-179 | crates/op-host-services/src/export_pptx/media.rs:115-118 | crates/op-host-web/src/vf_normalize.rs:119-122 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) templates/step0/_generators/tpl_deck_dossier.py:132— templates/step0/_generators/tpl_deck_dossier.py:132-135 | templates/step0/_generators/tpl_deck_ledger.py:123-126 | templates/step0/_generators/tpl_slides.py:111-114 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) templates/step0/_generators/tpl_deck_banxin.py:217— templates/step0/_generators/tpl_deck_banxin.py:217-222 | templates/step0/_generators/tpl_deck_gridpaper.py:168-171 | templates/step0/_generators/tpl_event_deck.py:123-131 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) crates/op-html/src/css/cascade_conditions.rs:521— crates/op-html/src/css/cascade_conditions.rs:521-524 | crates/op-html/src/css/declaration_syntax.rs:327-330 | crates/op-html/src/mapper_grid.rs:513-516 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) crates/op-ai-skills/src/style_guide/card.rs:69— crates/op-ai-skills/src/style_guide/card.rs:69-72 | crates/op-ai-skills/src/style_guide/summary.rs:40-43 | crates/op-editor-core/src/scene_template_palette.rs:79-82 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) crates/op-orchestrator/src/map_placeholder.rs:277— crates/op-orchestrator/src/map_placeholder.rs:277-280 | crates/op-orchestrator/src/subtask_completeness_media_items.rs:52-55 | crates/op-orchestrator/src/subtask_completeness_semantic_items.rs:53-56 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) crates/op-editor-core/src/collab_wire.rs:293— crates/op-editor-core/src/collab_wire.rs:293-296 | crates/op-editor-core/src/web_sync.rs:335-338 | crates/op-host-web/src/studio_web.rs:74-77 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (11 lines × 3) crates/op-collab-smoke/src/fault_guest.rs:58— crates/op-collab-smoke/src/fault_guest.rs:58-68 | crates/op-collab-smoke/src/fault_guest.rs:95-105 | crates/op-collab-smoke/src/fault_guest.rs:133-143 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) crates/op-collab-smoke/src/fault_owner.rs:298— crates/op-collab-smoke/src/fault_owner.rs:298-308 | crates/op-collab-smoke/src/fault_owner.rs:414-424 | crates/op-collab-smoke/src/fault_owner.rs:464-474 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) crates/op-host-desktop/src/design_md_host.rs:110— crates/op-host-desktop/src/design_md_host.rs:110-120 | crates/op-host-services/src/design_md_llm.rs:31-41 | crates/op-host-web/src/web_design_md.rs:288-298 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (11 lines × 3) crates/op-host-native/src/widget_host/variables_panel_row_press.rs:34— crates/op-host-native/src/widget_host/variables_panel_row_press.rs:34-44 | crates/op-host-native/src/widget_host/variables_panel_row_press.rs:103-113 | crates/op-host-native/src/widget_host/variables_panel_row_press.rs:338-348 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 3) crates/op-host-web/src/live_sync.rs:133— crates/op-host-web/src/live_sync.rs:133-143 | crates/op-host-web/src/live_sync.rs:194-204 | crates/op-host-web/src/web_image_panel.rs:389-399 — 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, `crates/op-host-web/src/live_sync.rs:193` calls `set_request_header` and `crates/op-host-web/src/live_sync.rs:132` 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) crates/op-html/src/layout_heuristics.rs:27— crates/op-html/src/layout_heuristics.rs:27-37 | crates/op-html/src/mapper_text_scope.rs:103-113 | crates/op-html/src/text.rs:281-291 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-html/src/layout_heuristics.rs:27` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) crates/op-editor-core/src/color_picker_snapshot.rs:28— crates/op-editor-core/src/color_picker_snapshot.rs:28-38 | crates/op-host-native/src/widget_host/variables_panel_row_press.rs:381-391 | crates/op-host-web/src/widget_host/variables_panel_rows.rs:323-333 — before extracting anything, compare `crates/op-host-native/src/widget_host/variables_panel_row_press.rs` and `crates/op-host-web/src/widget_host/variables_panel_rows.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) crates/op-orchestrator/src/cleanup.rs:126— crates/op-orchestrator/src/cleanup.rs:126-136 | crates/op-orchestrator/src/cleanup.rs:186-196 | crates/op-orchestrator/src/mobile_content_rail.rs:24-34 — 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.
Low cohesion: NativeBackend (LCOM4 28) crates/op-host-native/src/backend/skia.rs:91— NativeBackend's methods fall into 28 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 28 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: AgentSettings (LCOM4 6) crates/op-editor-core/src/agent_settings.rs:254— AgentSettings's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ChatSession (LCOM4 5) crates/op-editor-host-core/src/chat.rs:229— ChatSession's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: RealCollabTicketProvider (LCOM4 4) crates/op-auth-bridge/src/real_collab_ticket.rs:53— RealCollabTicketProvider'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: ChatState (LCOM4 4) crates/op-editor-core/src/chat.rs:189— ChatState'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: EditorState (LCOM4 4) crates/op-editor-core/src/state.rs:56— EditorState'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: VariablesPanel (LCOM4 4) crates/op-editor-ui/src/widgets/variables_panel.rs:127— VariablesPanel'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: ConfiguredBuiltinProvider (LCOM4 4) crates/op-host-services/src/chat_builtin_http.rs:54— ConfiguredBuiltinProvider'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.
EditorState::apply_with_allocator (cyclomatic 177) crates/op-editor-core/src/command_apply.rs:55— EditorState::apply_with_allocator has cyclomatic complexity 177 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EditorState::cmd_set_node_layout_prop (cyclomatic 69) crates/op-editor-core/src/command_layout_prop.rs:130— EditorState::cmd_set_node_layout_prop has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EditorState::commit_property_edit_inner (cyclomatic 69) crates/op-editor-core/src/property_edit_mutators.rs:69— EditorState::commit_property_edit_inner has cyclomatic complexity 69 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
EditorState::active_text_input (cyclomatic 34) crates/op-editor-core/src/text_input_focus.rs:12— EditorState::active_text_input 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.
EditorState::active_text_input_mut (cyclomatic 30) crates/op-editor-core/src/text_input_focus.rs:119— EditorState::active_text_input_mut has cyclomatic complexity 30 (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.
EditorState::cmd_set_ellipse_arc (cyclomatic 17) crates/op-editor-core/src/command_node_attrs/state_ops.rs:337— EditorState::cmd_set_ellipse_arc 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.
EditorState::move_node_to_drop_target (cyclomatic 17) crates/op-editor-core/src/drag_mutators.rs:298— EditorState::move_node_to_drop_target 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.
op_pen_loader::adapter::node_payload::node_to_payload_with_text_context (cyclomatic 27) crates/op-pen-loader/src/adapter/node_payload.rs:11— op_pen_loader::adapter::node_payload::node_to_payload_with_text_context has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_pen_loader::payload::legacy_normalize::normalize_node_value (cyclomatic 24) crates/op-pen-loader/src/payload/legacy_normalize.rs:179— op_pen_loader::payload::legacy_normalize::normalize_node_value 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.
op_pen_loader::full_content_snapshot::expand (cyclomatic 23) crates/op-pen-loader/src/full_content_snapshot.rs:89— op_pen_loader::full_content_snapshot::expand 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.
op_pen_loader::layout_repair::repair_inferred_horizontal_container (cyclomatic 21) crates/op-pen-loader/src/layout_repair.rs:191— op_pen_loader::layout_repair::repair_inferred_horizontal_container 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.
op_pen_loader::layout_repair::repair_vertical_container (cyclomatic 16) crates/op-pen-loader/src/layout_repair.rs:77— op_pen_loader::layout_repair::repair_vertical_container has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: op_pen_loader::layout_repair::base (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
op_pen_loader::layout_repair::repair_split_metric_column_content (cyclomatic 16) crates/op-pen-loader/src/layout_repair.rs:311— op_pen_loader::layout_repair::repair_split_metric_column_content has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: op_pen_loader::layout_repair::base (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
op_pen_loader::payload::legacy_normalize::auto_layout_order_evidence (cyclomatic 16) crates/op-pen-loader/src/payload/legacy_normalize.rs:76— op_pen_loader::payload::legacy_normalize::auto_layout_order_evidence 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.
op_brand::css_signals::record_block (cognitive 35) crates/op-brand/src/css_signals.rs:160— op_brand::css_signals::record_block has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (25 pts), match/switch 2 (6 pts), loops 2 (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.
op_brand::css_scan::walk (cognitive 31) crates/op-brand/src/css_scan.rs:48— op_brand::css_scan::walk has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (18 pts), match/switch 2 (6 pts), boolean chains 4, 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.
op_brand::css_signals::analyze_site (cognitive 31) crates/op-brand/src/css_signals.rs:33— op_brand::css_signals::analyze_site has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 7 (11 pts), match/switch 2 (6 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_brand::image_palette::palette_from_image (cognitive 17) crates/op-brand/src/image_palette.rs:41— op_brand::image_palette::palette_from_image has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 3 (5 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_brand::image_palette::signals_from_swatches (cognitive 17) crates/op-brand/src/image_palette.rs:135— op_brand::image_palette::signals_from_swatches has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, loops 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.
op_brand::css_tokens::mode_from_evidence (cognitive 16) crates/op-brand/src/css_tokens.rs:100— op_brand::css_tokens::mode_from_evidence has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 5, loops 2 (3 pts) (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.
op_brand::tokens::resolve_mode (cognitive 16) crates/op-brand/src/tokens.rs:94— op_brand::tokens::resolve_mode has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D4 · Code Duplication· Edited copy of a member (32 corresponding lines) · ×7
Edited copy of a member (32 corresponding lines) crates/op-host-native/src/widget_host/workspace.rs:480— crates/op-host-native/src/widget_host/workspace.rs:480-511 | crates/op-host-web/src/widget_host/studio_workspace.rs:385-417 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) crates/op-auth-bridge/prebuilt_provenance.rs:227— crates/op-auth-bridge/prebuilt_provenance.rs:227-258 | crates/op-auth-bridge/prebuilt_provenance.rs:263-306 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) crates/op-orchestrator/src/geometry_buried_overlay.rs:573— crates/op-orchestrator/src/geometry_buried_overlay.rs:573-606 | crates/op-orchestrator/src/geometry_buried_single_media.rs:45-76 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) crates/op-editor-core/src/svg_import/lexer.rs:143— crates/op-editor-core/src/svg_import/lexer.rs:143-179 | crates/op-figma/src/vector_decoder.rs:251-282 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/MainActivity.kt:446— packaging/android/app/src/main/kotlin/tech/zseven/openpencil/MainActivity.kt:446-483 | packaging/android/app/src/main/kotlin/tech/zseven/openpencil/MainActivity.kt:503-534 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) crates/op-editor-ui/src/widgets/agent_settings_builtin.rs:390— crates/op-editor-ui/src/widgets/agent_settings_builtin.rs:390-421 | crates/op-editor-ui/src/widgets/agent_settings_builtin.rs:431-466 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) templates/step0/_generators/tpl_tutorial_recipe.py:157— templates/step0/_generators/tpl_tutorial_recipe.py:157-188 | templates/step0/_generators/tpl_tutorial_workout.py:230-270 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 7+ corresponding lines) · ×7
Edited copies of one member (3 members, 7+ corresponding lines) templates/step0/_generators/tpl_tutorial_photo.py:141— templates/step0/_generators/tpl_tutorial_photo.py:141-147 | templates/step0/_generators/tpl_tutorial_skincare.py:130-136 | templates/step0/_generators/tpl_tutorial_storage.py:137-143 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) packaging/ios/Sources/OpEngineHost+Pointer.swift:23— packaging/ios/Sources/OpEngineHost+Pointer.swift:23-32 | packaging/ios/Sources/OpEngineHost+Pointer.swift:34-40 | packaging/ios/Sources/OpEngineHost+Pointer.swift:42-49 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) crates/op-orchestrator/src/absolute_child_clamp.rs:47— crates/op-orchestrator/src/absolute_child_clamp.rs:47-53 | crates/op-orchestrator/src/geometry_value_readers.rs:75-81 | crates/op-orchestrator/src/none_stack_inset.rs:142-149 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) crates/op-host-desktop/src/persistence_export_html.rs:48— crates/op-host-desktop/src/persistence_export_html.rs:48-54 | crates/op-host-desktop/src/persistence_export_pptx.rs:48-54 | crates/op-host-desktop/src/persistence_share.rs:54-60 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) crates/op-orchestrator/src/category_grid_reflow.rs:110— crates/op-orchestrator/src/category_grid_reflow.rs:110-117 | crates/op-orchestrator/src/cleanup_fixed_board_backdrops.rs:65-71 | crates/op-orchestrator/src/hero_bleed.rs:507-517 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) crates/op-host-desktop/src/git_jobs.rs:80— crates/op-host-desktop/src/git_jobs.rs:80-86 | crates/op-host-desktop/src/iconify_host.rs:53-60 | crates/op-host-desktop/src/update_check.rs:83-89 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) crates/op-collab-policy-file/src/pinned_locator_keys.rs:125— crates/op-collab-policy-file/src/pinned_locator_keys.rs:125-131 | crates/op-collab-relay-client/src/auth.rs:146-152 | crates/op-collab-relay-server/src/x25519_boundary.rs:90-96 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 13+ corresponding lines) · ×7
Edited copies of one member (3 members, 13+ corresponding lines) templates/step0/_generators/tpl_infographic_challenge.py:214— templates/step0/_generators/tpl_infographic_challenge.py:214-228 | templates/step0/_generators/tpl_infographic_faq.py:172-184 | templates/step0/_generators/tpl_infographic_ranking.py:179-193 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) templates/step0/_generators/tpl_compare_spec_table.py:189— templates/step0/_generators/tpl_compare_spec_table.py:189-201 | templates/step0/_generators/tpl_infographic_concept.py:206-226 | templates/step0/_generators/tpl_infographic_list.py:183-213 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) templates/step0/_generators/tpl_compare_pricing_tiers.py:192— templates/step0/_generators/tpl_compare_pricing_tiers.py:192-213 | templates/step0/_generators/tpl_compare_scenario_guide.py:168-180 | templates/step0/_generators/tpl_compare_tradeoff_scale.py:171-184 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) crates/op-editor-core/src/history_snapshot.rs:410— crates/op-editor-core/src/history_snapshot.rs:410-423 | crates/op-editor-core/src/walkers.rs:29-41 | crates/op-editor-core/src/walkers.rs:44-56 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) crates/op-mcp/src/page_tools.rs:441— crates/op-mcp/src/page_tools.rs:441-455 | crates/op-mcp/src/scalar_vars.rs:68-80 | crates/op-mcp/src/write_tools_variables.rs:115-128 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) crates/op-editor-core/src/agent_indicators.rs:171— crates/op-editor-core/src/agent_indicators.rs:171-183 | crates/op-editor-core/src/agent_indicators.rs:187-199 | crates/op-editor-core/src/agent_indicators.rs:211-223 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) crates/op-editor-core/src/drag_mutators.rs:90— crates/op-editor-core/src/drag_mutators.rs:90-102 | crates/op-editor-core/src/walkers.rs:429-441 | crates/op-mcp/src/image_annotation.rs:18-30 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (10–12 lines × 2) crates/op-editor-core/src/svg_import/path_data.rs:102— crates/op-editor-core/src/svg_import/path_data.rs:102-111 | crates/op-editor-core/src/svg_import/path_data.rs:172-183 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/svg_import/path_data.rs:102` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10–12 lines × 2) crates/op-editor-ui/src/widgets/figma_import.rs:361— crates/op-editor-ui/src/widgets/figma_import.rs:361-372 | crates/op-editor-ui/src/widgets/figma_import_progress.rs:155-164 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/figma_import.rs:361` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–12 lines × 2) crates/op-engine-jni/src/bindings_text.rs:167— crates/op-engine-jni/src/bindings_text.rs:167-176 | crates/op-engine-napi/src/bindings_text.rs:134-145 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-engine-napi/src/bindings_text.rs:134` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–12 lines × 2) crates/op-engine-jni/src/callbacks.rs:114— crates/op-engine-jni/src/callbacks.rs:114-125 | crates/op-engine-jni/src/callbacks.rs:138-147 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-engine-jni/src/callbacks.rs:114` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–12 lines × 2) crates/op-host-native/src/widget_host/variables_panel_row_press.rs:224— crates/op-host-native/src/widget_host/variables_panel_row_press.rs:224-235 | crates/op-host-web/src/widget_host/variables_panel_rows.rs:100-109 — before extracting anything, compare `crates/op-host-native/src/widget_host/variables_panel_row_press.rs` and `crates/op-host-web/src/widget_host/variables_panel_rows.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-native/src/widget_host/variables_panel_row_press.rs:224` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-host-native/src/widget_host/variables_panel_row_press.rs:223` calls `commit_property_focus_if_any` and `crates/op-host-web/src/widget_host/variables_panel_rows.rs:99` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10–12 lines × 2) crates/op-host-web/src/live_sync.rs:103— crates/op-host-web/src/live_sync.rs:103-114 | crates/op-host-web/src/live_sync.rs:164-173 — both copies are in the same file, so extract the 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 `on_response` to `Rc<dyn Fn(String)>` in one and `Option<Rc<dyn Fn(String)>>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-host-web/src/live_sync.rs:162` calls `set_request_header`, `Some` and `crates/op-host-web/src/live_sync.rs:102` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10–12 lines × 2) crates/op-host-web/src/file_actions.rs:133— crates/op-host-web/src/file_actions.rs:133-142 | crates/op-host-web/src/file_actions.rs:195-206 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
op_design_lint::detectors::siblings::check_consistency (cyclomatic 27) crates/op-design-lint/src/detectors/siblings.rs:167— op_design_lint::detectors::siblings::check_consistency has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_design_lint::plan::detect_and_plan (cyclomatic 23) crates/op-design-lint/src/plan.rs:94— op_design_lint::plan::detect_and_plan has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_design_lint::detectors::spacing::walk_edge_section_padding (cyclomatic 21) crates/op-design-lint/src/detectors/spacing.rs:441— op_design_lint::detectors::spacing::walk_edge_section_padding 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.
op_design_lint::detectors::typography::first_solid_color (cyclomatic 19) crates/op-design-lint/src/detectors/typography.rs:268— op_design_lint::detectors::typography::first_solid_color 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.
op_design_lint::fixes::set_property (cyclomatic 18) crates/op-design-lint/src/fixes.rs:14— op_design_lint::fixes::set_property has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_design_lint::detectors::siblings::walk_sibling_inconsistencies (cyclomatic 17) crates/op-design-lint/src/detectors/siblings.rs:73— op_design_lint::detectors::siblings::walk_sibling_inconsistencies 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.
op_preview_core::binding_sites::collect_binding_sites_under (cognitive 41) crates/op-preview-core/src/binding_sites.rs:73— op_preview_core::binding_sites::collect_binding_sites_under has cognitive complexity 41 (threshold 15). Drivers by points: if/else 8 (30 pts), loops 2 (4 pts), match/switch 1 (4 pts), boolean chains 3 (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.
op_preview_core::binding_overlay_apply::apply_value (cognitive 40) crates/op-preview-core/src/binding_overlay_apply.rs:12— op_preview_core::binding_overlay_apply::apply_value has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (39 pts), match/switch 1 (nesting depth added 20). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
op_preview_core::motion::collect_load_warnings (cognitive 32) crates/op-preview-core/src/motion.rs:37— op_preview_core::motion::collect_load_warnings has cognitive complexity 32 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 5 (16 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_preview_core::asset_sync::apply_node_tree (cognitive 19) crates/op-preview-core/src/asset_sync.rs:277— op_preview_core::asset_sync::apply_node_tree has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 1 (3 pts), match/switch 1 (3 pts) (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.
op_preview_core::asset_sync::collect_patches (cognitive 17) crates/op-preview-core/src/asset_sync.rs:216— op_preview_core::asset_sync::collect_patches has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 4 (6 pts), loops 1 (2 pts) (nesting depth added 3). 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.
op_preview_core::binding_overlay::collect_scroll_metadata (cognitive 16) crates/op-preview-core/src/binding_overlay.rs:517— op_preview_core::binding_overlay::collect_scroll_metadata has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_engine_ffi::op_pointer (cognitive 35) crates/op-engine-ffi/src/lib.rs:451— op_engine_ffi::op_pointer has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (29 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_engine_ffi::desc::parse_create (cognitive 27) crates/op-engine-ffi/src/desc.rs:276— op_engine_ffi::desc::parse_create has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18 (20 pts), boolean chains 6, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
op_engine_ffi::editor_chat::execute_tool_requests (cognitive 27) crates/op-engine-ffi/src/editor_chat.rs:485— op_engine_ffi::editor_chat::execute_tool_requests has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_engine_ffi::editor_chat_turn::pump_sse_response (cognitive 21) crates/op-engine-ffi/src/editor_chat_turn.rs:242— op_engine_ffi::editor_chat_turn::pump_sse_response has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_engine_ffi::input::apply_tap (cognitive 21) crates/op-engine-ffi/src/input.rs:124— op_engine_ffi::input::apply_tap has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (20 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.
op_engine_ffi::render::paint_into_canvas (cognitive 18) crates/op-engine-ffi/src/render.rs:102— op_engine_ffi::render::paint_into_canvas has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 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.
Change-coupling hub: variables.rs → plan_normalize.rs, prompt.rs, subagent.rs crates/op-orchestrator/src/variables.rs— `crates/op-orchestrator/src/variables.rs` changes together with 3 other files — `crates/op-orchestrator/src/plan_normalize.rs`, `crates/op-orchestrator/src/prompt.rs`, `crates/op-orchestrator/src/subagent.rs` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Change-coupling hub: tool_schemas.rs → mcp_serve.rs, tests.rs, tool_profile.rs crates/op-chat-agent/src/tool_schemas.rs— `crates/op-chat-agent/src/tool_schemas.rs` changes together with 3 other files — `crates/op-host-services/src/mcp_serve.rs`, `crates/op-host-services/src/mcp_serve/tests.rs`, `crates/op-host-services/src/mcp_serve/tool_profile.rs` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Change-coupling hub: mcp_serve.rs → command.rs, command_apply.rs, tests.rs, lib.rs, parser.rs, write_tools.rs crates/op-host-desktop/src/mcp_serve.rs— `crates/op-host-desktop/src/mcp_serve.rs` changes together with 6 other files — `crates/op-editor-core/src/command.rs`, `crates/op-editor-core/src/command_apply.rs`, `crates/op-host-services/src/mcp_serve/tests.rs`, `crates/op-mcp/src/lib.rs`, `crates/op-mcp/src/parser.rs`, `crates/op-mcp/src/write_tools.rs` — none of which declares a dependency on it: one file is the hub of 6 separate couplings, not 6 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 6.
Change-coupling hub: editor_ui_state.rs → git_panel_ready.rs, property_panel_action.rs, git_host.rs, git_press.rs, overlay_rects.rs crates/op-editor-core/src/editor_ui_state.rs— `crates/op-editor-core/src/editor_ui_state.rs` changes together with 5 other files — `crates/op-editor-ui/src/widgets/git_panel_ready.rs`, `crates/op-editor-ui/src/widgets/property_panel_action.rs`, `crates/op-host-desktop/src/git_host.rs`, `crates/op-host-native/src/widget_host/git_press.rs`, `crates/op-host-native/src/widget_host/overlay_rects.rs` — none of which declares a dependency on it: one file is the hub of 5 separate couplings, not 5 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 5.
Change-coupling hub: tests.rs → ai_chat_hit.rs, ai_chat_panel_hit.rs, ai_chat_panel_paint.rs crates/op-editor-ui/src/widgets/ai_chat_panel/tests.rs— `crates/op-editor-ui/src/widgets/ai_chat_panel/tests.rs` changes together with 3 other files — `crates/op-editor-ui/src/widgets/ai_chat_hit.rs`, `crates/op-editor-ui/src/widgets/ai_chat_panel_hit.rs`, `crates/op-editor-ui/src/widgets/ai_chat_panel_paint.rs` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Change-coupling hub: chat.rs → ai_chat_hit.rs, click.rs, press.rs crates/op-editor-core/src/chat.rs— `crates/op-editor-core/src/chat.rs` changes together with 3 other files — `crates/op-editor-ui/src/widgets/ai_chat_hit.rs`, `crates/op-host-native/src/widget_host/click.rs`, `crates/op-host-web/src/widget_host/press.rs` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
D4 · Code Duplication· Edited copy of a member (33 corresponding lines) · ×6
Edited copy of a member (33 corresponding lines) crates/op-html/src/css/declaration_syntax.rs:169— crates/op-html/src/css/declaration_syntax.rs:169-213 | crates/op-html/src/css/declaration_syntax.rs:287-325 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) crates/op-host-services/src/mcp_serve/enrich_images_tool.rs:296— crates/op-host-services/src/mcp_serve/enrich_images_tool.rs:296-328 | crates/op-host-services/src/mcp_serve/finalize_tool.rs:148-192 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) crates/op-orchestrator/src/cleanup_empty_content_bar.rs:36— crates/op-orchestrator/src/cleanup_empty_content_bar.rs:36-68 | crates/op-orchestrator/src/cleanup_light_plate_on_dark.rs:35-67 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) crates/op-editor-ui/src/widgets/prompt_center_panel_paint.rs:419— crates/op-editor-ui/src/widgets/prompt_center_panel_paint.rs:419-452 | crates/op-editor-ui/src/widgets/scene_template_card_paint.rs:159-191 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) crates/op-editor-ui/src/widgets/scene_template_card_paint.rs:241— crates/op-editor-ui/src/widgets/scene_template_card_paint.rs:241-273 | crates/op-editor-ui/src/widgets/scene_template_card_paint.rs:590-622 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) crates/op-html/src/text_children.rs:393— crates/op-html/src/text_children.rs:393-428 | crates/op-html/src/text_children.rs:497-529 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×6
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/op-codegen/src/codegen_tailwind_style.rs:139— crates/op-codegen/src/codegen_tailwind_style.rs:139-161 | crates/op-codegen/src/lib.rs:290-324 | crates/op-design-lint/src/node_util.rs:439-461 | crates/op-editor-core/src/fills/access.rs:89-111 | crates/op-mcp/src/style_ops_tools.rs:456-478 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/op-editor-core/src/property_edit_mutators.rs:501— crates/op-editor-core/src/property_edit_mutators.rs:501-510 | crates/op-editor-core/src/property_edit_mutators.rs:512-521 | crates/op-editor-core/src/property_edit_mutators.rs:523-532 | crates/op-editor-core/src/property_edit_mutators.rs:534-543 | crates/op-editor-core/src/property_edit_mutators.rs:601-610 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/op-editor-ui/src/widgets/home_surface_connect.rs:101— crates/op-editor-ui/src/widgets/home_surface_connect.rs:101-238 | crates/op-editor-ui/src/widgets/home_surface_paint.rs:550-634 | crates/op-editor-ui/src/widgets/home_surface_paint_cards.rs:235-329 | crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs:298-555 | crates/op-editor-ui/src/widgets/home_surface_paint_panels.rs:31-336 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:159— crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:159-182 | crates/op-orchestrator/src/cleanup_desktop_dashboard.rs:196-219 | crates/op-orchestrator/src/cleanup_mobile_dense.rs:223-247 | crates/op-orchestrator/src/validation_dump.rs:267-281 | crates/op-orchestrator/src/validation_fixes_apply.rs:558-573 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/op-host-desktop/src/chat_acp.rs:348— crates/op-host-desktop/src/chat_acp.rs:348-440 | crates/op-host-services/src/chat_builtin_http.rs:278-467 | crates/op-host-services/src/chat_http_server.rs:139-230 | crates/op-host-services/src/chat_runtime.rs:91-221 | crates/op-host-services/src/chat_subprocess.rs:298-782 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) templates/step0/_generators/tpl_bookreview_carousel.py:230— templates/step0/_generators/tpl_bookreview_carousel.py:230-247 | templates/step0/_generators/tpl_cityguide_carousel.py:251-283 | templates/step0/_generators/tpl_opinion_carousel.py:211-221 | templates/step0/_generators/tpl_story_carousel.py:214-226 | templates/step0/_generators/tpl_yearreview_carousel.py:311-329 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Edited copy of a member (38 corresponding lines) · ×6
Edited copy of a member (38 corresponding lines) crates/op-collab-relay-server/src/connection_reauth.rs:239— crates/op-collab-relay-server/src/connection_reauth.rs:239-278 | crates/op-collab-relay-server/src/connection_reauth.rs:285-322 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (38 corresponding lines) crates/op-orchestrator/src/text_contrast_repair.rs:93— crates/op-orchestrator/src/text_contrast_repair.rs:93-135 | crates/op-orchestrator/src/text_contrast_repair.rs:665-702 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (38 corresponding lines) crates/op-engine-ffi/src/editor_auth.rs:402— crates/op-engine-ffi/src/editor_auth.rs:402-439 | crates/op-engine-ffi/src/editor_export.rs:184-222 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (38 corresponding lines) crates/op-mcp/src/import_html_tool.rs:17— crates/op-mcp/src/import_html_tool.rs:17-59 | crates/op-mcp/src/import_snapshot_tool.rs:15-52 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (38 corresponding lines) crates/op-mcp/src/parser.rs:85— crates/op-mcp/src/parser.rs:85-122 | crates/op-mcp/src/parser.rs:339-386 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (38 corresponding lines) crates/op-editor-ui/src/widgets/scene_template_card_paint.rs:84— crates/op-editor-ui/src/widgets/scene_template_card_paint.rs:84-131 | crates/op-editor-ui/src/widgets/scene_template_card_paint.rs:495-532 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 10+ corresponding lines) · ×6
Edited copies of one member (3 members, 10+ corresponding lines) crates/op-editor-core/src/drag_mutators.rs:66— crates/op-editor-core/src/drag_mutators.rs:66-78 | crates/op-orchestrator/src/avatar_repair.rs:191-200 | crates/op-orchestrator/src/validation_fixes_b3.rs:473-486 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) crates/op-editor-ui/src/widgets/agent_settings_builtin_layout.rs:187— crates/op-editor-ui/src/widgets/agent_settings_builtin_layout.rs:187-196 | crates/op-editor-ui/src/widgets/missing_fonts_panel.rs:256-265 | crates/op-editor-ui/src/widgets/missing_fonts_panel.rs:322-331 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) crates/op-orchestrator/src/cleanup_typography.rs:129— crates/op-orchestrator/src/cleanup_typography.rs:129-138 | crates/op-orchestrator/src/section_headline.rs:57-67 | crates/op-orchestrator/src/validation_dump.rs:568-579 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) crates/op-editor-core/src/export_batch.rs:140— crates/op-editor-core/src/export_batch.rs:140-149 | crates/op-orchestrator/src/mobile_content_rail.rs:536-546 | crates/op-orchestrator/src/plan_fallback_brief.rs:119-128 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) packaging/ios/Sources/ChatAttachmentCoordinator.swift:67— packaging/ios/Sources/ChatAttachmentCoordinator.swift:67-76 | packaging/ios/Sources/DocumentExportCoordinator.swift:86-97 | packaging/ios/Sources/ImageImportCoordinator.swift:57-69 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) crates/op-editor-core/src/conversion.rs:308— crates/op-editor-core/src/conversion.rs:308-317 | crates/op-editor-core/src/uikit_io.rs:257-266 | crates/op-orchestrator/src/cleanup_section_sizing.rs:130-139 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 9+ corresponding lines) · ×6
Edited copies of one member (3 members, 9+ corresponding lines) templates/step0/_generators/tpl_deck_banxin.py:178— templates/step0/_generators/tpl_deck_banxin.py:178-187 | templates/step0/_generators/tpl_deck_banxin.py:192-202 | templates/step0/_generators/tpl_deck_gridpaper.py:156-164 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) crates/op-host-desktop/src/persistence_export_html.rs:59— crates/op-host-desktop/src/persistence_export_html.rs:59-70 | crates/op-host-desktop/src/persistence_export_pptx.rs:59-70 | crates/op-host-desktop/src/persistence_share.rs:63-71 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) crates/op-chat-agent/src/design_agent_diagnostics.rs:174— crates/op-chat-agent/src/design_agent_diagnostics.rs:174-182 | crates/op-design-lint/src/node_util.rs:505-513 | crates/op-orchestrator/src/cleanup_root_and_nav.rs:166-177 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) crates/op-editor-core/src/command_layout_prop.rs:60— crates/op-editor-core/src/command_layout_prop.rs:60-68 | crates/op-html/src/snapshot.rs:760-768 | crates/op-html/src/text.rs:476-484 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) crates/op-editor-ui/src/widgets/agent_settings_builtin_layout.rs:281— crates/op-editor-ui/src/widgets/agent_settings_builtin_layout.rs:281-289 | crates/op-editor-ui/src/widgets/layer_panel_metrics.rs:72-80 | crates/op-editor-ui/src/widgets/preview_device_switcher.rs:29-37 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) crates/op-codegen/src/ai/parse.rs:111— crates/op-codegen/src/ai/parse.rs:111-119 | crates/op-orchestrator/src/plan_repair.rs:693-701 | crates/op-orchestrator/src/validation.rs:241-250 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (16–17 lines × 2) crates/op-editor-core/src/instance_child_override.rs:22— crates/op-editor-core/src/instance_child_override.rs:22-38 | crates/op-editor-core/src/ref_resolve.rs:490-505 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/instance_child_override.rs:22` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–17 lines × 2) crates/op-editor-ui/src/widgets/missing_fonts_panel.rs:285— crates/op-editor-ui/src/widgets/missing_fonts_panel.rs:285-301 | crates/op-editor-ui/src/widgets/property_panel_code_error.rs:268-283 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (16–17 lines × 2) crates/op-editor-ui/src/widgets/property_panel_input_layout.rs:317— crates/op-editor-ui/src/widgets/property_panel_input_layout.rs:317-332 | crates/op-editor-ui/src/widgets/property_panel_layout.rs:435-451 — before extracting anything, compare `crates/op-editor-ui/src/widgets/property_panel_input_layout.rs` and `crates/op-editor-ui/src/widgets/property_panel_layout.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/property_panel_input_layout.rs:317` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–17 lines × 2) crates/op-engine-ffi/src/editor_chat_design_tools.rs:67— crates/op-engine-ffi/src/editor_chat_design_tools.rs:67-83 | crates/op-host-desktop/src/chat_session.rs:566-581 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-engine-ffi/src/editor_chat_design_tools.rs:67` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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–17 lines × 2) crates/op-host-web/src/widget_host/keyboard_edit_ops.rs:332— crates/op-host-web/src/widget_host/keyboard_edit_ops.rs:332-347 | crates/op-host-web/src/widget_host/keyboard_edit_ops.rs:404-420 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-web/src/widget_host/keyboard_edit_ops.rs:332` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/op-host-web/src/widget_host/keyboard_edit_ops.rs:421` calls `delete_input_selection`, `mark_dirty` and `crates/op-host-web/src/widget_host/keyboard_edit_ops.rs:348` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16–17 lines × 2) crates/op-host-web/src/vscode_bridge.rs:168— crates/op-host-web/src/vscode_bridge.rs:168-184 | crates/op-host-web/src/vscode_bridge/early_listener.rs:116-131 — 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–14 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_press_flow.rs:309— crates/op-editor-ui/src/widgets/agent_settings_press_flow.rs:309-322 | crates/op-editor-ui/src/widgets/missing_fonts_flow.rs:101-113 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/agent_settings_press_flow.rs:309` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–14 lines × 2) crates/op-editor-ui/src/widgets/top_bar.rs:598— crates/op-editor-ui/src/widgets/top_bar.rs:598-611 | crates/op-editor-ui/src/widgets/top_bar.rs:654-666 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/top_bar.rs:598` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–14 lines × 2) crates/op-host-services/src/mcp_live/connection.rs:300— crates/op-host-services/src/mcp_live/connection.rs:300-313 | crates/op-host-services/src/mcp_live/snapshot_ingest.rs:230-242 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-services/src/mcp_live/connection.rs:300` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–14 lines × 2) crates/op-html/src/resources_css_urls.rs:16— crates/op-html/src/resources_css_urls.rs:16-29 | crates/op-html/src/resources_css_urls.rs:192-204 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-html/src/resources_css_urls.rs:16` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–14 lines × 2) crates/op-orchestrator/src/cleanup_section_margins.rs:134— crates/op-orchestrator/src/cleanup_section_margins.rs:134-147 | crates/op-orchestrator/src/cleanup_slide_padding.rs:130-142 — before extracting anything, compare `crates/op-orchestrator/src/cleanup_section_margins.rs` and `crates/op-orchestrator/src/cleanup_slide_padding.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-orchestrator/src/cleanup_section_margins.rs:134` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–14 lines × 2) crates/op-orchestrator/src/orchestration_self_check.rs:148— crates/op-orchestrator/src/orchestration_self_check.rs:148-160 | crates/op-orchestrator/src/orchestration_self_check.rs:167-180 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-orchestrator/src/orchestration_self_check.rs:148` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) crates/op-editor-core/src/path_bounds.rs:20— crates/op-editor-core/src/path_bounds.rs:20-29 | crates/op-editor-core/src/svg_path_bounds.rs:16-25 | crates/op-editor-core/src/svg_path_data.rs:171-180 — 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 (10 lines × 3) crates/op-html/src/css/cascade_shared.rs:54— crates/op-html/src/css/cascade_shared.rs:54-63 | crates/op-html/src/css/declaration_syntax.rs:194-203 | crates/op-html/src/css/declaration_syntax.rs:310-319 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-html/src/css/cascade_shared.rs:54` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) crates/op-collab-relay-control-plane/src/http_client.rs:217— crates/op-collab-relay-control-plane/src/http_client.rs:217-226 | crates/op-collab-relay-control-plane/src/issuer.rs:150-159 | crates/op-collab-relay-control-plane/src/publish.rs:393-402 — 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 (10 lines × 3) crates/op-engine-ffi/src/editor_chat.rs:458— crates/op-engine-ffi/src/editor_chat.rs:458-467 | crates/op-engine-ffi/src/editor_chat_hosted_design.rs:430-439 | crates/op-host-desktop/src/chat_session.rs:260-269 — before extracting anything, compare `crates/op-engine-ffi/src/editor_chat.rs` and `crates/op-host-desktop/src/chat_session.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) crates/op-orchestrator/src/cleanup_bottom_nav_repairs.rs:84— crates/op-orchestrator/src/cleanup_bottom_nav_repairs.rs:84-93 | crates/op-orchestrator/src/cleanup_clip_row_stroke.rs:39-48 | crates/op-orchestrator/src/cleanup_container_geometry.rs:40-49 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-orchestrator/src/cleanup_bottom_nav_repairs.rs:84` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `repairs` to `&mut Vec<BottomNavTabDistributionRepair>` in one and `&mut Vec<ClipRowStrokePaddingRepair>` 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 × 3) templates/step0/_generators/tpl2.py:172— templates/step0/_generators/tpl2.py:172-181 | templates/step0/_generators/tpl3.py:106-115 | templates/step0/_generators/tpl_quote_card.py:126-139 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `templates/step0/_generators/tpl2.py:172` it begins part-way through the construct above it, so those exact lines 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) crates/op-editor-ui/src/widgets/font_picker_cache.rs:78— crates/op-editor-ui/src/widgets/font_picker_cache.rs:78-85 | crates/op-editor-ui/src/widgets/layer_panel_cache.rs:216-222 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/font_picker_cache.rs:78` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–8 lines × 2) crates/op-engine-jni/src/bindings_editor.rs:365— crates/op-engine-jni/src/bindings_editor.rs:365-371 | crates/op-engine-napi/src/bindings.rs:131-138 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-engine-jni/src/bindings_editor.rs:365` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–8 lines × 2) crates/op-figma/src/vector_decoder.rs:214— crates/op-figma/src/vector_decoder.rs:214-220 | crates/op-figma/src/vector_decoder.rs: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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-figma/src/vector_decoder.rs:214` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–8 lines × 2) crates/op-host-desktop/src/design_md_host.rs:386— crates/op-host-desktop/src/design_md_host.rs:386-393 | crates/op-host-desktop/src/design_md_host.rs:506-512 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–8 lines × 2) crates/op-host-desktop/src/update_check.rs:143— crates/op-host-desktop/src/update_check.rs:143-150 | crates/op-host-desktop/src/update_check.rs:283-289 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-desktop/src/update_check.rs:143` it does not close everything it opens, so those exact lines 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) crates/op-figma/src/instance.rs:411— crates/op-figma/src/instance.rs:411-417 | crates/op-figma/src/instance/assignment.rs:26-33 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-figma/src/instance/assignment.rs:26` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
op_chat_agent::chat_agent_loop::openai::run_openai_agent_loop_inner (cyclomatic 36) crates/op-chat-agent/src/chat_agent_loop/openai.rs:37— op_chat_agent::chat_agent_loop::openai::run_openai_agent_loop_inner has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_chat_agent::chat_agent_loop::anthropic::run_anthropic_agent_loop_inner (cyclomatic 35) crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:80— op_chat_agent::chat_agent_loop::anthropic::run_anthropic_agent_loop_inner has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_chat_agent::design_agent_tools::execute_design_tool_with_root_seed_guard (cyclomatic 34) crates/op-chat-agent/src/design_agent_tools.rs:173— op_chat_agent::design_agent_tools::execute_design_tool_with_root_seed_guard 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.
op_chat_agent::design_agent_diagnostics::scan_container_intent (cyclomatic 16) crates/op-chat-agent/src/design_agent_diagnostics.rs:204— op_chat_agent::design_agent_diagnostics::scan_container_intent 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.
op_chat_agent::design_context::collect_design_facts (cyclomatic 16) crates/op-chat-agent/src/design_context.rs:84— op_chat_agent::design_context::collect_design_facts 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.
op_brand::css_signals::analyze_site (cyclomatic 21) crates/op-brand/src/css_signals.rs:33— op_brand::css_signals::analyze_site has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
op_brand::css_scan::walk (cyclomatic 18) crates/op-brand/src/css_scan.rs:48— op_brand::css_scan::walk 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.
op_brand::css_signals::record_block (cyclomatic 18) crates/op-brand/src/css_signals.rs:160— op_brand::css_signals::record_block 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.
op_brand::css_select::role_of (cyclomatic 16) crates/op-brand/src/css_select.rs:167— op_brand::css_select::role_of 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.
op_brand::css_tokens::mode_from_evidence (cyclomatic 16) crates/op-brand/src/css_tokens.rs:100— op_brand::css_tokens::mode_from_evidence 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.
op_image_enrich::net::providers::relevance_intent::intent_rewrite (cyclomatic 20) crates/op-image-enrich/src/net/providers/relevance_intent.rs:121— op_image_enrich::net::providers::relevance_intent::intent_rewrite 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.
op_image_enrich::apply::apply_result (cyclomatic 17) crates/op-image-enrich/src/apply.rs:49— op_image_enrich::apply::apply_result has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
op_image_enrich::net::fetch::fetch_first_image_url_with_judge (cyclomatic 17) crates/op-image-enrich/src/net/fetch.rs:69— op_image_enrich::net::fetch::fetch_first_image_url_with_judge 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.
op_image_enrich::net::providers::catalog::fetch_openverse_json (cyclomatic 16) crates/op-image-enrich/src/net/providers/catalog.rs:104— op_image_enrich::net::providers::catalog::fetch_openverse_json 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.
op_image_enrich::targets::page_context::heading_description (cyclomatic 16) crates/op-image-enrich/src/targets/page_context.rs:105— op_image_enrich::targets::page_context::heading_description has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to one function item inside it that branches (walk). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
op_ai_skills::style_guide::token_table::extract_table_colors (cyclomatic 19) crates/op-ai-skills/src/style_guide/token_table.rs:288— op_ai_skills::style_guide::token_table::extract_table_colors 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.
op_ai_skills::style_guide::parser::extract_typography (cyclomatic 17) crates/op-ai-skills/src/style_guide/parser.rs:168— op_ai_skills::style_guide::parser::extract_typography 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.
op_ai_skills::budget::trim_by_budget_pinned (cyclomatic 16) crates/op-ai-skills/src/budget.rs:121— op_ai_skills::budget::trim_by_budget_pinned 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.
op_ai_skills::frontmatter::entries (cyclomatic 16) crates/op-ai-skills/src/frontmatter.rs:119— op_ai_skills::frontmatter::entries 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.
op_ai_skills::frontmatter::parse_skill_frontmatter (cyclomatic 16) crates/op-ai-skills/src/frontmatter.rs:189— op_ai_skills::frontmatter::parse_skill_frontmatter has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_editor_host_core::codegen_session::run_pipeline_with_model_and_cancel_token (cognitive 53) crates/op-editor-host-core/src/codegen_session.rs:280— op_editor_host_core::codegen_session::run_pipeline_with_model_and_cancel_token has cognitive complexity 53 (threshold 15). Drivers by points: if/else 9 (29 pts), match/switch 4 (15 pts), loops 3 (8 pts), boolean chains 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.
op_editor_host_core::settings_io::apply_payload_with_options (cognitive 29) crates/op-editor-host-core/src/settings_io.rs:320— op_editor_host_core::settings_io::apply_payload_with_options has cognitive complexity 29 (threshold 15). Drivers by points: if/else 26 (29 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
op_editor_host_core::chat::chat_history_from_transcript (cognitive 24) crates/op-editor-host-core/src/chat.rs:336— op_editor_host_core::chat::chat_history_from_transcript has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_host_core::settings_io_checked::validate_credential_entries (cognitive 22) crates/op-editor-host-core/src/settings_io_checked.rs:196— op_editor_host_core::settings_io_checked::validate_credential_entries has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_editor_host_core::codegen_runtime_state::pump_codegen_state (cognitive 17) crates/op-editor-host-core/src/codegen_runtime_state.rs:103— op_editor_host_core::codegen_runtime_state::pump_codegen_state has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 2 (5 pts), loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Edited copy of a member (39 corresponding lines) · ×5
Edited copy of a member (39 corresponding lines) crates/op-host-services/src/doc_io.rs:252— crates/op-host-services/src/doc_io.rs:252-309 | crates/op-host-web/src/file_actions.rs:362-400 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (39 corresponding lines) crates/op-host-web/src/iconify_web.rs:373— crates/op-host-web/src/iconify_web.rs:373-411 | crates/op-host-web/src/web_asset_fetch.rs:378-432 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (39 corresponding lines) crates/op-editor-core/src/conversion.rs:83— crates/op-editor-core/src/conversion.rs:83-131 | crates/op-editor-core/src/conversion.rs:155-193 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (39 corresponding lines) crates/op-html/src/css/selectors_parser.rs:552— crates/op-html/src/css/selectors_parser.rs:552-595 | crates/op-html/src/mapper_visual_syntax.rs:48-86 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (39 corresponding lines) crates/op-host-web/src/widget_host/keyboard_edit_ops.rs:123— crates/op-host-web/src/widget_host/keyboard_edit_ops.rs:123-161 | crates/op-host-web/src/widget_host/keyboard_edit_ops.rs:455-497 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (36 corresponding lines) · ×5
Edited copy of a member (36 corresponding lines) crates/op-editor-ui/src/theme.rs:105— crates/op-editor-ui/src/theme.rs:105-140 | crates/op-editor-ui/src/theme.rs:145-180 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (36 corresponding lines) crates/op-editor-core/src/host_support_allocator.rs:210— crates/op-editor-core/src/host_support_allocator.rs:210-245 | crates/op-editor-core/src/host_support_allocator.rs:256-302 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (36 corresponding lines) templates/step0/_generators/tpl_tutorial_skincare.py:219— templates/step0/_generators/tpl_tutorial_skincare.py:219-254 | templates/step0/_generators/tpl_tutorial_storage.py:214-264 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (36 corresponding lines) crates/op-host-services/src/export_html_structured.rs:105— crates/op-host-services/src/export_html_structured.rs:105-140 | crates/op-host-services/src/export_pptx.rs:152-191 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (36 corresponding lines) crates/op-html/src/css/selectors_parser.rs:406— crates/op-html/src/css/selectors_parser.rs:406-441 | crates/op-html/src/mapper_visual_syntax.rs:11-46 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 18+ corresponding lines) · ×5
Edited copies of one member (3 members, 18+ corresponding lines) crates/op-mcp/src/node_attr_tools.rs:57— crates/op-mcp/src/node_attr_tools.rs:57-74 | crates/op-mcp/src/node_attr_tools.rs:208-228 | crates/op-mcp/src/node_attr_tools.rs:344-364 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 18+ corresponding lines) crates/op-orchestrator/src/cleanup_clip_row_stroke.rs:6— crates/op-orchestrator/src/cleanup_clip_row_stroke.rs:6-28 | crates/op-orchestrator/src/cleanup_container_geometry.rs:89-111 | crates/op-orchestrator/src/cleanup_section_sizing.rs:103-120 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 18+ corresponding lines) crates/op-host-web/src/dom_io.rs:140— crates/op-host-web/src/dom_io.rs:140-157 | crates/op-host-web/src/theme_preset_io.rs:67-85 | crates/op-host-web/src/web_design_md.rs:51-70 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 18+ corresponding lines) crates/op-chat-agent/src/chat_modify.rs:91— crates/op-chat-agent/src/chat_modify.rs:91-108 | crates/op-chat-agent/src/design_agent_diagnostics.rs:408-425 | crates/op-editor-core/src/scene_template_append.rs:225-247 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 18+ corresponding lines) crates/op-editor-ui/src/widgets/agent_settings_images/layout.rs:475— crates/op-editor-ui/src/widgets/agent_settings_images/layout.rs:475-492 | crates/op-editor-ui/src/widgets/agent_settings_images/layout.rs:500-517 | crates/op-editor-ui/src/widgets/agent_settings_images/layout.rs:540-557 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 12+ corresponding lines) · ×5
Edited copies of one member (3 members, 12+ corresponding lines) crates/op-editor-ui/src/widgets/layer_context_menu.rs:246— crates/op-editor-ui/src/widgets/layer_context_menu.rs:246-262 | crates/op-editor-ui/src/widgets/layer_context_menu.rs:283-302 | crates/op-editor-ui/src/widgets/path_anchor_context_menu.rs:67-78 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) crates/op-orchestrator/src/cleanup_section_margins.rs:225— crates/op-orchestrator/src/cleanup_section_margins.rs:225-236 | crates/op-orchestrator/src/cleanup_slide_padding.rs:295-310 | crates/op-orchestrator/src/cleanup_slide_padding.rs:316-333 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) crates/op-host-desktop/src/persistence_image.rs:67— crates/op-host-desktop/src/persistence_image.rs:67-80 | crates/op-host-services/src/chat_attachment.rs:36-50 | crates/op-host-web/src/file_actions.rs:417-428 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) crates/op-editor-ui/src/widgets/collab_ui.rs:572— crates/op-editor-ui/src/widgets/collab_ui.rs:572-584 | crates/op-editor-ui/src/widgets/collab_ui.rs:587-599 | crates/op-editor-ui/src/widgets/collab_ui.rs:603-614 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) templates/step0/_generators/tpl_infographic_blank_vs_example.py:216— templates/step0/_generators/tpl_infographic_blank_vs_example.py:216-235 | templates/step0/_generators/tpl_infographic_concept.py:243-265 | templates/step0/_generators/tpl_infographic_weekly_review.py:249-260 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 13+ corresponding lines) · ×5
Edited copies of one member (4 members, 13+ corresponding lines) crates/op-editor-core/src/command_node/tree_ops.rs:18— crates/op-editor-core/src/command_node/tree_ops.rs:18-33 | crates/op-editor-core/src/components.rs:377-393 | crates/op-editor-core/src/walkers.rs:77-90 | crates/op-editor-core/src/walkers.rs:95-107 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 13+ corresponding lines) crates/op-editor-core/src/command_style_replace.rs:310— crates/op-editor-core/src/command_style_replace.rs:310-322 | crates/op-editor-core/src/command_style_replace.rs:324-339 | crates/op-editor-core/src/command_style_replace.rs:341-356 | crates/op-editor-core/src/command_style_replace.rs:362-377 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 13+ corresponding lines) crates/op-orchestrator/src/geometry_validation.rs:215— crates/op-orchestrator/src/geometry_validation.rs:215-229 | crates/op-orchestrator/src/image_fallback_policy.rs:31-45 | crates/op-orchestrator/src/radial_repair_sink.rs:58-70 | crates/op-orchestrator/src/text_contrast_repair.rs:599-613 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 13+ corresponding lines) crates/op-host-native/src/widget_host/text_edit_press.rs:300— crates/op-host-native/src/widget_host/text_edit_press.rs:300-312 | crates/op-host-native/src/widget_host/text_edit_press.rs:315-327 | crates/op-host-web/src/widget_host/text_edit_caret.rs:17-29 | crates/op-host-web/src/widget_host/text_edit_caret.rs:31-43 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 13+ corresponding lines) crates/op-preview-core/src/tests_clock_gate.rs:39— crates/op-preview-core/src/tests_clock_gate.rs:39-51 | crates/op-preview-core/src/tests_multi_pointer.rs:53-65 | crates/op-preview-core/src/tests_swipe.rs:50-62 | crates/op-preview-core/src/tests_widget_states.rs:100-112 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Duplicated block (19 lines × 2) crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:337— crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:337-355 | crates/op-chat-agent/src/chat_agent_loop/openai.rs:296-314 — before extracting anything, compare `crates/op-chat-agent/src/chat_agent_loop/anthropic.rs` and `crates/op-chat-agent/src/chat_agent_loop/openai.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 175 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (19 lines × 2) crates/op-editor-ui/src/widgets/home_surface_layout.rs:524— crates/op-editor-ui/src/widgets/home_surface_layout.rs:524-542 | crates/op-editor-ui/src/widgets/home_surface_layout_compact.rs:272-290 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/home_surface_layout.rs:524` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) crates/op-engine-ffi/src/editor_model_discovery.rs:225— crates/op-engine-ffi/src/editor_model_discovery.rs:225-243 | crates/op-host-desktop/src/builtin_model_refresh_host.rs:118-136 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (19 lines × 2) crates/op-host-native/src/widget_host/press_helpers.rs:58— crates/op-host-native/src/widget_host/press_helpers.rs:58-76 | crates/op-host-web/src/widget_host/shape_create.rs:69-87 — 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 (19 lines × 2) crates/op-host-native/src/widget_host/preview_slideshow.rs:218— crates/op-host-native/src/widget_host/preview_slideshow.rs:218-236 | crates/op-host-web/src/widget_host/preview_slideshow.rs:373-391 — before extracting anything, compare `crates/op-host-native/src/widget_host/preview_slideshow.rs` and `crates/op-host-web/src/widget_host/preview_slideshow.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 171 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (18 lines × 2) crates/op-collab-relay-server/src/connection.rs:496— crates/op-collab-relay-server/src/connection.rs:496-513 | crates/op-collab-relay-server/src/connection_wait.rs:57-74 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-collab-relay-server/src/connection.rs:496` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) crates/op-collab/src/diff_index.rs:128— crates/op-collab/src/diff_index.rs:128-145 | crates/op-editor-core/src/command_refine.rs:187-204 — before extracting anything, compare `crates/op-collab/src/diff_index.rs` and `crates/op-editor-core/src/command_refine.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-collab/src/diff_index.rs:128` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) crates/op-collab/src/guest_pending.rs:40— crates/op-collab/src/guest_pending.rs:40-57 | crates/op-collab/src/guest_pending.rs:93-110 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) crates/op-editor-ui/src/collab_avatar_runtime.rs:470— crates/op-editor-ui/src/collab_avatar_runtime.rs:470-487 | crates/op-editor-ui/src/collab_avatar_runtime.rs:491-508 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/collab_avatar_runtime.rs:470` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) crates/op-pen-loader/src/layout_scene.rs:98— crates/op-pen-loader/src/layout_scene.rs:98-115 | crates/op-pen-loader/src/layout_scene.rs:163-180 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-pen-loader/src/layout_scene.rs:98` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–15 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_images/paint.rs:300— crates/op-editor-ui/src/widgets/agent_settings_images/paint.rs:300-314 | crates/op-editor-ui/src/widgets/agent_settings_images/paint.rs:429-442 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/agent_settings_images/paint.rs:300` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–15 lines × 2) crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:55— crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:55-69 | crates/op-editor-ui/src/widgets/property_panel_stroke.rs:243-256 — before extracting anything, compare `crates/op-editor-ui/src/widgets/property_panel_fill_body.rs` and `crates/op-editor-ui/src/widgets/property_panel_stroke.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14–15 lines × 2) crates/op-image-enrich/src/net/providers/catalog.rs:138— crates/op-image-enrich/src/net/providers/catalog.rs:138-152 | crates/op-image-enrich/src/net/providers/catalog.rs:513-526 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-image-enrich/src/net/providers/catalog.rs:138` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14–15 lines × 2) crates/op-preview-core/src/present.rs:298— crates/op-preview-core/src/present.rs:298-312 | crates/op-preview-core/src/session_paint.rs:135-148 — before extracting anything, compare `crates/op-preview-core/src/present.rs` and `crates/op-preview-core/src/session_paint.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-preview-core/src/present.rs:298` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14–15 lines × 2) crates/op-orchestrator/src/run_tests_b4.rs:46— crates/op-orchestrator/src/run_tests_b4.rs:46-60 | crates/op-orchestrator/src/run_tests_b4.rs:67-80 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-orchestrator/src/run_tests_b4.rs:46` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–11 lines × 2) crates/op-editor-core/src/editor_ui_state/home_page_count.rs:8— crates/op-editor-core/src/editor_ui_state/home_page_count.rs:8-18 | crates/op-orchestrator/src/subtask_completeness.rs:644-653 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/editor_ui_state/home_page_count.rs:8` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–11 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_caret.rs:142— crates/op-editor-ui/src/widgets/agent_settings_caret.rs:142-152 | crates/op-editor-ui/src/widgets/property_panel_text_input.rs:62-71 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/agent_settings_caret.rs:142` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–11 lines × 2) crates/op-editor-ui/src/widgets/layer_panel.rs:490— crates/op-editor-ui/src/widgets/layer_panel.rs:490-500 | crates/op-editor-ui/src/widgets/layer_panel.rs:678-687 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/layer_panel.rs:490` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–11 lines × 2) crates/op-editor-ui/src/widgets/property_panel_image_node.rs:152— crates/op-editor-ui/src/widgets/property_panel_image_node.rs:152-161 | crates/op-editor-ui/src/widgets/property_panel_text.rs:279-289 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/property_panel_image_node.rs:152` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–11 lines × 2) crates/op-host-web/src/dom_io/html_zip_session.rs:230— crates/op-host-web/src/dom_io/html_zip_session.rs:230-239 | crates/op-host-web/src/dom_io/html_zip_session.rs:263-273 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-web/src/dom_io/html_zip_session.rs:230` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 4) crates/op-editor-ui/src/widgets/property_panel_inputs.rs:283— crates/op-editor-ui/src/widgets/property_panel_inputs.rs:283-291 | crates/op-editor-ui/src/widgets/property_panel_inputs.rs:381-389 | crates/op-editor-ui/src/widgets/property_panel_inputs.rs:509-517 | crates/op-editor-ui/src/widgets/property_panel_layer.rs:227-235 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9 lines × 4) crates/op-orchestrator/src/table_filter_contract.rs:234— crates/op-orchestrator/src/table_filter_contract.rs:234-242 | crates/op-orchestrator/src/table_filter_contract.rs:361-369 | crates/op-orchestrator/src/table_filter_contract.rs:437-445 | crates/op-orchestrator/src/table_filter_contract.rs:453-461 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-orchestrator/src/table_filter_contract.rs:234` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 4) crates/op-orchestrator/src/cleanup_desktop_dashboard.rs:235— crates/op-orchestrator/src/cleanup_desktop_dashboard.rs:235-243 | crates/op-orchestrator/src/cleanup_mobile_dense.rs:265-273 | crates/op-orchestrator/src/cleanup_root_and_nav.rs:231-239 | crates/op-orchestrator/src/cleanup_typography.rs:103-111 — before extracting anything, compare `crates/op-orchestrator/src/cleanup_desktop_dashboard.rs` and `crates/op-orchestrator/src/cleanup_mobile_dense.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 4) crates/op-mcp/src/node_attr_tools.rs:102— crates/op-mcp/src/node_attr_tools.rs:102-110 | crates/op-mcp/src/node_attr_tools.rs:140-148 | crates/op-mcp/src/node_attr_tools.rs:255-263 | crates/op-mcp/src/node_attr_tools.rs:313-323 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-mcp/src/node_attr_tools.rs:102` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 4) crates/op-editor-core/src/command_style_replace.rs:417— crates/op-editor-core/src/command_style_replace.rs:417-425 | crates/op-editor-core/src/fills/access.rs:158-166 | crates/op-figma/src/clipboard.rs:562-570 | crates/op-orchestrator/src/variable_binding.rs:353-361 — before extracting anything, compare `crates/op-editor-core/src/fills/access.rs` and `crates/op-orchestrator/src/variable_binding.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/command_style_replace.rs:417` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/op-editor-core/src/command_style_replace.rs:426` calls `IconFont`, `as_mut` and `crates/op-orchestrator/src/variable_binding.rs:362` 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 × 2 locations) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:168— crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:168 · crates/op-host-web/src/op_ck_bridge.js:572 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (11 lines × 2 locations) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:241— crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:241 · crates/op-host-web/src/op_ck_bridge.js:1013 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (11 lines × 2 locations) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:431— crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:431 · crates/op-host-web/src/op_ck_bridge.js:1909 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (11 lines × 2 locations) crates/op-host-web/src/op_ck_bridge.js:1517— crates/op-host-web/src/op_ck_bridge.js:1517 · crates/op-host-web/src/op_ck_bridge.js:1636 — both copies are in the same file, so extract the block into 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 locations) packages/op-chrome-extension/design-capture.js:61— packages/op-chrome-extension/design-capture.js:61 · packages/op-chrome-extension/design-evidence.js:28 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
AIChatPlaceholder::hit_test_with_canonical (cyclomatic 67) crates/op-editor-ui/src/widgets/ai_chat_panel_hit.rs:63— AIChatPlaceholder::hit_test_with_canonical has cyclomatic complexity 67 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AIChatPlaceholder::paint (cyclomatic 29) crates/op-editor-ui/src/widgets/ai_chat_panel/widget_paint.rs:23— AIChatPlaceholder::paint 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.
AIChatPlaceholder::footer_hover_at (cyclomatic 21) crates/op-editor-ui/src/widgets/ai_chat_panel_hit.rs:591— AIChatPlaceholder::footer_hover_at 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.
AIChatPlaceholder::resize_edge_at (cyclomatic 18) crates/op-editor-ui/src/widgets/ai_chat_panel_hit.rs:421— AIChatPlaceholder::resize_edge_at has cyclomatic complexity 18 (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.
op_collab_relay_server::connection::relay_paired (cyclomatic 25) crates/op-collab-relay-server/src/connection.rs:477— op_collab_relay_server::connection::relay_paired 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.
op_collab_relay_server::connection::serve_connection (cyclomatic 23) crates/op-collab-relay-server/src/connection.rs:92— op_collab_relay_server::connection::serve_connection has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_collab_relay_server::connection_wait::wait_for_pair (cyclomatic 20) crates/op-collab-relay-server/src/connection_wait.rs:33— op_collab_relay_server::connection_wait::wait_for_pair has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_collab_relay_server::parse_arg_values (cyclomatic 17) crates/op-collab-relay-server/src/main.rs:121— op_collab_relay_server::parse_arg_values has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
op_collab_host::runtime::network::connection::drive_guest (cognitive 80) crates/op-collab-host/src/runtime/network/connection.rs:188— op_collab_host::runtime::network::connection::drive_guest has cognitive complexity 80 (threshold 15). Drivers by points: if/else 15 (49 pts), match/switch 8 (25 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 52). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_collab_host::runtime::network::connection::drive_owner_peer (cognitive 67) crates/op-collab-host/src/runtime/network/connection.rs:41— op_collab_host::runtime::network::connection::drive_owner_peer has cognitive complexity 67 (threshold 15). Drivers by points: if/else 12 (40 pts), match/switch 7 (22 pts), loops 2 (3 pts), boolean chains 2 (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.
op_collab_host::runtime::network::owner::run_inner (cognitive 66) crates/op-collab-host/src/runtime/network/owner.rs:67— op_collab_host::runtime::network::owner::run_inner has cognitive complexity 66 (threshold 15). Drivers by points: if/else 12 (36 pts), match/switch 11 (25 pts), loops 3 (5 pts) (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_collab_host::runtime::network::guest::run_inner (cognitive 19) crates/op-collab-host/src/runtime/network/guest.rs:209— op_collab_host::runtime::network::guest::run_inner has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 3 (4 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.
op_smoke::main (cognitive 78) crates/op-smoke/src/main.rs:202— op_smoke::main has cognitive complexity 78 (threshold 15). Drivers by points: if/else 26 (39 pts), match/switch 18 (34 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_smoke::image_fill::fill_images_with_fetch (cognitive 33) crates/op-smoke/src/image_fill.rs:172— op_smoke::image_fill::fill_images_with_fetch has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (32 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_smoke::audit_rubric::interactivity_report (cognitive 20) crates/op-smoke/src/audit_rubric.rs:141— op_smoke::audit_rubric::interactivity_report has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 3 (6 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.
op_smoke::loop_mode::run_loop (cognitive 16) crates/op-smoke/src/loop_mode.rs:305— op_smoke::loop_mode::run_loop has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_opmerge::merge_core (cognitive 43) crates/op-opmerge/src/lib.rs:167— op_opmerge::merge_core has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (26 pts), match/switch 3 (7 pts), loops 3 (6 pts), boolean chains 4 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_opmerge::apply_overrides (cognitive 41) crates/op-opmerge/src/lib.rs:565— op_opmerge::apply_overrides has cognitive complexity 41 (threshold 15). Drivers by points: if/else 6 (24 pts), loops 4 (14 pts), match/switch 2 (3 pts) (nesting depth added 29). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
op_opmerge::remap_colliding_image_ids (cognitive 23) crates/op-opmerge/src/lib.rs:351— op_opmerge::remap_colliding_image_ids has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3 (6 pts), match/switch 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.
op_opmerge::collect (cognitive 19) crates/op-opmerge/src/lib.rs:434— op_opmerge::collect has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (8 pts), match/switch 2 (3 pts) (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
WriteEvidence::user_list (cognitive 34) crates/op-orchestrator/src/initial_binding_check_actions.rs:154— WriteEvidence::user_list has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 3 (7 pts), match/switch 1 (2 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WriteEvidence::initial_visibility (cognitive 31) crates/op-orchestrator/src/initial_binding_check_actions.rs:47— WriteEvidence::initial_visibility has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 3 (8 pts), match/switch 2 (5 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WriteEvidence::defer_action (cognitive 31) crates/op-orchestrator/src/initial_binding_check_actions.rs:215— WriteEvidence::defer_action has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 5 (11 pts), match/switch 1 (nesting depth added 17). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
WriteEvidence::events (cognitive 18) crates/op-orchestrator/src/initial_binding_check_actions.rs:97— WriteEvidence::events has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (16 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.
op_collab::ticket_json::decode_ticket_string (cognitive 26) crates/op-collab/src/ticket_json.rs:127— op_collab::ticket_json::decode_ticket_string has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (18 pts), match/switch 2 (5 pts), boolean chains 2, 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.
op_collab::guest::validate_welcome (cognitive 19) crates/op-collab/src/guest.rs:505— op_collab::guest::validate_welcome has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 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.
op_collab::codec::validate_presence (cognitive 17) crates/op-collab/src/codec.rs:745— op_collab::codec::validate_presence has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_collab::diff_fields::collect_property_changes (cognitive 16) crates/op-collab/src/diff_fields.rs:12— op_collab::diff_fields::collect_property_changes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PreviewSession::reconcile (cognitive 26) crates/op-preview-core/src/app_mode.rs:194— PreviewSession::reconcile has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 5 (6 pts), match/switch 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.
PreviewSession::sync_image_assets (cognitive 20) crates/op-preview-core/src/asset_sync.rs:44— PreviewSession::sync_image_assets has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 3 (7 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PreviewSession::pinned_nav_candidate (cognitive 19) crates/op-preview-core/src/present.rs:157— PreviewSession::pinned_nav_candidate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, loops 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PreviewSession::enter_with_host_motion_preference (cognitive 16) crates/op-preview-core/src/session.rs:292— PreviewSession::enter_with_host_motion_preference has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 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.
GuestSessionCore::handle_undo_result (cognitive 20) crates/op-collab/src/guest_sync.rs:290— GuestSessionCore::handle_undo_result has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4, loops 1, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GuestSessionCore::finalize_install (cognitive 17) crates/op-collab/src/guest.rs:322— GuestSessionCore::finalize_install has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 pts), loops 2 (4 pts), match/switch 1 (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.
GuestSessionCore::handle_snapshot (cognitive 16) crates/op-collab/src/guest_sync.rs:92— GuestSessionCore::handle_snapshot has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (16 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.
GuestSessionCore::prepare_commit_install (cognitive 16) crates/op-collab/src/guest_sync.rs:192— GuestSessionCore::prepare_commit_install has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 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.
D30 · Dependency Vulnerabilities· Medium vulnerability · ×4
REDACTED
REDACTED
REDACTED
REDACTED
D4 · Code Duplication· Edited copy of a member (40 corresponding lines) · ×4
Edited copy of a member (40 corresponding lines) crates/op-editor-core/src/svg_import/path_data.rs:270— crates/op-editor-core/src/svg_import/path_data.rs:270-309 | crates/op-editor-core/src/svg_path_data.rs:416-455 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (40 corresponding lines) crates/op-host-web/src/vscode_bridge.rs:626— crates/op-host-web/src/vscode_bridge.rs:626-665 | crates/op-host-web/src/vscode_bridge.rs:698-739 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (40 corresponding lines) crates/op-editor-ui/src/widgets/file_menu_paint.rs:269— crates/op-editor-ui/src/widgets/file_menu_paint.rs:269-308 | crates/op-editor-ui/src/widgets/file_menu_paint.rs:322-364 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (40 corresponding lines) crates/op-orchestrator/src/role_layout_post_pass.rs:202— crates/op-orchestrator/src/role_layout_post_pass.rs:202-242 | crates/op-orchestrator/src/stub_repair.rs:148-187 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (37 corresponding lines) · ×4
Edited copy of a member (37 corresponding lines) crates/op-figma/src/instance/fingerprint.rs:349— crates/op-figma/src/instance/fingerprint.rs:349-402 | crates/op-figma/src/instance/fingerprint.rs:419-455 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (37 corresponding lines) crates/op-host-services/src/export_html.rs:54— crates/op-host-services/src/export_html.rs:54-90 | crates/op-host-services/src/export_pptx.rs:92-131 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (37 corresponding lines) crates/op-host-web/src/a11y_dom.rs:81— crates/op-host-web/src/a11y_dom.rs:81-117 | crates/op-host-web/src/ime_input.rs:67-106 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (37 corresponding lines) crates/op-orchestrator/src/cleanup_slide_padding.rs:253— crates/op-orchestrator/src/cleanup_slide_padding.rs:253-289 | crates/op-orchestrator/src/cleanup_slide_padding.rs:356-397 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 15+ corresponding lines) · ×4
Edited copies of one member (3 members, 15+ corresponding lines) crates/op-mcp/src/read_tools_extra.rs:75— crates/op-mcp/src/read_tools_extra.rs:75-89 | crates/op-mcp/src/read_tools_extra.rs:122-137 | crates/op-mcp/src/tools.rs:606-629 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) templates/step0/_generators/tpl_gradient_tech.py:219— templates/step0/_generators/tpl_gradient_tech.py:219-233 | templates/step0/_generators/tpl_gradient_tech.py:414-434 | templates/step0/_generators/tpl_pitch_dark.py:187-205 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) crates/op-editor-ui/src/widgets/text_input_backend.rs:365— crates/op-editor-ui/src/widgets/text_input_backend.rs:365-380 | crates/op-host-native/src/backend/skia/image.rs:247-262 | crates/op-host-web/src/canvaskit/backend.rs:494-508 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) crates/op-orchestrator/src/run_tests_d1.rs:89— crates/op-orchestrator/src/run_tests_d1.rs:89-104 | crates/op-orchestrator/src/run_tests_planning_retry.rs:347-361 | crates/op-orchestrator/src/validation_tests_c2.rs:23-37 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 16+ corresponding lines) · ×4
Edited copies of one member (4 members, 16+ corresponding lines) crates/op-editor-core/src/walkers.rs:117— crates/op-editor-core/src/walkers.rs:117-132 | crates/op-editor-core/src/walkers.rs:141-156 | crates/op-editor-core/src/walkers.rs:167-187 | crates/op-editor-core/src/walkers.rs:199-219 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 16+ corresponding lines) crates/op-collab-transport/src/admission.rs:134— crates/op-collab-transport/src/admission.rs:134-151 | crates/op-collab/src/protocol.rs:112-129 | crates/op-collab/src/protocol.rs:374-389 | crates/op-editor-core/src/collab_owner_confirm_ui.rs:82-98 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 16+ corresponding lines) crates/op-chrome-extension-core/src/filename.rs:68— crates/op-chrome-extension-core/src/filename.rs:68-83 | crates/op-chrome-extension-core/src/filename.rs:86-101 | crates/op-chrome-extension-core/src/hub.rs:262-277 | crates/op-editor-core/src/command_refine.rs:421-436 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 16+ corresponding lines) crates/op-preview-core/src/tests_event_payloads.rs:11— crates/op-preview-core/src/tests_event_payloads.rs:11-55 | crates/op-preview-core/src/tests_motion.rs:11-28 | crates/op-preview-core/src/tests_motion.rs:30-45 | crates/op-preview-core/src/tests_pointer_bindings.rs:12-27 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 14+ corresponding lines) · ×4
Edited copies of one member (3 members, 14+ corresponding lines) crates/op-cli/src/command_mappers.rs:56— crates/op-cli/src/command_mappers.rs:56-70 | crates/op-cli/src/command_mappers.rs:72-85 | crates/op-cli/src/command_mappers.rs:87-100 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) crates/op-mcp/src/batch_design_normalize.rs:442— crates/op-mcp/src/batch_design_normalize.rs:442-458 | crates/op-mcp/src/batch_layered.rs:459-475 | crates/op-mcp/src/insert_node_data.rs:157-170 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) crates/op-collab/src/apply_tree.rs:238— crates/op-collab/src/apply_tree.rs:238-251 | crates/op-collab/src/apply_tree.rs:277-290 | crates/op-collab/src/apply_tree.rs:296-309 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) crates/op-editor-ui/src/widgets/menu_paint.rs:59— crates/op-editor-ui/src/widgets/menu_paint.rs:59-74 | crates/op-editor-ui/src/widgets/property_panel_inputs.rs:174-187 | crates/op-editor-ui/src/widgets/variables_panel/paint.rs:670-683 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 15+ corresponding lines) · ×4
Edited copies of one member (4 members, 15+ corresponding lines) crates/op-pen-loader/src/widget_payload.rs:86— crates/op-pen-loader/src/widget_payload.rs:86-100 | crates/op-pen-loader/src/widget_payload.rs:102-117 | crates/op-pen-loader/src/widget_payload.rs:138-153 | crates/op-pen-loader/src/widget_payload.rs:177-193 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 15+ corresponding lines) crates/op-editor-core/src/image_aspect.rs:47— crates/op-editor-core/src/image_aspect.rs:47-61 | crates/op-editor-core/src/property_edit_mutators.rs:417-432 | crates/op-editor-core/src/property_edit_mutators.rs:435-450 | crates/op-editor-core/src/property_edit_mutators.rs:453-468 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 15+ corresponding lines) crates/op-chrome-extension-core/src/wasm_api.rs:194— crates/op-chrome-extension-core/src/wasm_api.rs:194-208 | crates/op-chrome-extension-core/src/wasm_api.rs:212-229 | crates/op-chrome-extension-core/src/wasm_api.rs:233-251 | crates/op-chrome-extension-core/src/wasm_api.rs:592-610 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 15+ corresponding lines) crates/op-orchestrator/src/run_tests_d1.rs:106— crates/op-orchestrator/src/run_tests_d1.rs:106-121 | crates/op-orchestrator/src/run_tests_fresh_plan.rs:7-21 | crates/op-orchestrator/src/run_tests_planning_retry.rs:221-235 | crates/op-orchestrator/src/run_tests_screen_groups.rs:26-41 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 5+ corresponding lines) · ×4
Edited copies of one member (3 members, 5+ corresponding lines) templates/step0/_generators/appkit.py:104— templates/step0/_generators/appkit.py:104-110 | templates/step0/_generators/appkit.py:114-120 | templates/step0/_generators/tpl_infographic_blank_vs_example.py:148-152 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 5+ corresponding lines) crates/op-host-services/src/web_chat_standard_events.rs:25— crates/op-host-services/src/web_chat_standard_events.rs:25-34 | crates/op-host-services/src/web_chat_standard_quality.rs:38-42 | crates/op-host-services/src/web_chat_standard_variants.rs:58-62 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 5+ corresponding lines) crates/op-collab-relay-protocol/src/challenge.rs:72— crates/op-collab-relay-protocol/src/challenge.rs:72-76 | crates/op-collab-relay-protocol/src/pairing.rs:258-262 | crates/op-collab-relay-protocol/src/sensitive.rs:26-30 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 5+ corresponding lines) crates/op-editor-ui/src/widgets/figma_import.rs:390— crates/op-editor-ui/src/widgets/figma_import.rs:390-394 | crates/op-editor-ui/src/widgets/figma_import_progress.rs:169-174 | crates/op-editor-ui/src/widgets/missing_fonts_panel.rs:544-548 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 4+ corresponding lines) · ×4
Edited copies of one member (4 members, 4+ corresponding lines) crates/op-editor-ui/src/widgets/ai_chat_style_card.rs:205— crates/op-editor-ui/src/widgets/ai_chat_style_card.rs:205-211 | crates/op-editor-ui/src/widgets/ai_chat_style_receipt.rs:93-96 | crates/op-editor-ui/src/widgets/asset_center_style_cards.rs:154-157 | crates/op-editor-ui/src/widgets/scene_template_card_paint.rs:653-656 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 4+ corresponding lines) crates/op-editor-ui/src/widgets/canvas_viewport_widget.rs:594— crates/op-editor-ui/src/widgets/canvas_viewport_widget.rs:594-608 | crates/op-editor-ui/src/widgets/home_surface_paint_cards.rs:36-39 | crates/op-editor-ui/src/widgets/workspace_quality_paint.rs:21-24 | crates/op-editor-ui/src/widgets/workspace_surface_paint.rs:21-24 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 4+ corresponding lines) crates/op-editor-core/src/path_bounds.rs:106— crates/op-editor-core/src/path_bounds.rs:106-109 | crates/op-editor-core/src/svg_path_bounds.rs:108-111 | crates/op-editor-core/src/svg_path_data.rs:331-334 | crates/op-preview-core/src/animation.rs:409-412 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 4+ corresponding lines) crates/op-preview-core/src/tests_app_mode.rs:219— crates/op-preview-core/src/tests_app_mode.rs:219-222 | crates/op-preview-core/src/tests_swipe.rs:73-76 | crates/op-preview-core/src/tests_transition.rs:22-25 | crates/op-preview-core/src/tests_transition_input.rs:37-40 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Duplicated block (24 lines × 2) crates/op-chrome-extension-core/src/op_export.rs:76— crates/op-chrome-extension-core/src/op_export.rs:76-99 | crates/op-cli/src/html_cli.rs:264-287 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (24 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_builtin_model_menu.rs:432— crates/op-editor-ui/src/widgets/agent_settings_builtin_model_menu.rs:432-455 | crates/op-editor-ui/src/widgets/agent_settings_builtin_parts.rs:459-482 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/agent_settings_builtin_model_menu.rs:432` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24 lines × 2) crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs:448— crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs:448-471 | crates/op-editor-ui/src/widgets/home_surface_paint_panels.rs:193-216 — before extracting anything, compare `crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs` and `crates/op-editor-ui/src/widgets/home_surface_paint_panels.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 197 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs:448` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24 lines × 2) crates/op-host-native/src/widget_host/variables_panel_row_press.rs:298— crates/op-host-native/src/widget_host/variables_panel_row_press.rs:298-321 | crates/op-host-web/src/widget_host/variables_panel_rows.rs:252-275 — before extracting anything, compare `crates/op-host-native/src/widget_host/variables_panel_row_press.rs` and `crates/op-host-web/src/widget_host/variables_panel_rows.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13–17 lines × 2) crates/op-host-desktop/src/app_state.rs:555— crates/op-host-desktop/src/app_state.rs:555-567 | crates/op-host-desktop/src/app_state.rs:589-605 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-desktop/src/app_state.rs:555` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `crate) fn confirm_document_reload(&mut` in one and `crate) fn confirm_close(&mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (13–17 lines × 2) crates/op-host-native/src/widget_host/workspace.rs:742— crates/op-host-native/src/widget_host/workspace.rs:742-758 | crates/op-host-web/src/widget_host/studio_workspace_run.rs:291-303 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-native/src/widget_host/workspace.rs:742` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–17 lines × 2) templates/step0/_generators/tpl_tutorial_carousel.py:362— templates/step0/_generators/tpl_tutorial_carousel.py:362-374 | templates/step0/_generators/tpl_yearreview_carousel.py:508-524 — 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 `templates/step0/_generators/tpl_tutorial_carousel.py:362` it does not close everything it opens, so those exact lines 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–17 lines × 2) packaging/ios/Sources/AuthCodeFormViewController.swift:164— packaging/ios/Sources/AuthCodeFormViewController.swift:164-180 | packaging/ios/Sources/NativeLoginViewController.swift:187-199 — 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 `packaging/ios/Sources/NativeLoginViewController.swift:187` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–16 lines × 2) crates/op-figma/src/instance/assignment.rs:52— crates/op-figma/src/instance/assignment.rs:52-67 | crates/op-figma/src/instance/assignment.rs:128-142 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-figma/src/instance/assignment.rs:52` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–16 lines × 2) crates/op-mcp/src/script_runner.rs:659— crates/op-mcp/src/script_runner.rs:659-673 | crates/op-orchestrator/src/parse.rs:74-89 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (15–16 lines × 2) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AccountCenterOverlay.kt:149— packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AccountCenterOverlay.kt:149-163 | packaging/android/app/src/main/kotlin/tech/zseven/openpencil/NativeLoginOverlay.kt:328-343 — 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 `packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AccountCenterOverlay.kt:149` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15–16 lines × 2) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AuthCodeFormOverlay.kt:120— packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AuthCodeFormOverlay.kt:120-135 | packaging/android/app/src/main/kotlin/tech/zseven/openpencil/NativeLoginOverlay.kt:207-221 — before extracting anything, compare `packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AuthCodeFormOverlay.kt` and `packaging/android/app/src/main/kotlin/tech/zseven/openpencil/NativeLoginOverlay.kt` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AuthCodeFormOverlay.kt: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 (11–14 lines × 2) crates/op-editor-ui/src/widgets/canvas_viewport_widget.rs:319— crates/op-editor-ui/src/widgets/canvas_viewport_widget.rs:319-329 | crates/op-editor-ui/src/widgets/canvas_viewport_widget.rs:436-449 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–14 lines × 2) crates/op-editor-ui/src/widgets/prompt_center_panel_paint.rs:432— crates/op-editor-ui/src/widgets/prompt_center_panel_paint.rs:432-442 | crates/op-editor-ui/src/widgets/scene_template_card_paint.rs:172-185 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/prompt_center_panel_paint.rs:432` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11–14 lines × 2) crates/op-host-web/src/widget_host/studio_home_send.rs:103— crates/op-host-web/src/widget_host/studio_home_send.rs:103-116 | crates/op-host-web/src/widget_host/studio_home_send.rs:300-310 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–14 lines × 2) templates/step0/_generators/tpl_infographic_blank_vs_example.py:247— templates/step0/_generators/tpl_infographic_blank_vs_example.py:247-257 | templates/step0/_generators/tpl_infographic_concept.py:269-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.
Duplicated block (9–13 lines × 2) crates/op-editor-core/src/instance_override.rs:119— crates/op-editor-core/src/instance_override.rs:119-127 | crates/op-editor-core/src/ref_resolve.rs:241-253 — before extracting anything, compare `crates/op-editor-core/src/instance_override.rs` and `crates/op-editor-core/src/ref_resolve.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/instance_override.rs:119` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–13 lines × 2) crates/op-editor-host-core/src/codegen_runtime_state.rs:44— crates/op-editor-host-core/src/codegen_runtime_state.rs:44-56 | crates/op-host-web/src/codegen_web.rs:151-159 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-host-core/src/codegen_runtime_state.rs:44` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–13 lines × 2) crates/op-editor-ui/src/widgets/canvas_viewport_text.rs:162— crates/op-editor-ui/src/widgets/canvas_viewport_text.rs:162-170 | crates/op-editor-ui/src/widgets/canvas_viewport_text.rs:430-442 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/canvas_viewport_text.rs:162` it does not close everything it opens, so those exact lines 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) crates/op-orchestrator/src/cleanup_section_margins.rs:226— crates/op-orchestrator/src/cleanup_section_margins.rs:226-234 | crates/op-orchestrator/src/cleanup_slide_padding.rs:296-308 — before extracting anything, compare `crates/op-orchestrator/src/cleanup_section_margins.rs` and `crates/op-orchestrator/src/cleanup_slide_padding.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (11 lines × 4) crates/op-editor-ui/src/widgets/property_panel_fill.rs:530— crates/op-editor-ui/src/widgets/property_panel_fill.rs:530-540 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:202-212 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:325-336 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:391-401 — before extracting anything, compare `crates/op-editor-ui/src/widgets/property_panel_fill.rs` and `crates/op-editor-ui/src/widgets/property_panel_fill_body.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 109 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:325` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 lines × 4) crates/op-preview-core/src/present.rs:281— crates/op-preview-core/src/present.rs:281-291 | crates/op-preview-core/src/session_paint.rs:55-65 | crates/op-preview-core/src/session_paint.rs:115-125 | crates/op-preview-core/src/transition.rs:327-337 — before extracting anything, compare `crates/op-preview-core/src/present.rs` and `crates/op-preview-core/src/session_paint.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-preview-core/src/present.rs:281` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-preview-core/src/present.rs:280` calls `has_preview_widget_visuals` and `crates/op-preview-core/src/session_paint.rs:54` 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 × 4) crates/op-orchestrator/src/board_trailing_void.rs:127— crates/op-orchestrator/src/board_trailing_void.rs:127-137 | crates/op-orchestrator/src/cleanup_section_margins.rs:281-291 | crates/op-orchestrator/src/cleanup_slide_padding.rs:421-431 | crates/op-orchestrator/src/geometry_validation.rs:165-175 — before extracting anything, compare `crates/op-orchestrator/src/cleanup_section_margins.rs` and `crates/op-orchestrator/src/cleanup_slide_padding.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 4) templates/step0/_generators/tpl_cityguide_carousel.py:438— templates/step0/_generators/tpl_cityguide_carousel.py:438-448 | templates/step0/_generators/tpl_opinion_carousel.py:413-426 | templates/step0/_generators/tpl_story_carousel.py:431-443 | templates/step0/_generators/tpl_yearreview_carousel.py:544-554 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. 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–9 lines × 2) crates/op-ai/src/chat_tool_sse.rs:98— crates/op-ai/src/chat_tool_sse.rs:98-106 | crates/op-hosted-models/src/stream_protocol.rs:81-88 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8–9 lines × 2) crates/op-chat-agent/src/design_agent_tools.rs:412— crates/op-chat-agent/src/design_agent_tools.rs:412-419 | crates/op-host-desktop/src/design_session.rs:63-71 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8–9 lines × 2) crates/op-editor-ui/src/widgets/property_panel_inputs.rs:252— crates/op-editor-ui/src/widgets/property_panel_inputs.rs:252-260 | crates/op-editor-ui/src/widgets/property_panel_inputs.rs:354-361 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/property_panel_inputs.rs:252` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8–9 lines × 2) crates/op-host-services/src/design_md_llm.rs:73— crates/op-host-services/src/design_md_llm.rs:73-80 | crates/op-orchestrator/src/design_system.rs:381-389 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-services/src/design_md_llm.rs:73` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (4–5 lines × 3) crates/op-editor-core/src/command_style_replace.rs:434— crates/op-editor-core/src/command_style_replace.rs:434-438 | crates/op-editor-core/src/fills/access.rs:175-179 | crates/op-orchestrator/src/variable_binding.rs:366-369 — before extracting anything, compare `crates/op-editor-core/src/fills/access.rs` and `crates/op-orchestrator/src/variable_binding.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/command_style_replace.rs:434` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-editor-core/src/command_style_replace.rs:432` calls `RadioGroup`, `as_mut`, `NumberInput` and `crates/op-orchestrator/src/variable_binding.rs:366` 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–5 lines × 3) crates/op-editor-core/src/scene_vars.rs:280— crates/op-editor-core/src/scene_vars.rs:280-283 | crates/op-editor-core/src/scene_vars.rs:366-370 | crates/op-editor-core/src/variables.rs:97-101 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/scene_vars.rs:366` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-editor-core/src/scene_vars.rs:366` calls `Some`, `iter`, `all` and `crates/op-editor-core/src/scene_vars.rs:280` 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 (4–5 lines × 3) crates/op-editor-ui/src/widgets/ai_chat_mcp_notice.rs:87— crates/op-editor-ui/src/widgets/ai_chat_mcp_notice.rs:87-91 | crates/op-editor-ui/src/widgets/panel_control_metrics.rs:116-119 | crates/op-preview-core/src/mode_transition.rs:186-190 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/ai_chat_mcp_notice.rs:87` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `from` to `Color` in one and `op_editor_ui::Color` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (4–5 lines × 3) crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:178— crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:178-182 | crates/op-orchestrator/src/cleanup_desktop_dashboard.rs:215-219 | crates/op-orchestrator/src/cleanup_mobile_dense.rs:239-242 — before extracting anything, compare `crates/op-orchestrator/src/cleanup_desktop_dashboard.rs` and `crates/op-orchestrator/src/cleanup_mobile_dense.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:178` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:176` calls `Progress`, `as_ref`, `Tabs` and `crates/op-orchestrator/src/cleanup_mobile_dense.rs:239` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2 locations) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:9— crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:9 · crates/op-host-web/src/op_ck_bridge.js:9 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (10 lines × 2 locations) crates/op-html/assets/snapshot-extractor.js:420— crates/op-html/assets/snapshot-extractor.js:420 · crates/op-html/assets/snapshot-extractor.js:765 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2 locations) packages/op-chrome-extension/client.js:94— packages/op-chrome-extension/client.js:94 · packages/op-chrome-extension/client.js:452 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (10 lines × 2 locations) packages/op-vscode/src/vscode/shell-messages.ts:36— packages/op-vscode/src/vscode/shell-messages.ts:36 · packages/op-vscode/src/vscode/shell-messages.ts:87 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2 locations) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:151— crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:151 · crates/op-host-web/src/op_ck_bridge.js:544 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (9 lines × 2 locations) crates/op-html/assets/snapshot-extractor.js:1071— crates/op-html/assets/snapshot-extractor.js:1071 · crates/op-html/assets/snapshot-extractor.js:1132 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2 locations) packages/op-chrome-extension/account.js:130— packages/op-chrome-extension/account.js:130 · packages/op-chrome-extension/client.js:432 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (9 lines × 2 locations) packages/op-chrome-extension/background.js:178— packages/op-chrome-extension/background.js:178 · packages/op-chrome-extension/design-md.js:34 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
AC1 · Text alternatives· <canvas> without a text alternative · ×3
<canvas> without a text alternative crates/op-host-services/src/web_static/index.html:45— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative crates/op-host-web/smoke/step-1b.html:37— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
<canvas> without a text alternative crates/op-web-sdk/smoke/index.html:22— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
AC3 · Page structure· Page without a main landmark · ×3
Page without a main landmark crates/op-host-services/src/web_static/missing_bundle.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark crates/op-web-sdk/smoke/index.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark packages/op-chrome-extension/popup.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
GitPanel::hit_test (cyclomatic 56) crates/op-editor-ui/src/widgets/git_panel_hit.rs:14— GitPanel::hit_test has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GitPanel::paint (cyclomatic 26) crates/op-editor-ui/src/widgets/git_panel/paint.rs:12— GitPanel::paint 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.
GitPanel::ready_hit (cyclomatic 21) crates/op-editor-ui/src/widgets/git_panel_ready.rs:686— GitPanel::ready_hit 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.
CollabPanel::paint (cyclomatic 40) crates/op-editor-ui/src/widgets/collab_panel.rs:122— CollabPanel::paint 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.
CollabPanel::hit_test (cyclomatic 25) crates/op-editor-ui/src/widgets/collab_panel_interaction.rs:11— CollabPanel::hit_test 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.
CollabPanel::hover_at (cyclomatic 22) crates/op-editor-ui/src/widgets/collab_panel_interaction.rs:115— CollabPanel::hover_at 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.
op_collab_host::runtime::network::connection::drive_guest (cyclomatic 34) crates/op-collab-host/src/runtime/network/connection.rs:188— op_collab_host::runtime::network::connection::drive_guest 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.
op_collab_host::runtime::network::owner::run_inner (cyclomatic 33) crates/op-collab-host/src/runtime/network/owner.rs:67— op_collab_host::runtime::network::owner::run_inner 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.
op_collab_host::runtime::network::connection::drive_owner_peer (cyclomatic 29) crates/op-collab-host/src/runtime/network/connection.rs:41— op_collab_host::runtime::network::connection::drive_owner_peer 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.
op_codegen::codegen_tailwind_shadcn::emit (cyclomatic 33) crates/op-codegen/src/codegen_tailwind_shadcn.rs:230— op_codegen::codegen_tailwind_shadcn::emit has cyclomatic complexity 33 (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.
op_codegen::codegen_tailwind_widgets::emit (cyclomatic 19) crates/op-codegen/src/codegen_tailwind_widgets.rs:52— op_codegen::codegen_tailwind_widgets::emit has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_codegen::codegen_html::emit_node_html (cyclomatic 18) crates/op-codegen/src/codegen_html.rs:40— op_codegen::codegen_html::emit_node_html 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.
op_editor_host_core::settings_io::apply_payload_with_options (cyclomatic 25) crates/op-editor-host-core/src/settings_io.rs:320— op_editor_host_core::settings_io::apply_payload_with_options 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.
op_editor_host_core::codegen_session::run_pipeline_with_model_and_cancel_token (cyclomatic 23) crates/op-editor-host-core/src/codegen_session.rs:280— op_editor_host_core::codegen_session::run_pipeline_with_model_and_cancel_token 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.
op_editor_host_core::codegen_runtime_state::pump_codegen_state (cyclomatic 16) crates/op-editor-host-core/src/codegen_runtime_state.rs:103— op_editor_host_core::codegen_runtime_state::pump_codegen_state 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.
TopBar::button_rect_with_measure (cyclomatic 24) crates/op-editor-ui/src/widgets/top_bar_geometry.rs:359— TopBar::button_rect_with_measure 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.
TopBar::hit_test_with_git_rect (cyclomatic 23) crates/op-editor-ui/src/widgets/top_bar.rs:401— TopBar::hit_test_with_git_rect 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.
TopBar::paint_chrome (cyclomatic 23) crates/op-editor-ui/src/widgets/top_bar_paint.rs:17— TopBar::paint_chrome 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.
AIChatPlaceholder::hit_test_with_canonical (cognitive 145) crates/op-editor-ui/src/widgets/ai_chat_panel_hit.rs:63— AIChatPlaceholder::hit_test_with_canonical has cognitive complexity 145 (threshold 15). Drivers by points: if/else 57 (124 pts), boolean chains 13, loops 2 (6 pts), match/switch 1 (2 pts) (nesting depth added 72). 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.
AIChatPlaceholder::paint (cognitive 40) crates/op-editor-ui/src/widgets/ai_chat_panel/widget_paint.rs:23— AIChatPlaceholder::paint has cognitive complexity 40 (threshold 15). Drivers by points: if/else 26 (33 pts), boolean chains 7 (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.
AIChatPlaceholder::footer_hover_at (cognitive 22) crates/op-editor-ui/src/widgets/ai_chat_panel_hit.rs:591— AIChatPlaceholder::footer_hover_at has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 7 (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.
LayerPanel::paint (cognitive 87) crates/op-editor-ui/src/widgets/layer_panel.rs:394— LayerPanel::paint has cognitive complexity 87 (threshold 15). Drivers by points: if/else 49 (77 pts), boolean chains 6, loops 2, match/switch 1 (2 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LayerPanel::hit_test (cognitive 24) crates/op-editor-ui/src/widgets/layer_panel_hit.rs:117— LayerPanel::hit_test has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (19 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.
LayerPanel::drop_target_at (cognitive 18) crates/op-editor-ui/src/widgets/layer_panel_hit.rs:45— LayerPanel::drop_target_at has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CollabPanel::paint (cognitive 85) crates/op-editor-ui/src/widgets/collab_panel.rs:122— CollabPanel::paint has cognitive complexity 85 (threshold 15). Drivers by points: if/else 36 (72 pts), loops 5 (10 pts), boolean chains 2, match/switch 1 (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CollabPanel::hit_test (cognitive 47) crates/op-editor-ui/src/widgets/collab_panel_interaction.rs:11— CollabPanel::hit_test has cognitive complexity 47 (threshold 15). Drivers by points: if/else 17 (38 pts), loops 4 (8 pts), match/switch 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CollabPanel::hover_at (cognitive 35) crates/op-editor-ui/src/widgets/collab_panel_interaction.rs:115— CollabPanel::hover_at has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 3 (7 pts), boolean chains 1, match/switch 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TopBar::paint_chrome (cognitive 43) crates/op-editor-ui/src/widgets/top_bar_paint.rs:17— TopBar::paint_chrome has cognitive complexity 43 (threshold 15). Drivers by points: if/else 18 (33 pts), match/switch 2 (5 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TopBar::hit_test_with_git_rect (cognitive 26) crates/op-editor-ui/src/widgets/top_bar.rs:401— TopBar::hit_test_with_git_rect has cognitive complexity 26 (threshold 15). Drivers by points: if/else 19 (23 pts), boolean chains 2, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
TopBar::button_rect_with_measure (cognitive 20) crates/op-editor-ui/src/widgets/top_bar_geometry.rs:359— TopBar::button_rect_with_measure has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 1, match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
op_collab_relay_server::connection::relay_paired (cognitive 39) crates/op-collab-relay-server/src/connection.rs:477— op_collab_relay_server::connection::relay_paired has cognitive complexity 39 (threshold 15). Drivers by points: if/else 8 (29 pts), match/switch 3 (8 pts), boolean chains 1, loops 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_collab_relay_server::connection::serve_connection (cognitive 23) crates/op-collab-relay-server/src/connection.rs:92— op_collab_relay_server::connection::serve_connection has cognitive complexity 23 (threshold 15). Drivers by points: match/switch 11 (13 pts), if/else 8 (9 pts), boolean chains 1 (nesting depth added 3). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
op_collab_relay_server::connection_wait::wait_for_pair (cognitive 20) crates/op-collab-relay-server/src/connection_wait.rs:33— op_collab_relay_server::connection_wait::wait_for_pair has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (10 pts), match/switch 3 (8 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PreviewMotionState::observe_transitions (cognitive 30) crates/op-preview-core/src/motion.rs:130— PreviewMotionState::observe_transitions has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PreviewMotionState::start_node_animation (cognitive 25) crates/op-preview-core/src/motion.rs:417— PreviewMotionState::start_node_animation has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 3 (4 pts), match/switch 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.
PreviewMotionState::observe_in_view (cognitive 23) crates/op-preview-core/src/motion.rs:280— PreviewMotionState::observe_in_view has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (20 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.
D4 · Code Duplication· Members sharing a duplicated core (9 members, 50+ identical tokens) · ×3
Members sharing a duplicated core (9 members, 50+ identical tokens) crates/op-host-desktop/src/git_jobs.rs:94— crates/op-host-desktop/src/git_jobs.rs:94-107 | crates/op-host-desktop/src/git_jobs.rs:206-221 | crates/op-host-desktop/src/git_jobs.rs:244-263 | crates/op-host-desktop/src/git_jobs.rs:288-301 | crates/op-host-desktop/src/git_jobs.rs:344-357 | crates/op-host-desktop/src/iconify_host.rs:66-79 | crates/op-host-desktop/src/update_check.rs:102-115 | crates/op-host-services/src/acp_agent_probe_host.rs:106-121 | crates/op-host-services/src/provider_probe_host.rs:68-81 — These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
Members sharing a duplicated core (9 members, 50+ identical tokens) crates/op-orchestrator/src/category_grid_reflow.rs:119— crates/op-orchestrator/src/category_grid_reflow.rs:119-179 | crates/op-orchestrator/src/geometry_bottom_gap.rs:81-118 | crates/op-orchestrator/src/geometry_validation.rs:275-298 | crates/op-orchestrator/src/geometry_validation.rs:495-518 | crates/op-orchestrator/src/radial_repair_sink.rs:27-47 | crates/op-orchestrator/src/sidebar_archetype.rs:17-34 | crates/op-orchestrator/src/square_ring_repair.rs:26-50 | crates/op-orchestrator/src/stacked_text_repair.rs:25-48 | crates/op-orchestrator/src/stub_repair.rs:9-32 — These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
Members sharing a duplicated core (9 members, 50+ identical tokens) templates/step0/_generators/tpl_infographic_challenge.py:247— templates/step0/_generators/tpl_infographic_challenge.py:247-265 | templates/step0/_generators/tpl_infographic_concept.py:299-317 | templates/step0/_generators/tpl_infographic_data.py:290-305 | templates/step0/_generators/tpl_infographic_faq.py:237-251 | templates/step0/_generators/tpl_infographic_map.py:246-264 | templates/step0/_generators/tpl_infographic_ranking.py:273-287 | templates/step0/_generators/tpl_infographic_steps.py:221-233 | templates/step0/_generators/tpl_infographic_timeline.py:268-286 | templates/step0/_generators/tpl_infographic_weekly_review.py:321-339 — These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×3
Members sharing a duplicated core (6 members, 50+ identical tokens) crates/op-design-lint/src/node_util.rs:382— crates/op-design-lint/src/node_util.rs:382-406 | crates/op-orchestrator/src/validation_dump.rs:213-238 | crates/op-orchestrator/src/validation_dump.rs:362-391 | crates/op-pen-loader/src/adapter/geometry.rs:21-45 | crates/op-pen-loader/src/authored_geometry.rs:79-103 | crates/op-pen-loader/src/layout_repair.rs:731-755 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) crates/op-orchestrator/src/absolute_child_clamp.rs:169— crates/op-orchestrator/src/absolute_child_clamp.rs:169-192 | crates/op-orchestrator/src/absolute_child_clamp.rs:311-334 | crates/op-orchestrator/src/chip_label_adopt.rs:59-97 | crates/op-orchestrator/src/none_stack_inset.rs:24-47 | crates/op-orchestrator/src/section_shell_fill_repair.rs:144-171 | crates/op-orchestrator/src/text_fit.rs:200-239 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) templates/step0/_generators/tpl_cards.py:84— templates/step0/_generators/tpl_cards.py:84-95 | templates/step0/_generators/tpl_journal_card.py:191-201 | templates/step0/_generators/tpl_lecture_light.py:155-165 | templates/step0/_generators/tpl_pitch_dark.py:143-153 | templates/step0/_generators/tpl_quote_card.py:89-99 | templates/step0/_generators/tpl_quote_card.py:103-116 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication· Edited copy of a member (42 corresponding lines) · ×3
Edited copy of a member (42 corresponding lines) crates/op-editor-ui/src/widgets/drag_flow.rs:444— crates/op-editor-ui/src/widgets/drag_flow.rs:444-494 | crates/op-editor-ui/src/widgets/drag_flow_index.rs:343-384 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (42 corresponding lines) crates/op-cli/src/command_mappers.rs:212— crates/op-cli/src/command_mappers.rs:212-253 | crates/op-cli/src/command_mappers.rs:258-310 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (42 corresponding lines) crates/op-chat-agent/src/design_agent_diagnostics.rs:521— crates/op-chat-agent/src/design_agent_diagnostics.rs:521-562 | crates/op-image-enrich/src/targets.rs:685-745 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 23+ corresponding lines) · ×3
Edited copies of one member (3 members, 23+ corresponding lines) crates/op-editor-core/src/command_node_attrs/slots.rs:111— crates/op-editor-core/src/command_node_attrs/slots.rs:111-133 | crates/op-editor-core/src/fills/access.rs:64-86 | crates/op-orchestrator/src/variable_binding.rs:376-398 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 23+ corresponding lines) crates/op-mcp/src/batch_get.rs:351— crates/op-mcp/src/batch_get.rs:351-373 | crates/op-mcp/src/read_nodes.rs:168-194 | crates/op-mcp/src/style_ops_tools.rs:349-374 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 23+ corresponding lines) templates/step0/_generators/tpl_bookreview_carousel.py:382— templates/step0/_generators/tpl_bookreview_carousel.py:382-405 | templates/step0/_generators/tpl_story_carousel.py:315-337 | templates/step0/_generators/tpl_tutorial_carousel.py:435-459 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (41 corresponding lines) · ×3
Edited copy of a member (41 corresponding lines) crates/op-figma/src/node_mapper.rs:109— crates/op-figma/src/node_mapper.rs:109-155 | crates/op-figma/src/node_mapper.rs:179-219 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (41 corresponding lines) crates/op-editor-ui/src/widgets/agent_settings_images/paint.rs:273— crates/op-editor-ui/src/widgets/agent_settings_images/paint.rs:273-314 | crates/op-editor-ui/src/widgets/agent_settings_images/paint.rs:402-442 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (41 corresponding lines) templates/step0/_generators/tpl_poster_city_music_fest.py:186— templates/step0/_generators/tpl_poster_city_music_fest.py:186-233 | templates/step0/_generators/tpl_poster_city_music_fest.py:238-278 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (59 corresponding lines) · ×3
Edited copy of a member (59 corresponding lines) crates/op-html/src/css/declaration_syntax.rs:215— crates/op-html/src/css/declaration_syntax.rs:215-285 | crates/op-html/src/mapper_visual_syntax.rs:88-146 — These two members are one piece of code written twice and then edited apart: 59 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (59 corresponding lines) crates/op-editor-core/src/scene_vars.rs:243— crates/op-editor-core/src/scene_vars.rs:243-324 | crates/op-editor-core/src/scene_vars.rs:334-392 — These two members are one piece of code written twice and then edited apart: 59 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (59 corresponding lines) packaging/ios/Sources/DocumentExportCoordinator.swift:25— packaging/ios/Sources/DocumentExportCoordinator.swift:25-84 | packaging/ios/Sources/DocumentSaveCoordinator.swift:67-125 — These two members are one piece of code written twice and then edited apart: 59 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (43 corresponding lines) · ×3
Edited copy of a member (43 corresponding lines) crates/op-host-desktop/src/font_import_host.rs:37— crates/op-host-desktop/src/font_import_host.rs:37-79 | crates/op-host-desktop/src/font_import_host.rs:83-126 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (43 corresponding lines) crates/op-mcp/src/scalar_vars.rs:223— crates/op-mcp/src/scalar_vars.rs:223-273 | crates/op-mcp/src/scalar_vars.rs:336-378 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (43 corresponding lines) crates/op-orchestrator/src/cleanup_desktop_dashboard.rs:34— crates/op-orchestrator/src/cleanup_desktop_dashboard.rs:34-76 | crates/op-orchestrator/src/cleanup_mobile_dense.rs:28-74 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (31 corresponding lines) · ×3
Edited copy of a member (31 corresponding lines) crates/op-mcp/src/insert_node_args.rs:152— crates/op-mcp/src/insert_node_args.rs:152-182 | crates/op-mcp/src/write_tools.rs:374-404 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) crates/op-host-web/src/widget_host/keyboard_edit_ops.rs:499— crates/op-host-web/src/widget_host/keyboard_edit_ops.rs:499-529 | crates/op-host-web/src/widget_host/keyboard_edit_ops.rs:531-561 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) crates/op-host-services/src/model_discovery.rs:331— crates/op-host-services/src/model_discovery.rs:331-361 | crates/op-orchestrator/src/plan.rs:208-239 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 9+ corresponding lines) · ×3
Edited copies of one member (4 members, 9+ corresponding lines) crates/op-chrome-extension-core/src/design_md_palette.rs:205— crates/op-chrome-extension-core/src/design_md_palette.rs:205-223 | crates/op-chrome-extension-core/src/design_md_palette.rs:225-233 | crates/op-host-services/src/design_md_evidence_normalize.rs:77-93 | crates/op-host-services/src/design_md_evidence_roles.rs:116-129 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 9+ corresponding lines) crates/op-mcp/src/page_tools.rs:27— crates/op-mcp/src/page_tools.rs:27-35 | crates/op-mcp/src/page_tools.rs:210-218 | crates/op-mcp/src/page_tools.rs:341-349 | crates/op-mcp/src/page_tools.rs:391-399 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 9+ corresponding lines) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/DocumentSaveBridge.kt:47— packaging/android/app/src/main/kotlin/tech/zseven/openpencil/DocumentSaveBridge.kt:47-55 | packaging/android/app/src/main/kotlin/tech/zseven/openpencil/OpSurfaceViewShellBridge.kt:92-100 | packaging/android/app/src/main/kotlin/tech/zseven/openpencil/OpSurfaceViewShellBridge.kt:135-143 | packaging/android/app/src/main/kotlin/tech/zseven/openpencil/OpSurfaceViewShellBridge.kt:160-168 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 12+ corresponding lines) · ×3
Edited copies of one member (4 members, 12+ corresponding lines) templates/step0/_generators/tpl1.py:190— templates/step0/_generators/tpl1.py:190-201 | templates/step0/_generators/tpl2.py:171-186 | templates/step0/_generators/tpl3.py:105-120 | templates/step0/_generators/tpl_quote_card.py:120-147 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 12+ corresponding lines) packaging/ios/Sources/OpEngineHost+Auth.swift:65— packaging/ios/Sources/OpEngineHost+Auth.swift:65-77 | packaging/ios/Sources/OpEngineHost+Auth.swift:195-209 | packaging/ios/Sources/OpEngineHost+Auth.swift:225-241 | packaging/ios/Sources/OpEngineHost.swift:707-718 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 12+ corresponding lines) crates/op-chrome-extension-core/src/design_md_validate.rs:577— crates/op-chrome-extension-core/src/design_md_validate.rs:577-592 | crates/op-chrome-extension-core/src/design_md_validate.rs:598-609 | crates/op-host-services/src/mcp_live/design_md_output.rs:247-258 | crates/op-host-services/src/mcp_live/design_md_output.rs:260-272 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 6+ corresponding lines) · ×3
Edited copies of one member (4 members, 6+ corresponding lines) templates/step0/_generators/tpl_deck_banxin.py:549— templates/step0/_generators/tpl_deck_banxin.py:549-554 | templates/step0/_generators/tpl_deck_dossier.py:622-627 | templates/step0/_generators/tpl_deck_gridpaper.py:652-657 | templates/step0/_generators/tpl_deck_ledger.py:754-759 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 6+ corresponding lines) templates/step0/_generators/tpl_qa_carousel.py:185— templates/step0/_generators/tpl_qa_carousel.py:185-201 | templates/step0/_generators/tpl_story_carousel.py:165-175 | templates/step0/_generators/tpl_tutorial_carousel.py:162-167 | templates/step0/_generators/tpl_yearreview_carousel.py:219-224 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 6+ corresponding lines) crates/op-editor-core/src/quality_report/localize.rs:127— crates/op-editor-core/src/quality_report/localize.rs:127-132 | crates/op-editor-core/src/quality_report/topics.rs:210-215 | crates/op-editor-ui/src/widgets/icon_catalog_aliases.rs:11-16 | crates/op-editor-ui/src/widgets/slides_panel_tabs.rs:399-405 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 8+ corresponding lines) · ×3
Edited copies of one member (4 members, 8+ corresponding lines) templates/step0/_generators/deck_tidemark_slate.py:176— templates/step0/_generators/deck_tidemark_slate.py:176-186 | templates/step0/_generators/tpl1.py:59-66 | templates/step0/_generators/tpl2.py:79-86 | templates/step0/_generators/tpl3.py:46-53 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 8+ corresponding lines) templates/step0/_generators/tpl1.py:37— templates/step0/_generators/tpl1.py:37-46 | templates/step0/_generators/tpl2.py:60-67 | templates/step0/_generators/tpl_brand_concept_sheet.py:291-302 | templates/step0/_generators/tpl_minimal_keynote.py:66-75 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 8+ corresponding lines) crates/op-editor-ui/src/widgets/prop_row.rs:34— crates/op-editor-ui/src/widgets/prop_row.rs:34-41 | crates/op-editor-ui/src/widgets/text_input.rs:49-56 | crates/op-editor-ui/src/widgets/top_bar.rs:535-542 | crates/op-editor-ui/src/widgets/tree.rs:61-68 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 5+ corresponding lines) · ×3
Edited copies of one member (4 members, 5+ corresponding lines) templates/step0/_generators/tpl_gradient_tech.py:133— templates/step0/_generators/tpl_gradient_tech.py:133-143 | templates/step0/_generators/tpl_pitch_dark.py:97-101 | templates/step0/_generators/tpl_quote_card.py:151-157 | templates/step0/_generators/tpl_slides.py:81-92 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 5+ corresponding lines) templates/step0/_generators/tpl_cards.py:76— templates/step0/_generators/tpl_cards.py:76-80 | templates/step0/_generators/tpl_journal_card.py:114-119 | templates/step0/_generators/tpl_minimal_keynote.py:88-92 | templates/step0/_generators/tpl_quote_card.py:81-85 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 5+ corresponding lines) crates/op-cli/src/brand_cli.rs:24— crates/op-cli/src/brand_cli.rs:24-29 | crates/op-host-desktop/src/html_import_session.rs:147-151 | crates/op-host-desktop/src/legacy_op_upgrade.rs:205-209 | crates/op-host-services/src/doc_io.rs:336-340 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (2 corresponding lines) · ×3
Edited copy of a member (2 corresponding lines) templates/step0/_generators/deck_sounding_navy.py:167— templates/step0/_generators/deck_sounding_navy.py:167-175 | templates/step0/_generators/deck_tidemark_slate.py:148-149 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (2 corresponding lines) templates/step0/_generators/tpl_app_budget_ledger.py:89— templates/step0/_generators/tpl_app_budget_ledger.py:89-91 | templates/step0/_generators/tpl_app_habit_fitness.py:74-75 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (2 corresponding lines) templates/step0/_generators/tpl_app_coffee_counter.py:73— templates/step0/_generators/tpl_app_coffee_counter.py:73-74 | templates/step0/_generators/tpl_app_sales_dashboard.py:80-81 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (3 corresponding lines) · ×3
Edited copy of a member (3 corresponding lines) crates/op-chat-agent/src/design_agent_diagnostics.rs:467— crates/op-chat-agent/src/design_agent_diagnostics.rs:467-472 | crates/op-orchestrator/src/motion_recipes.rs:227-229 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) crates/op-orchestrator/src/geometry_interaction_backfill.rs:354— crates/op-orchestrator/src/geometry_interaction_backfill.rs:354-359 | crates/op-orchestrator/src/sidebar_archetype.rs:386-388 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (3 corresponding lines) crates/op-render-export/src/pdf.rs:179— crates/op-render-export/src/pdf.rs:179-181 | crates/op-render-export/src/svg.rs:32-34 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (31 lines × 2) crates/op-editor-host-core/src/settings_io.rs:382— crates/op-editor-host-core/src/settings_io.rs:382-412 | crates/op-host-web/src/web_settings.rs:463-493 — 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 (31 lines × 2) crates/op-html/src/css/declaration_syntax.rs:172— crates/op-html/src/css/declaration_syntax.rs:172-202 | crates/op-html/src/css/declaration_syntax.rs:288-318 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-html/src/css/declaration_syntax.rs:172` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (31 lines × 2) crates/op-orchestrator/src/mobile_content_rail.rs:87— crates/op-orchestrator/src/mobile_content_rail.rs:87-117 | crates/op-orchestrator/src/mobile_content_rail.rs:119-149 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-orchestrator/src/mobile_content_rail.rs:87` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (28 lines × 2) crates/op-host-native/src/widget_host/workspace.rs:335— crates/op-host-native/src/widget_host/workspace.rs:335-362 | crates/op-host-web/src/widget_host/studio_workspace.rs:250-277 — before extracting anything, compare `crates/op-host-native/src/widget_host/workspace.rs` and `crates/op-host-web/src/widget_host/studio_workspace.rs` 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (28 lines × 2) crates/op-host-web/src/dom_io/browser_files.rs:68— crates/op-host-web/src/dom_io/browser_files.rs:68-95 | crates/op-host-web/src/dom_io/browser_files.rs:136-163 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-web/src/dom_io/browser_files.rs:68` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (28 lines × 2) crates/op-mcp/src/script_runner.rs:519— crates/op-mcp/src/script_runner.rs:519-546 | crates/op-mcp/src/script_runner.rs:572-599 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-mcp/src/script_runner.rs:519` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 2) crates/op-cli/src/html_cli.rs:153— crates/op-cli/src/html_cli.rs:153-174 | crates/op-cli/src/html_cli.rs:181-202 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-cli/src/html_cli.rs:153` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 2) crates/op-collab-host/src/runtime/network/connection.rs:153— crates/op-collab-host/src/runtime/network/connection.rs:153-174 | crates/op-collab-host/src/runtime/network/connection.rs:320-341 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-collab-host/src/runtime/network/connection.rs:153` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 2) crates/op-host-services/src/import_html_url.rs:267— crates/op-host-services/src/import_html_url.rs:267-288 | crates/op-host-services/src/web_credentials.rs:217-238 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (15–17 lines × 2) crates/op-collab-transport/src/driver.rs:421— crates/op-collab-transport/src/driver.rs:421-435 | crates/op-collab-transport/src/driver.rs:504-520 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-collab-transport/src/driver.rs:504` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15–17 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_images_parts.rs:120— crates/op-editor-ui/src/widgets/agent_settings_images_parts.rs:120-134 | crates/op-editor-ui/src/widgets/agent_settings_images_parts.rs:151-167 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/agent_settings_images_parts.rs:120` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–17 lines × 2) crates/op-host-web/src/preview_pump.rs:58— crates/op-host-web/src/preview_pump.rs:58-72 | crates/op-host-web/src/tooltip_pump.rs:42-58 — before extracting anything, compare `crates/op-host-web/src/preview_pump.rs` and `crates/op-host-web/src/tooltip_pump.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-web/src/preview_pump.rs:58` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14–17 lines × 2) crates/op-editor-core/src/svg_import/path_data.rs:37— crates/op-editor-core/src/svg_import/path_data.rs:37-53 | crates/op-editor-core/src/svg_path_data.rs:65-78 — before extracting anything, compare `crates/op-editor-core/src/svg_import/path_data.rs` and `crates/op-editor-core/src/svg_path_data.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/svg_import/path_data.rs:37` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–17 lines × 2) crates/op-host-native/src/widget_host/slides_panel.rs:110— crates/op-host-native/src/widget_host/slides_panel.rs:110-126 | crates/op-host-web/src/widget_host/slides_panel.rs:59-72 — before extracting anything, compare `crates/op-host-native/src/widget_host/slides_panel.rs` and `crates/op-host-web/src/widget_host/slides_panel.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-native/src/widget_host/slides_panel.rs:110` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–17 lines × 2) crates/op-host-native/src/widget_host/variables_panel_row_press.rs:262— crates/op-host-native/src/widget_host/variables_panel_row_press.rs:262-278 | crates/op-host-web/src/widget_host/variables_panel_rows.rs:225-238 — before extracting anything, compare `crates/op-host-native/src/widget_host/variables_panel_row_press.rs` and `crates/op-host-web/src/widget_host/variables_panel_rows.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 148 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 that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12–16 lines × 2) crates/op-host-native/src/widget_host/workspace.rs:549— crates/op-host-native/src/widget_host/workspace.rs:549-564 | crates/op-host-web/src/widget_host/studio_workspace.rs:449-460 — before extracting anything, compare `crates/op-host-native/src/widget_host/workspace.rs` and `crates/op-host-web/src/widget_host/studio_workspace.rs` 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-native/src/widget_host/workspace.rs:549` it begins part-way through the construct above it, so those exact lines 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–16 lines × 2) crates/op-image-enrich/src/targets.rs:466— crates/op-image-enrich/src/targets.rs:466-481 | crates/op-image-enrich/src/targets.rs:623-634 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-image-enrich/src/targets.rs:466` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12–16 lines × 2) templates/step0/_generators/tpl_compare_do_dont.py:159— templates/step0/_generators/tpl_compare_do_dont.py:159-170 | templates/step0/_generators/tpl_journal_card.py:137-152 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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 lines × 3) crates/op-editor-core/src/host_support_allocator.rs:187— crates/op-editor-core/src/host_support_allocator.rs:187-200 | crates/op-editor-core/src/host_support_allocator.rs:232-245 | crates/op-editor-core/src/host_support_allocator.rs:289-302 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/host_support_allocator.rs:187` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 3) crates/op-mcp/src/parser.rs:240— crates/op-mcp/src/parser.rs:240-253 | crates/op-mcp/src/parser.rs:275-288 | crates/op-mcp/src/parser.rs:458-471 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-mcp/src/parser.rs:240` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 3) crates/op-preview-core/src/present.rs:280— crates/op-preview-core/src/present.rs:280-293 | crates/op-preview-core/src/session_paint.rs:114-127 | crates/op-preview-core/src/transition.rs:326-339 — before extracting anything, compare `crates/op-preview-core/src/present.rs` and `crates/op-preview-core/src/session_paint.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (12–14 lines × 2) crates/op-host-native/src/backend/skia.rs:536— crates/op-host-native/src/backend/skia.rs:536-549 | crates/op-host-native/src/backend/skia.rs:565-576 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–14 lines × 2) crates/op-html/src/resources.rs:513— crates/op-html/src/resources.rs:513-524 | crates/op-html/src/resources.rs:560-573 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-html/src/resources.rs:560` it begins part-way through the construct above it, so those exact lines 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) crates/op-orchestrator/src/cleanup_empty_content_bar.rs:175— crates/op-orchestrator/src/cleanup_empty_content_bar.rs:175-186 | crates/op-orchestrator/src/hero_bleed.rs:661-674 — before extracting anything, compare `crates/op-orchestrator/src/cleanup_empty_content_bar.rs` and `crates/op-orchestrator/src/hero_bleed.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13 lines × 3) crates/op-editor-core/src/text_edit.rs:81— crates/op-editor-core/src/text_edit.rs:81-93 | crates/op-editor-core/src/text_edit.rs:143-155 | crates/op-editor-core/src/text_edit.rs:176-188 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/text_edit.rs:81` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 3) crates/op-mcp/src/import_html_tool.rs:25— crates/op-mcp/src/import_html_tool.rs:25-37 | crates/op-mcp/src/import_snapshot_tool.rs:26-38 | crates/op-mcp/src/write_tools_import_svg.rs:29-41 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-mcp/src/import_html_tool.rs: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 (13 lines × 3) templates/step0/_generators/tpl_tutorial_photo.py:335— templates/step0/_generators/tpl_tutorial_photo.py:335-347 | templates/step0/_generators/tpl_tutorial_skincare.py:276-288 | templates/step0/_generators/tpl_tutorial_storage.py:286-298 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `templates/step0/_generators/tpl_tutorial_skincare.py:275` calls `stroke` and `templates/step0/_generators/tpl_tutorial_photo.py:334` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12–13 lines × 2) crates/op-editor-ui/src/widgets/home_surface_paint_cards.rs:111— crates/op-editor-ui/src/widgets/home_surface_paint_cards.rs:111-122 | crates/op-editor-ui/src/widgets/home_surface_paint_cards.rs:137-149 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/home_surface_paint_cards.rs:111` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–13 lines × 2) crates/op-host-desktop/src/image_panel_host.rs:187— crates/op-host-desktop/src/image_panel_host.rs:187-199 | crates/op-host-web/src/web_image_panel.rs:346-357 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-web/src/web_image_panel.rs:346` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–13 lines × 2) crates/op-orchestrator/src/plan.rs:337— crates/op-orchestrator/src/plan.rs:337-348 | crates/op-orchestrator/src/plan.rs:389-401 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-orchestrator/src/plan.rs:337` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12 lines × 3) crates/op-editor-ui/src/widgets/property_panel_fill.rs:559— crates/op-editor-ui/src/widgets/property_panel_fill.rs:559-570 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:231-242 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:420-431 — before extracting anything, compare `crates/op-editor-ui/src/widgets/property_panel_fill.rs` and `crates/op-editor-ui/src/widgets/property_panel_fill_body.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 109 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/property_panel_fill.rs:559` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) crates/op-host-services/src/export_html.rs:60— crates/op-host-services/src/export_html.rs:60-71 | crates/op-host-services/src/export_hyperframes.rs:204-215 | crates/op-host-services/src/export_pptx.rs:101-112 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-services/src/export_html.rs:60` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 3) crates/op-orchestrator/src/board_trailing_void.rs:114— crates/op-orchestrator/src/board_trailing_void.rs:114-125 | crates/op-orchestrator/src/cleanup_section_margins.rs:293-304 | crates/op-orchestrator/src/cleanup_slide_padding.rs:399-410 — before extracting anything, compare `crates/op-orchestrator/src/cleanup_section_margins.rs` and `crates/op-orchestrator/src/cleanup_slide_padding.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 9) crates/op-collab/src/diff_index.rs:134— crates/op-collab/src/diff_index.rs:134-142 | crates/op-editor-core/src/command_refine.rs:193-201 | crates/op-host-services/src/chat_system_prompt.rs:205-213 | crates/op-mcp/src/batch_get.rs:445-453 | crates/op-mcp/src/open_document.rs:172-180 | crates/op-mcp/src/tools.rs:45-53 | crates/op-orchestrator/src/validation_dump.rs:252-260 | crates/op-orchestrator/src/validation_fixes_apply.rs:650-658 | crates/op-orchestrator/src/validation_fixes_b3.rs:500-508 — before extracting anything, compare `crates/op-collab/src/diff_index.rs` and `crates/op-editor-core/src/command_refine.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/op-mcp/src/tools.rs:54` calls `Image`, `IconFont` and `crates/op-collab/src/diff_index.rs:143` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 9) crates/op-host-desktop/src/git_jobs.rs:95— crates/op-host-desktop/src/git_jobs.rs:95-103 | crates/op-host-desktop/src/git_jobs.rs:207-215 | crates/op-host-desktop/src/git_jobs.rs:245-253 | crates/op-host-desktop/src/git_jobs.rs:289-297 | crates/op-host-desktop/src/git_jobs.rs:345-353 | crates/op-host-desktop/src/iconify_host.rs:67-75 | crates/op-host-desktop/src/update_check.rs:103-111 | crates/op-host-services/src/acp_agent_probe_host.rs:107-115 | crates/op-host-services/src/provider_probe_host.rs:69-77 — there are 9 copies across 5 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 9 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-desktop/src/git_jobs.rs:95` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 9) crates/op-orchestrator/src/category_grid_reflow.rs:120— crates/op-orchestrator/src/category_grid_reflow.rs:120-128 | crates/op-orchestrator/src/geometry_bottom_gap.rs:83-91 | crates/op-orchestrator/src/geometry_validation.rs:278-286 | crates/op-orchestrator/src/geometry_validation.rs:498-506 | crates/op-orchestrator/src/radial_repair_sink.rs:29-37 | crates/op-orchestrator/src/sidebar_archetype.rs:18-26 | crates/op-orchestrator/src/square_ring_repair.rs:27-35 | crates/op-orchestrator/src/stacked_text_repair.rs:26-34 | crates/op-orchestrator/src/stub_repair.rs:10-18 — before extracting anything, compare `crates/op-orchestrator/src/square_ring_repair.rs` and `crates/op-orchestrator/src/stub_repair.rs` as WHOLE FILES: this scan already matched 5 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. If that is what happened, the fix is to keep one copy and have the 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `sink` to `&mut dyn DocSink` in one and `&mut dyn crate::types::DocSink` 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 × 5) crates/op-editor-ui/src/widgets/property_panel_fill.rs:515— crates/op-editor-ui/src/widgets/property_panel_fill.rs:515-522 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:180-187 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:303-310 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:369-376 | crates/op-editor-ui/src/widgets/property_panel_layer.rs:202-209 — before extracting anything, compare `crates/op-editor-ui/src/widgets/property_panel_fill.rs` and `crates/op-editor-ui/src/widgets/property_panel_fill_body.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 109 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/property_panel_fill.rs:515` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 5) crates/op-chat-agent/src/chat_canvas_tools.rs:429— crates/op-chat-agent/src/chat_canvas_tools.rs:429-436 | crates/op-editor-ui/src/widgets/drag_flow_index.rs:223-230 | crates/op-host-services/src/mcp_serve/enrich_images_tool.rs:452-459 | crates/op-orchestrator/src/card_inner_padding.rs:337-344 | crates/op-orchestrator/src/touch_target_floor.rs:265-272 — before extracting anything, compare `crates/op-orchestrator/src/card_inner_padding.rs` and `crates/op-orchestrator/src/touch_target_floor.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `&jian_ops_schema::node::PenNode` in one and `&PenNode` 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 × 5) crates/op-engine-jni/src/bindings_editor.rs:704— crates/op-engine-jni/src/bindings_editor.rs:704-711 | crates/op-engine-jni/src/bindings_editor.rs:755-762 | crates/op-engine-jni/src/bindings_editor.rs:770-777 | crates/op-engine-jni/src/bindings_text.rs:19-26 | crates/op-engine-jni/src/bindings_text.rs:43-50 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-engine-jni/src/bindings_editor.rs:704` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 4) crates/op-editor-ui/src/widgets/property_panel_input_layout.rs:74— crates/op-editor-ui/src/widgets/property_panel_input_layout.rs:74-81 | crates/op-editor-ui/src/widgets/property_panel_layout.rs:532-539 | crates/op-editor-ui/src/widgets/property_panel_sections.rs:471-478 | crates/op-editor-ui/src/widgets/property_panel_sections.rs:608-615 — before extracting anything, compare `crates/op-editor-ui/src/widgets/property_panel_input_layout.rs` and `crates/op-editor-ui/src/widgets/property_panel_layout.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 4) crates/op-auth-bridge/prebuilt_provenance.rs:498— crates/op-auth-bridge/prebuilt_provenance.rs:498-505 | crates/op-cli/src/html_cli.rs:254-261 | crates/op-host-desktop/src/html_import_session.rs:208-215 | crates/op-html/src/resources_image_metadata.rs:167-174 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
Duplicated block (8 lines × 4) crates/op-editor-core/src/agent_indicators.rs:706— crates/op-editor-core/src/agent_indicators.rs:706-713 | crates/op-editor-host-core/src/chat.rs:108-115 | crates/op-editor-host-core/src/chat.rs:132-139 | crates/op-editor-host-core/src/chat.rs:143-150 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/agent_indicators.rs:706` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (4–5 lines × 5) crates/op-codegen/src/codegen_tailwind_style.rs:157— crates/op-codegen/src/codegen_tailwind_style.rs:157-161 | crates/op-codegen/src/lib.rs:306-309 | crates/op-design-lint/src/node_util.rs:457-461 | crates/op-editor-core/src/fills/access.rs:107-111 | crates/op-mcp/src/style_ops_tools.rs:474-478 — before extracting anything, compare `crates/op-codegen/src/codegen_tailwind_style.rs` and `crates/op-mcp/src/style_ops_tools.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-codegen/src/codegen_tailwind_style.rs:157` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-codegen/src/codegen_tailwind_style.rs:155` calls `RadioGroup`, `as_ref`, `NumberInput` and `crates/op-codegen/src/lib.rs:306` 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–5 lines × 5) crates/op-codegen/src/codegen_tailwind_style.rs:129— crates/op-codegen/src/codegen_tailwind_style.rs:129-132 | crates/op-codegen/src/lib.rs:273-277 | crates/op-design-lint/src/node_util.rs:431-435 | crates/op-editor-core/src/fills/access.rs:30-34 | crates/op-mcp/src/style_ops_tools.rs:450-454 — before extracting anything, compare `crates/op-codegen/src/codegen_tailwind_style.rs` and `crates/op-mcp/src/style_ops_tools.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-codegen/src/lib.rs:273` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-codegen/src/lib.rs:271` calls `RadioGroup`, `as_ref`, `NumberInput` and `crates/op-codegen/src/codegen_tailwind_style.rs:129` 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–5 lines × 5) templates/step0/_generators/tpl_bookreview_carousel.py:230— templates/step0/_generators/tpl_bookreview_carousel.py:230-234 | templates/step0/_generators/tpl_cityguide_carousel.py:251-261 | templates/step0/_generators/tpl_opinion_carousel.py:211-215 | templates/step0/_generators/tpl_story_carousel.py:214-218 | templates/step0/_generators/tpl_yearreview_carousel.py:311-314 — 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 5 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `templates/step0/_generators/tpl_yearreview_carousel.py:311` calls `frame` and `templates/step0/_generators/tpl_opinion_carousel.py:210` does not — after which the two agree again for 5 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (3–5 lines × 3) crates/op-chat-agent/src/chat_agent_loop.rs:408— crates/op-chat-agent/src/chat_agent_loop.rs:408-412 | crates/op-host-services/src/chat_builtin_http_wire.rs:44-48 | crates/op-host-services/src/chat_http_server.rs:384-386 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-chat-agent/src/chat_agent_loop.rs:408` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/op-chat-agent/src/chat_agent_loop.rs:412` calls `Some`, `iter`, `position` and `crates/op-host-services/src/chat_http_server.rs:386` 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 (3–5 lines × 3) crates/op-editor-core/src/command_node_attrs/slots.rs:129— crates/op-editor-core/src/command_node_attrs/slots.rs:129-133 | crates/op-editor-core/src/fills/access.rs:82-86 | crates/op-orchestrator/src/variable_binding.rs:391-393 — before extracting anything, compare `crates/op-editor-core/src/fills/access.rs` and `crates/op-orchestrator/src/variable_binding.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/command_node_attrs/slots.rs:129` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-editor-core/src/command_node_attrs/slots.rs:128` calls `NumberInput`, `Some`, `Progress` and `crates/op-orchestrator/src/variable_binding.rs:391` 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 (3–5 lines × 3) crates/op-orchestrator/src/concurrent_echo_copy.rs:83— crates/op-orchestrator/src/concurrent_echo_copy.rs:83-87 | crates/op-orchestrator/src/source_copy_visible.rs:76-78 | crates/op-orchestrator/src/subtask_completeness_priced_items.rs:43-47 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-orchestrator/src/concurrent_echo_copy.rs:83` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2 locations) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:409— crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:409 · crates/op-host-web/src/op_ck_bridge.js:1761 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (7 lines × 2 locations) packages/op-chrome-extension/background.js:223— packages/op-chrome-extension/background.js:223 · packages/op-chrome-extension/popup.js:316 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (7 lines × 2 locations) packages/op-chrome-extension/design-capture.js:402— packages/op-chrome-extension/design-capture.js:402 · packages/op-chrome-extension/design-capture.js:413 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (6 lines × 2 locations) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:312— crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:312 · crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:324 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2 locations) crates/op-host-web/src/op_ck_bridge.js:182— crates/op-host-web/src/op_ck_bridge.js:182 · crates/op-host-web/src/op_ck_bridge.js:221 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (6 lines × 2 locations) crates/op-host-web/src/op_ck_bridge.js:1557— crates/op-host-web/src/op_ck_bridge.js:1557 · crates/op-host-web/src/op_ck_bridge.js:1648 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
X2 · Cancellation propagation· Async function without AbortSignal · ×3
Async function without AbortSignal: loadCatalog packages/op-chrome-extension/i18n.js:122— `loadCatalog` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: __wbg_init crates/op-host-web/pkg-webgl/op_host_web.js:1687— `__wbg_init` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: __wbg_init crates/op-host-web/pkg-ck/op_host_web.js:1206— `__wbg_init` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
op_cli::command_from_positionals (cyclomatic 53) crates/op-cli/src/main.rs:394— op_cli::command_from_positionals has cyclomatic complexity 53 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_cli::parse_args (cyclomatic 17) crates/op-cli/src/main.rs:306— op_cli::parse_args has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: op_cli::run (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
PropertyPanel::paint (cyclomatic 53) crates/op-editor-ui/src/widgets/property_panel/paint.rs:31— PropertyPanel::paint has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PropertyPanel::hit_test_action_logical (cyclomatic 32) crates/op-editor-ui/src/widgets/property_panel/hit.rs:78— PropertyPanel::hit_test_action_logical 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.
op_smoke::main (cyclomatic 51) crates/op-smoke/src/main.rs:202— op_smoke::main has cyclomatic complexity 51 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
op_smoke::image_fill::fill_images_with_fetch (cyclomatic 17) crates/op-smoke/src/image_fill.rs:172— op_smoke::image_fill::fill_images_with_fetch 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.
LayerPanel::paint (cyclomatic 41) crates/op-editor-ui/src/widgets/layer_panel.rs:394— LayerPanel::paint has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LayerPanel::hit_test (cyclomatic 17) crates/op-editor-ui/src/widgets/layer_panel_hit.rs:117— LayerPanel::hit_test 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.
op_chrome_extension_core::design_md_validate::is_valid (cyclomatic 35) crates/op-chrome-extension-core/src/design_md_validate.rs:16— op_chrome_extension_core::design_md_validate::is_valid has cyclomatic complexity 35 (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.
op_chrome_extension_core::design_md_validate::treatment_json_is_valid (cyclomatic 20) crates/op-chrome-extension-core/src/design_md_validate.rs:286— op_chrome_extension_core::design_md_validate::treatment_json_is_valid 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.
design-capture.collectDesignEvidenceInPage::walkRules (cyclomatic 31) packages/op-chrome-extension/design-capture.js:363— design-capture.collectDesignEvidenceInPage::walkRules has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (design-capture.collectDesignEvidenceInPage, design-capture.collectDesignEvidenceInPage::toHex) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
design-capture.collectDesignEvidenceInPage::toHex (cyclomatic 20) packages/op-chrome-extension/design-capture.js:104— design-capture.collectDesignEvidenceInPage::toHex has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (design-capture.collectDesignEvidenceInPage, design-capture.collectDesignEvidenceInPage::walkRules) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
op_auth_bridge::collab_union_policy::canonicalize (cyclomatic 26) crates/op-auth-bridge/src/collab_union_policy.rs:367— op_auth_bridge::collab_union_policy::canonicalize 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.
op_auth_bridge::collab_claims::validate_claims (cyclomatic 17) crates/op-auth-bridge/src/collab_claims.rs:309— op_auth_bridge::collab_claims::validate_claims 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.
op_engine_ffi::desc::parse_create (cyclomatic 25) crates/op-engine-ffi/src/desc.rs:276— op_engine_ffi::desc::parse_create 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.
op_engine_ffi::op_pointer (cyclomatic 24) crates/op-engine-ffi/src/lib.rs:451— op_engine_ffi::op_pointer 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.
OwnerSessionCore::handle_undo_request (cyclomatic 20) crates/op-collab/src/session_undo.rs:77— OwnerSessionCore::handle_undo_request 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.
OwnerSessionCore::handle_submit (cyclomatic 18) crates/op-collab/src/session_submit.rs:14— OwnerSessionCore::handle_submit 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.
GuestSessionCore::accept_frame (cyclomatic 19) crates/op-collab/src/guest_sync.rs:21— GuestSessionCore::accept_frame has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
GuestSessionCore::handle_undo_result (cyclomatic 16) crates/op-collab/src/guest_sync.rs:290— GuestSessionCore::handle_undo_result 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.
PromptCenterPanel::hit_test (cyclomatic 19) crates/op-editor-ui/src/widgets/prompt_center_panel.rs:258— PromptCenterPanel::hit_test 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.
PromptCenterPanel::hover_at (cyclomatic 16) crates/op-editor-ui/src/widgets/prompt_center_panel.rs:207— PromptCenterPanel::hover_at 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.
PreviewSession::reconcile (cyclomatic 19) crates/op-preview-core/src/app_mode.rs:194— PreviewSession::reconcile 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.
PreviewSession::dispatch_input_inner (cyclomatic 16) crates/op-preview-core/src/input_event.rs:342— PreviewSession::dispatch_input_inner 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.
op_host_web.debugString (cyclomatic 18) crates/op-host-web/pkg-ck/op_host_web.js:923— op_host_web.debugString 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.
op_host_web.debugString (cyclomatic 18) crates/op-host-web/pkg-webgl/op_host_web.js:1362— op_host_web.debugString 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.
CanvasViewport::paint (cognitive 76) crates/op-editor-ui/src/widgets/canvas_viewport.rs:170— CanvasViewport::paint has cognitive complexity 76 (threshold 15). Drivers by points: if/else 35 (63 pts), loops 3 (8 pts), boolean chains 5 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CanvasViewport::from_editor (cognitive 20) crates/op-editor-ui/src/widgets/canvas_viewport/builders.rs:24— CanvasViewport::from_editor has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, match/switch 1 (2 pts) (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.
WorkspaceSurface::hit_test_layout (cognitive 74) crates/op-editor-ui/src/widgets/workspace_surface.rs:581— WorkspaceSurface::hit_test_layout has cognitive complexity 74 (threshold 15). Drivers by points: if/else 39 (69 pts), loops 2 (5 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkspaceSurface::focus_candidates (cognitive 16) crates/op-editor-ui/src/widgets/workspace_surface_focus.rs:40— WorkspaceSurface::focus_candidates has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 4 (6 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.
PropertyPanel::paint (cognitive 69) crates/op-editor-ui/src/widgets/property_panel/paint.rs:31— PropertyPanel::paint has cognitive complexity 69 (threshold 15). Drivers by points: if/else 38 (55 pts), boolean chains 14 (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.
PropertyPanel::hit_test_action_logical (cognitive 42) crates/op-editor-ui/src/widgets/property_panel/hit.rs:78— PropertyPanel::hit_test_action_logical has cognitive complexity 42 (threshold 15). Drivers by points: if/else 21 (32 pts), match/switch 4 (8 pts), boolean chains 1, 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.
BrowserState::handle_action (cognitive 53) crates/op-collab-transport/src/discovery_bonjour_browser.rs:251— BrowserState::handle_action has cognitive complexity 53 (threshold 15). Drivers by points: if/else 16 (42 pts), match/switch 3 (6 pts), boolean chains 5 (nesting depth added 29). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
BrowserState::emit_service (cognitive 20) crates/op-collab-transport/src/discovery_bonjour_browser.rs:505— BrowserState::emit_service has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SceneTemplatePanel::hit_test (cognitive 46) crates/op-editor-ui/src/widgets/scene_template_hit.rs:100— SceneTemplatePanel::hit_test has cognitive complexity 46 (threshold 15). Drivers by points: if/else 17 (35 pts), loops 3 (7 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SceneTemplatePanel::hover_at (cognitive 16) crates/op-editor-ui/src/widgets/scene_template_hit.rs:26— SceneTemplatePanel::hover_at has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (15 pts), 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.
Validator::action_list (cognitive 42) crates/op-orchestrator/src/generated_expression_validation.rs:244— Validator::action_list has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (32 pts), loops 3 (8 pts), boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Validator::node (cognitive 19) crates/op-orchestrator/src/generated_expression_validation.rs:175— Validator::node has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (7 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.
GitRepo::candidate_op_files (cognitive 39) crates/op-git/src/candidates.rs:34— GitRepo::candidate_op_files has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (32 pts), loops 2 (7 pts) (nesting depth added 28). 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.
GitRepo::merge_branch_isolated (cognitive 18) crates/op-git/src/merge.rs:255— GitRepo::merge_branch_isolated has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_chrome_extension_core::design_md_validate::is_valid (cognitive 32) crates/op-chrome-extension-core/src/design_md_validate.rs:16— op_chrome_extension_core::design_md_validate::is_valid has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 11, loops 2, match/switch 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.
op_chrome_extension_core::design_md_validate::treatment_json_is_valid (cognitive 23) crates/op-chrome-extension-core/src/design_md_validate.rs:286— op_chrome_extension_core::design_md_validate::treatment_json_is_valid has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 4, loops 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.
op_auth_bridge::collab_union_policy::canonicalize (cognitive 31) crates/op-auth-bridge/src/collab_union_policy.rs:367— op_auth_bridge::collab_union_policy::canonicalize has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 12, 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.
op_auth_bridge::collab_claims::validate_claims (cognitive 16) crates/op-auth-bridge/src/collab_claims.rs:309— op_auth_bridge::collab_claims::validate_claims has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, boolean chains 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.
op_collab_relay_client::bridge::owner::run_owner (cognitive 31) crates/op-collab-relay-client/src/bridge/owner.rs:287— op_collab_relay_client::bridge::owner::run_owner has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (23 pts), match/switch 2 (5 pts), loops 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_collab_relay_client::session::pump (cognitive 27) crates/op-collab-relay-client/src/session.rs:191— op_collab_relay_client::session::pump has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 2 (5 pts), boolean chains 2, 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.
PromptCenterPanel::hit_test (cognitive 31) crates/op-editor-ui/src/widgets/prompt_center_panel.rs:258— PromptCenterPanel::hit_test has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (26 pts), loops 3 (4 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.
PromptCenterPanel::hover_at (cognitive 22) crates/op-editor-ui/src/widgets/prompt_center_panel.rs:207— PromptCenterPanel::hover_at has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 3 (4 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.
SheetParser::parse_range (cognitive 28) crates/op-html/src/css/cascade_parser.rs:158— SheetParser::parse_range has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 2 (4 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.
SheetParser::at_block (cognitive 19) crates/op-html/src/css/cascade_parser.rs:256— SheetParser::at_block has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 1 (3 pts), match/switch 2 (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.
Parser::parse_compound (cognitive 28) crates/op-html/src/css/selectors_parser.rs:145— Parser::parse_compound has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser::parse_number (cognitive 18) crates/op-html/src/length.rs:478— Parser::parse_number has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 6, loops 3 (5 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.
CodegenPipeline::step_chunks (cognitive 25) crates/op-codegen/src/ai/pipeline.rs:359— CodegenPipeline::step_chunks has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 3 (4 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.
CodegenPipeline::apply_plan (cognitive 17) crates/op-codegen/src/ai/pipeline.rs:239— CodegenPipeline::apply_plan has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 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.
SlidesPanelTabs::paint (cognitive 25) crates/op-editor-ui/src/widgets/slides_panel_tabs.rs:286— SlidesPanelTabs::paint has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (22 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SlidesPanelTabs::layout_rects (cognitive 17) crates/op-editor-ui/src/widgets/slides_panel_tabs.rs:147— SlidesPanelTabs::layout_rects has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (16 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
op_host_web.debugString (cognitive 24) crates/op-host-web/pkg-ck/op_host_web.js:923— op_host_web.debugString has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
op_host_web.debugString (cognitive 24) crates/op-host-web/pkg-webgl/op_host_web.js:1362— op_host_web.debugString has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
collectDesignEvidenceInPage::toHex (cognitive 24) packages/op-chrome-extension/design-capture.js:104— collectDesignEvidenceInPage::toHex has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 4 (8 pts), boolean chains 6 (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.
collectDesignEvidenceInPage::componentSample (cognitive 16) packages/op-chrome-extension/design-capture.js:311— collectDesignEvidenceInPage::componentSample has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 5, other 1, ternaries 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.
MobileHostedDesignHost::pump (cognitive 23) crates/op-engine-ffi/src/editor_chat_hosted_design.rs:287— MobileHostedDesignHost::pump has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2 (4 pts), boolean chains 3, match/switch 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.
MobileHostedDesignHost::retire (cognitive 17) crates/op-engine-ffi/src/editor_chat_hosted_design.rs:241— MobileHostedDesignHost::retire has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DesignMdPanel::section_lines (cognitive 22) crates/op-editor-ui/src/widgets/design_md_panel.rs:280— DesignMdPanel::section_lines has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (7 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DesignMdPanel::hit_test (cognitive 20) crates/op-editor-ui/src/widgets/design_md_panel.rs:406— DesignMdPanel::hit_test has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 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.
op_acp::transport::read_frame_with_limit (cognitive 19) crates/op-acp/src/transport.rs:26— op_acp::transport::read_frame_with_limit has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (17 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.
op_acp::jsonrpc::validate_envelope (cognitive 17) crates/op-acp/src/jsonrpc.rs:226— op_acp::jsonrpc::validate_envelope has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CollabRuntime::route_guest_output_inner (cognitive 19) crates/op-collab-host/src/runtime/effects.rs:348— CollabRuntime::route_guest_output_inner has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), match/switch 4 (8 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CollabRuntime::connection_closed (cognitive 17) crates/op-collab-host/src/runtime/effects.rs:512— CollabRuntime::connection_closed has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 1, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_collab_smoke::fault_owner::retry_exactly_once (cognitive 19) crates/op-collab-smoke/src/fault_owner.rs:47— op_collab_smoke::fault_owner::retry_exactly_once has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, if/else 8, match/switch 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.
op_collab_smoke::guest::run (cognitive 18) crates/op-collab-smoke/src/guest.rs:20— op_collab_smoke::guest::run has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, loops 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_collab_transport::discovery_bonjour::interface_advertisements (cognitive 19) crates/op-collab-transport/src/discovery_bonjour.rs:342— op_collab_transport::discovery_bonjour::interface_advertisements has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_collab_transport::discovery_bonjour::publisher_worker (cognitive 16) crates/op-collab-transport/src/discovery_bonjour.rs:178— op_collab_transport::discovery_bonjour::publisher_worker has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BindingOverlay::consume_scroll_requests (cognitive 19) crates/op-preview-core/src/binding_overlay.rs:241— BindingOverlay::consume_scroll_requests has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BindingOverlay::update_scroll (cognitive 18) crates/op-preview-core/src/binding_overlay.rs:363— BindingOverlay::update_scroll has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (17 pts), match/switch 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.
op_process_io::process_tree::terminate_process_tree (cognitive 19) crates/op-process-io/src/process_tree.rs:353— op_process_io::process_tree::terminate_process_tree has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (17 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.
op_process_io::process_tree::terminate_tokio_process_tree (cognitive 17) crates/op-process-io/src/process_tree.rs:406— op_process_io::process_tree::terminate_tokio_process_tree has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
op_host_web.__wbg_load (cognitive 19) crates/op-host-web/pkg-ck/op_host_web.js:1151— op_host_web.__wbg_load has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, error handling 1 (3 pts), match/switch 1 (nesting depth added 7). Of this number, 18 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_web.__wbg_load (cognitive 19) crates/op-host-web/pkg-webgl/op_host_web.js:1632— op_host_web.__wbg_load has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, error handling 1 (3 pts), match/switch 1 (nesting depth added 7). Of this number, 18 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OwnerSessionCore::handle_undo_request (cognitive 18) crates/op-collab/src/session_undo.rs:77— OwnerSessionCore::handle_undo_request has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 2, match/switch 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
OwnerSessionCore::handle_submit (cognitive 16) crates/op-collab/src/session_submit.rs:14— OwnerSessionCore::handle_submit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), match/switch 3, boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
NativeBackend::draw_text (cognitive 18) crates/op-host-native/src/backend/skia/text.rs:186— NativeBackend::draw_text has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativeBackend::cached_raster_svg_path (cognitive 16) crates/op-host-native/src/backend/skia/path.rs:100— NativeBackend::cached_raster_svg_path has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 5, match/switch 1 (2 pts), 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.
op_ck_bridge.opCkInit.systemTypefaceFor (cognitive 16) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:214— op_ck_bridge.opCkInit.systemTypefaceFor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (6 pts), ternaries 3 (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.
op_ck_bridge.opCkInit.systemTypefaceFor (cognitive 16) crates/op-host-web/src/op_ck_bridge.js:850— op_ck_bridge.opCkInit.systemTypefaceFor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (6 pts), ternaries 3 (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.
Near-duplicate member pair (72 shared lines) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AuthCodeFormOverlay.kt:73— packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AuthCodeFormOverlay.kt:73-244 | packaging/android/app/src/main/kotlin/tech/zseven/openpencil/NativeLoginOverlay.kt:164-351 — These two members are variants of one another: 72 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 (72 shared lines) packaging/ios/Sources/AuthCodeFormViewController.swift:68— packaging/ios/Sources/AuthCodeFormViewController.swift:68-271 | packaging/ios/Sources/NativeLoginViewController.swift:106-335 — These two members are variants of one another: 72 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (45 shared lines) crates/op-host-services/src/web_canvas_server/online_run_loop.rs:128— crates/op-host-services/src/web_canvas_server/online_run_loop.rs:128-297 | crates/op-host-services/src/web_canvas_server/run_loop.rs:28-198 — These two members are variants of one another: 45 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (45 shared lines) crates/op-collab-relay-locator-server/src/http.rs:400— crates/op-collab-relay-locator-server/src/http.rs:400-458 | crates/op-collab-relay-locator-server/src/http.rs:466-528 — These two members are variants of one another: 45 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Edited copy of a member (66 corresponding lines) · ×2
Edited copy of a member (66 corresponding lines) crates/op-editor-ui/src/widgets/home_surface_palette.rs:142— crates/op-editor-ui/src/widgets/home_surface_palette.rs:142-207 | crates/op-editor-ui/src/widgets/home_surface_palette.rs:214-283 — These two members are one piece of code written twice and then edited apart: 66 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (66 corresponding lines) crates/op-pen-loader/src/layout_repair.rs:83— crates/op-pen-loader/src/layout_repair.rs:83-148 | crates/op-pen-loader/src/layout_repair.rs:196-271 — These two members are one piece of code written twice and then edited apart: 66 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (56 corresponding lines) · ×2
Edited copy of a member (56 corresponding lines) crates/op-host-web/src/dom_io/browser_files.rs:28— crates/op-host-web/src/dom_io/browser_files.rs:28-95 | crates/op-host-web/src/dom_io/browser_files.rs:108-163 — These two members are one piece of code written twice and then edited apart: 56 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (56 corresponding lines) crates/op-host-native/src/widget_host/variables_panel_row_press.rs:58— crates/op-host-native/src/widget_host/variables_panel_row_press.rs:58-125 | crates/op-host-web/src/widget_host/variables_panel_rows.rs:152-207 — These two members are one piece of code written twice and then edited apart: 56 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (65 corresponding lines) · ×2
Edited copy of a member (65 corresponding lines) crates/op-mcp/src/design_prompt.rs:222— crates/op-mcp/src/design_prompt.rs:222-294 | crates/op-orchestrator/src/design_md_policy.rs:19-83 — These two members are one piece of code written twice and then edited apart: 65 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (65 corresponding lines) crates/op-host-native/src/widget_host/variables_preset_press.rs:137— crates/op-host-native/src/widget_host/variables_preset_press.rs:137-215 | crates/op-host-web/src/widget_host/variables_preset_press.rs:87-151 — These two members are one piece of code written twice and then edited apart: 65 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (47 corresponding lines) · ×2
Edited copy of a member (47 corresponding lines) crates/op-editor-ui/src/widgets/drag_flow.rs:69— crates/op-editor-ui/src/widgets/drag_flow.rs:69-120 | crates/op-editor-ui/src/widgets/drag_flow_index.rs:123-169 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (47 corresponding lines) crates/op-image-enrich/src/net/downscale.rs:171— crates/op-image-enrich/src/net/downscale.rs:171-217 | crates/op-image-enrich/src/net/downscale.rs:219-282 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 24+ corresponding lines) · ×2
Edited copies of one member (4 members, 24+ corresponding lines) crates/op-codegen/src/codegen_tailwind_style.rs:163— crates/op-codegen/src/codegen_tailwind_style.rs:163-187 | crates/op-editor-core/src/fills/access.rs:221-245 | crates/op-host-services/src/pre_validator.rs:296-321 | crates/op-pen-loader/src/effects.rs:117-140 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 24+ corresponding lines) crates/op-mcp/src/node_attr_tools.rs:19— crates/op-mcp/src/node_attr_tools.rs:19-42 | crates/op-mcp/src/node_attr_tools.rs:89-112 | crates/op-mcp/src/node_attr_tools.rs:127-150 | crates/op-mcp/src/node_attr_tools.rs:242-265 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (58 corresponding lines) · ×2
Edited copy of a member (58 corresponding lines) crates/op-orchestrator/src/plan.rs:419— crates/op-orchestrator/src/plan.rs:419-476 | crates/op-orchestrator/src/plan_fallback_card.rs:90-149 — These two members are one piece of code written twice and then edited apart: 58 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (58 corresponding lines) crates/op-host-web/src/widget_host/keyboard_edit_ops.rs:322— crates/op-host-web/src/widget_host/keyboard_edit_ops.rs:322-388 | crates/op-host-web/src/widget_host/keyboard_edit_ops.rs:393-450 — These two members are one piece of code written twice and then edited apart: 58 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (35 corresponding lines) · ×2
Edited copy of a member (35 corresponding lines) crates/op-editor-ui/src/widgets/component_browser_panel.rs:184— crates/op-editor-ui/src/widgets/component_browser_panel.rs:184-218 | crates/op-editor-ui/src/widgets/component_browser_panel.rs:414-460 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (35 corresponding lines) crates/op-orchestrator/src/geometry_clipped_rows.rs:138— crates/op-orchestrator/src/geometry_clipped_rows.rs:138-172 | crates/op-orchestrator/src/geometry_row_fixes.rs:346-384 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 17+ corresponding lines) · ×2
Edited copies of one member (3 members, 17+ corresponding lines) templates/step0/_generators/tpl_qa_carousel.py:248— templates/step0/_generators/tpl_qa_carousel.py:248-264 | templates/step0/_generators/tpl_toolkit_carousel.py:228-244 | templates/step0/_generators/tpl_tutorial_carousel.py:268-302 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 17+ corresponding lines) templates/step0/_generators/tpl_datareport_carousel.py:297— templates/step0/_generators/tpl_datareport_carousel.py:297-316 | templates/step0/_generators/tpl_opinion_carousel.py:354-373 | templates/step0/_generators/tpl_qa_carousel.py:337-353 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 27+ corresponding lines) · ×2
Edited copies of one member (3 members, 27+ corresponding lines) crates/op-editor-ui/src/widgets/canvas_layout_transition.rs:141— crates/op-editor-ui/src/widgets/canvas_layout_transition.rs:141-167 | crates/op-preview-core/src/binding_overlay.rs:645-674 | crates/op-preview-core/src/binding_overlay_apply.rs:186-215 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 27+ corresponding lines) crates/op-editor-ui/src/widgets/agent_settings_builtin_model_menu.rs:428— crates/op-editor-ui/src/widgets/agent_settings_builtin_model_menu.rs:428-455 | crates/op-editor-ui/src/widgets/agent_settings_builtin_parts.rs:456-482 | crates/op-editor-ui/src/widgets/property_panel_color_variables.rs:243-271 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 21+ corresponding lines) · ×2
Edited copies of one member (3 members, 21+ corresponding lines) crates/op-host-desktop/src/mcp_integrations.rs:387— crates/op-host-desktop/src/mcp_integrations.rs:387-414 | crates/op-host-desktop/src/mcp_integrations.rs:506-526 | crates/op-host-desktop/src/mcp_integrations.rs:528-553 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 21+ corresponding lines) crates/op-editor-ui/src/widgets/property_panel_code.rs:256— crates/op-editor-ui/src/widgets/property_panel_code.rs:256-280 | crates/op-editor-ui/src/widgets/property_panel_code.rs:317-340 | crates/op-editor-ui/src/widgets/property_panel_code_error.rs:226-246 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 19+ corresponding lines) · ×2
Edited copies of one member (3 members, 19+ corresponding lines) crates/op-pen-loader/src/adapter/shapes.rs:6— crates/op-pen-loader/src/adapter/shapes.rs:6-24 | crates/op-pen-loader/src/adapter/shapes.rs:26-44 | crates/op-pen-loader/src/adapter/shapes.rs:49-67 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 19+ corresponding lines) crates/op-orchestrator/src/subtask_completeness_list_rows.rs:20— crates/op-orchestrator/src/subtask_completeness_list_rows.rs:20-38 | crates/op-orchestrator/src/subtask_completeness_media_items.rs:16-37 | crates/op-orchestrator/src/subtask_completeness_reviews.rs:18-40 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 20+ corresponding lines) · ×2
Edited copies of one member (3 members, 20+ corresponding lines) crates/op-host-desktop/src/design_md_host.rs:109— crates/op-host-desktop/src/design_md_host.rs:109-128 | crates/op-host-services/src/design_md_llm.rs:30-54 | crates/op-host-web/src/web_design_md.rs:287-306 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 20+ corresponding lines) crates/op-editor-core/src/text_edit.rs:73— crates/op-editor-core/src/text_edit.rs:73-93 | crates/op-editor-core/src/text_edit.rs:136-155 | crates/op-editor-core/src/text_edit.rs:166-188 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 16+ corresponding lines) · ×2
Edited copies of one member (3 members, 16+ corresponding lines) crates/op-editor-core/src/color_picker_snapshot.rs:114— crates/op-editor-core/src/color_picker_snapshot.rs:114-129 | crates/op-editor-core/src/scene_vars.rs:72-96 | crates/op-editor-core/src/variables.rs:59-83 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 16+ corresponding lines) crates/op-editor-ui/src/widgets/layer_panel_metrics.rs:82— crates/op-editor-ui/src/widgets/layer_panel_metrics.rs:82-97 | crates/op-editor-ui/src/widgets/layer_panel_metrics.rs:99-117 | crates/op-editor-ui/src/widgets/layer_panel_metrics.rs:167-182 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 7+ corresponding lines) · ×2
Edited copies of one member (6 members, 7+ corresponding lines) crates/op-editor-ui/src/svg_export/transform.rs:157— crates/op-editor-ui/src/svg_export/transform.rs:157-163 | crates/op-editor-ui/src/widgets/agent_settings_fonts.rs:221-227 | crates/op-editor-ui/src/widgets/canvas_selection_overlay.rs:194-200 | crates/op-editor-ui/src/widgets/canvas_viewport/builders.rs:355-361 | crates/op-editor-ui/src/widgets/canvas_viewport_layer_bounds.rs:449-455 | crates/op-engine-ffi/src/render.rs:305-314 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
Edited copies of one member (6 members, 7+ corresponding lines) packaging/ios/Sources/OpEngineHost.swift:267— packaging/ios/Sources/OpEngineHost.swift:267-276 | packaging/ios/Sources/OpEngineHost.swift:278-284 | packaging/ios/Sources/OpEngineHost.swift:286-293 | packaging/ios/Sources/OpEngineHost.swift:306-313 | packaging/ios/Sources/OpEngineHost.swift:315-321 | packaging/ios/Sources/OpEngineHost.swift:331-337 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 10+ corresponding lines) · ×2
Edited copies of one member (4 members, 10+ corresponding lines) crates/op-html/src/color.rs:187— crates/op-html/src/color.rs:187-196 | crates/op-html/src/color.rs:198-207 | crates/op-html/src/color.rs:209-218 | crates/op-html/src/color.rs:220-229 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 10+ corresponding lines) crates/op-editor-ui/src/widgets/agent_settings_builtin_layout.rs:262— crates/op-editor-ui/src/widgets/agent_settings_builtin_layout.rs:262-271 | crates/op-editor-ui/src/widgets/git_panel_tracked_picker.rs:145-154 | crates/op-editor-ui/src/widgets/screen_switcher_pills.rs:51-61 | crates/op-editor-ui/src/widgets/slideshow_toolbar.rs:69-78 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 10+ corresponding lines) · ×2
Edited copies of one member (5 members, 10+ corresponding lines) packaging/ios/Sources/OpEngineHost+Auth.swift:8— packaging/ios/Sources/OpEngineHost+Auth.swift:8-21 | packaging/ios/Sources/OpEngineHost.swift:339-348 | packaging/ios/Sources/OpEngineHost.swift:359-374 | packaging/ios/Sources/OpEngineHost.swift:379-388 | packaging/ios/Sources/OpEngineHost.swift:399-408 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 10+ corresponding lines) crates/op-host-services/src/mcp_live/ui_requests.rs:11— crates/op-host-services/src/mcp_live/ui_requests.rs:11-20 | crates/op-host-services/src/mcp_live/ui_requests.rs:25-34 | crates/op-host-services/src/mcp_live/ui_requests.rs:41-54 | crates/op-host-services/src/mcp_live/ui_requests.rs:92-107 | crates/op-host-services/src/mcp_live/ui_requests.rs:113-127 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 6+ corresponding lines) · ×2
Edited copies of one member (5 members, 6+ corresponding lines) templates/step0/_generators/tpl_event_deck.py:444— templates/step0/_generators/tpl_event_deck.py:444-449 | templates/step0/_generators/tpl_gradient_tech.py:445-451 | templates/step0/_generators/tpl_lecture_light.py:498-504 | templates/step0/_generators/tpl_pitch_dark.py:451-456 | templates/step0/_generators/tpl_slides.py:410-415 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 6+ corresponding lines) templates/step0/_generators/tpl_card_spine.py:129— templates/step0/_generators/tpl_card_spine.py:129-139 | templates/step0/_generators/tpl_logo_qa_board.py:166-181 | templates/step0/_generators/tpl_logo_qa_board.py:239-251 | templates/step0/_generators/tpl_logo_qa_board.py:255-260 | templates/step0/_generators/tpl_logo_qa_board.py:264-296 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 13+ corresponding lines) · ×2
Edited copies of one member (5 members, 13+ corresponding lines) crates/op-engine-ffi/src/text.rs:88— crates/op-engine-ffi/src/text.rs:88-101 | crates/op-engine-ffi/src/text.rs:109-121 | crates/op-engine-ffi/src/text.rs:129-141 | crates/op-engine-ffi/src/text.rs:239-251 | crates/op-engine-ffi/src/text.rs:259-271 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 13+ corresponding lines) crates/op-codegen/src/codegen_tailwind_jsx.rs:26— crates/op-codegen/src/codegen_tailwind_jsx.rs:26-41 | crates/op-codegen/src/codegen_tailwind_jsx.rs:44-57 | crates/op-mcp/src/tool_search.rs:263-276 | crates/op-util/src/xml_escape.rs:10-22 | crates/op-util/src/xml_escape.rs:25-38 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 14+ corresponding lines) · ×2
Edited copies of one member (4 members, 14+ corresponding lines) crates/op-host-native/src/backend/frame_backend.rs:505— crates/op-host-native/src/backend/frame_backend.rs:505-518 | crates/op-host-native/src/backend/frame_backend.rs:553-568 | crates/op-host-native/src/backend/frame_backend.rs:598-612 | crates/op-host-native/src/backend/frame_backend.rs:642-656 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 14+ corresponding lines) crates/op-mcp/src/insert_node_args.rs:94— crates/op-mcp/src/insert_node_args.rs:94-107 | crates/op-mcp/src/page_tools.rs:77-90 | crates/op-mcp/src/write_tools.rs:36-49 | crates/op-mcp/src/write_tools.rs:313-329 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 2+ corresponding lines) · ×2
Edited copies of one member (3 members, 2+ corresponding lines) templates/step0/_generators/tpl_deck43_onboarding.py:72— templates/step0/_generators/tpl_deck43_onboarding.py:72-74 | templates/step0/_generators/tpl_deck43_openpencil_intro.py:52-53 | templates/step0/_generators/tpl_deck43_research.py:69-71 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 2 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 2+ corresponding lines) templates/step0/_generators/tpl_infographic_blank_vs_example.py:131— templates/step0/_generators/tpl_infographic_blank_vs_example.py:131-132 | templates/step0/_generators/tpl_infographic_idea_flow.py:116-117 | templates/step0/_generators/tpl_infographic_weekly_review.py:156-158 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 2 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 3+ corresponding lines) · ×2
Edited copies of one member (3 members, 3+ corresponding lines) crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs:92— crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs:92-94 | crates/op-editor-ui/src/widgets/home_surface_paint_panels.rs:578-580 | crates/op-editor-ui/src/widgets/home_surface_paint_works_grid.rs:14-16 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 3+ corresponding lines) crates/op-codegen/src/codegen_tailwind_theme.rs:53— crates/op-codegen/src/codegen_tailwind_theme.rs:53-58 | crates/op-html/src/text_inline.rs:177-182 | crates/op-mcp/src/batch_design_dsl.rs:311-313 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (30 lines × 2) crates/op-mcp/src/parser.rs:238— crates/op-mcp/src/parser.rs:238-267 | crates/op-mcp/src/parser.rs:273-302 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-mcp/src/parser.rs:238` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (30 lines × 2) crates/op-host-services/src/export_html_structured/fallback.rs:102— crates/op-host-services/src/export_html_structured/fallback.rs:102-131 | crates/op-host-services/src/export_pptx/fallback.rs:85-114 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (25 lines × 3) crates/op-collab-relay-locator-server/src/http.rs:333— crates/op-collab-relay-locator-server/src/http.rs:333-357 | crates/op-collab-relay-locator-server/src/http.rs:408-432 | crates/op-collab-relay-locator-server/src/http.rs:473-497 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-collab-relay-locator-server/src/http.rs:333` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (25 lines × 3) crates/op-editor-core/src/path_bounds.rs:79— crates/op-editor-core/src/path_bounds.rs:79-103 | crates/op-editor-core/src/svg_path_bounds.rs:81-105 | crates/op-editor-core/src/svg_path_data.rs:305-329 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (25 lines × 2) crates/op-host-services/src/design_session.rs:120— crates/op-host-services/src/design_session.rs:120-144 | crates/op-host-services/src/design_variants.rs:168-192 — before extracting anything, compare `crates/op-host-services/src/design_session.rs` and `crates/op-host-services/src/design_variants.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (25 lines × 2) crates/op-editor-core/src/hoist_app_state.rs:21— crates/op-editor-core/src/hoist_app_state.rs:21-45 | crates/op-preview-core/src/binding_sites.rs:27-51 — 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 `node` to `&mut PenNode` in one and `&PenNode` 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 (23 lines × 2) crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs:530— crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs:530-552 | crates/op-editor-ui/src/widgets/home_surface_paint_panels.rs:311-333 — before extracting anything, compare `crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs` and `crates/op-editor-ui/src/widgets/home_surface_paint_panels.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 197 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs:530` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23 lines × 2) templates/step0/_generators/tpl_tutorial_skincare.py:267— templates/step0/_generators/tpl_tutorial_skincare.py:267-289 | templates/step0/_generators/tpl_tutorial_storage.py:277-299 — before extracting anything, compare `templates/step0/_generators/tpl_tutorial_skincare.py` and `templates/step0/_generators/tpl_tutorial_storage.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (20–22 lines × 2) crates/op-engine-jni/src/bindings.rs:218— crates/op-engine-jni/src/bindings.rs:218-237 | crates/op-engine-napi/src/bindings.rs:229-250 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-engine-jni/src/bindings.rs:218` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20–22 lines × 2) crates/op-orchestrator/src/orchestration_self_check.rs:547— crates/op-orchestrator/src/orchestration_self_check.rs:547-568 | crates/op-orchestrator/src/role_post_pass/mobile_cards.rs:22-41 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-orchestrator/src/orchestration_self_check.rs:547` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19–21 lines × 2) crates/op-ai-skills/src/style_guide/design_md_import.rs:155— crates/op-ai-skills/src/style_guide/design_md_import.rs:155-175 | crates/op-chrome-extension-core/src/design_md_render.rs:533-551 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-ai-skills/src/style_guide/design_md_import.rs: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 (19–21 lines × 2) crates/op-host-desktop/src/font_import_host.rs:38— crates/op-host-desktop/src/font_import_host.rs:38-56 | crates/op-host-desktop/src/font_import_host.rs:84-104 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-desktop/src/font_import_host.rs:38` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20–21 lines × 2) crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs:300— crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs:300-320 | crates/op-editor-ui/src/widgets/home_surface_paint_panels.rs:34-53 — before extracting anything, compare `crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs` and `crates/op-editor-ui/src/widgets/home_surface_paint_panels.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 197 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (20–21 lines × 2) crates/op-host-native/src/widget_host/variables_preset_press.rs:178— crates/op-host-native/src/widget_host/variables_preset_press.rs:178-198 | crates/op-host-web/src/widget_host/variables_preset_press.rs:120-139 — before extracting anything, compare `crates/op-host-native/src/widget_host/variables_preset_press.rs` and `crates/op-host-web/src/widget_host/variables_preset_press.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-native/src/widget_host/variables_preset_press.rs:178` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (18–21 lines × 2) crates/op-host-desktop/src/design_session_workers.rs:238— crates/op-host-desktop/src/design_session_workers.rs:238-258 | crates/op-host-desktop/src/design_session_workers.rs:271-288 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-desktop/src/design_session_workers.rs:238` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18–21 lines × 2) crates/op-pen-loader/src/style_payload.rs:476— crates/op-pen-loader/src/style_payload.rs:476-496 | crates/op-preview-core/src/session_paint.rs:534-551 — 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–20 lines × 2) crates/op-ai-skills/src/resolve.rs:64— crates/op-ai-skills/src/resolve.rs:64-83 | crates/op-orchestrator/src/prompt_style_skills.rs:296-313 — 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–20 lines × 2) crates/op-mcp/src/node_attr_tools.rs:246— crates/op-mcp/src/node_attr_tools.rs:246-263 | crates/op-mcp/src/node_attr_tools.rs:304-323 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-mcp/src/node_attr_tools.rs:246` it begins part-way through the construct above it, so those 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 lines × 3) crates/op-editor-ui/src/widgets/property_panel_fill.rs:531— crates/op-editor-ui/src/widgets/property_panel_fill.rs:531-549 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:203-221 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:392-410 — before extracting anything, compare `crates/op-editor-ui/src/widgets/property_panel_fill.rs` and `crates/op-editor-ui/src/widgets/property_panel_fill_body.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 109 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/property_panel_fill.rs:531` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (19 lines × 3) crates/op-orchestrator/src/validation_fixes_apply.rs:666— crates/op-orchestrator/src/validation_fixes_apply.rs:666-684 | crates/op-orchestrator/src/validation_fixes_apply.rs:686-704 | crates/op-orchestrator/src/validation_fixes_apply.rs:706-724 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (18 lines × 3) crates/op-auth-bridge/src/collab_claims.rs:455— crates/op-auth-bridge/src/collab_claims.rs:455-472 | crates/op-collab-transport/src/admission.rs:619-636 | crates/op-collab/src/profile_validation.rs:79-96 — before extracting anything, compare `crates/op-auth-bridge/src/collab_claims.rs` and `crates/op-collab-transport/src/admission.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (18 lines × 3) crates/op-auth-bridge/src/collab_claims.rs:541— crates/op-auth-bridge/src/collab_claims.rs:541-558 | crates/op-collab-transport/src/admission.rs:681-698 | crates/op-collab/src/profile_validation.rs:143-160 — before extracting anything, compare `crates/op-auth-bridge/src/collab_claims.rs` and `crates/op-collab-transport/src/admission.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-auth-bridge/src/collab_claims.rs:541` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17–18 lines × 2) crates/op-ai-skills/src/resolve.rs:128— crates/op-ai-skills/src/resolve.rs:128-144 | crates/op-orchestrator/src/prompt_style_skills.rs:341-358 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (17–18 lines × 2) templates/step0/_generators/tpl_tutorial_skincare.py:172— templates/step0/_generators/tpl_tutorial_skincare.py:172-188 | templates/step0/_generators/tpl_tutorial_storage.py:179-196 — before extracting anything, compare `templates/step0/_generators/tpl_tutorial_skincare.py` and `templates/step0/_generators/tpl_tutorial_storage.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 3) crates/op-pen-loader/src/adapter/shapes.rs:8— crates/op-pen-loader/src/adapter/shapes.rs:8-24 | crates/op-pen-loader/src/adapter/shapes.rs:28-44 | crates/op-pen-loader/src/adapter/shapes.rs:51-67 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-pen-loader/src/adapter/shapes.rs:8` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 3) templates/step0/_generators/tpl_cityguide_carousel.py:462— templates/step0/_generators/tpl_cityguide_carousel.py:462-479 | templates/step0/_generators/tpl_toolkit_carousel.py:434-455 | templates/step0/_generators/tpl_yearreview_carousel.py:569-585 — 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.
Duplicated block (16 lines × 3) crates/op-design-lint/src/detectors/spacing.rs:263— crates/op-design-lint/src/detectors/spacing.rs:263-278 | crates/op-host-services/src/pre_validator.rs:139-154 | crates/op-orchestrator/src/validation_scroll_guard.rs:58-73 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-design-lint/src/detectors/spacing.rs:263` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-design-lint/src/detectors/spacing.rs:260` calls `is_clipped_horizontal_lane_node` and `crates/op-orchestrator/src/validation_scroll_guard.rs:57` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16 lines × 3) crates/op-mcp/src/parser.rs:99— crates/op-mcp/src/parser.rs:99-114 | crates/op-mcp/src/parser.rs:359-374 | crates/op-orchestrator/src/plan.rs:216-231 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-mcp/src/parser.rs:99` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–15 lines × 2) crates/op-editor-ui/src/widgets/agent_settings_images_parts.rs:45— crates/op-editor-ui/src/widgets/agent_settings_images_parts.rs:45-59 | crates/op-editor-ui/src/widgets/agent_settings_images_parts.rs:200-211 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/agent_settings_images_parts.rs:45` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12–15 lines × 2) crates/op-host-native/src/widget_host/variables_panel_row_press.rs:62— crates/op-host-native/src/widget_host/variables_panel_row_press.rs:62-73 | crates/op-host-native/src/widget_host/variables_panel_row_press.rs:248-262 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-native/src/widget_host/variables_panel_row_press.rs:62` it does not close everything it opens, so those exact lines 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 × 5) crates/op-host-desktop/src/chat_acp.rs:387— crates/op-host-desktop/src/chat_acp.rs:387-400 | crates/op-host-services/src/chat_builtin_http.rs:318-331 | crates/op-host-services/src/chat_http_server.rs:148-161 | crates/op-host-services/src/chat_runtime.rs:109-122 | crates/op-host-services/src/chat_subprocess.rs:322-335 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-desktop/src/chat_acp.rs:387` it begins part-way through the construct above it, so those exact lines 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 × 5) templates/step0/_generators/tpl_compare_do_dont.py:276— templates/step0/_generators/tpl_compare_do_dont.py:276-289 | templates/step0/_generators/tpl_compare_pricing_tiers.py:230-243 | templates/step0/_generators/tpl_compare_time_shift.py:212-225 | templates/step0/_generators/tpl_compare_tradeoff_scale.py:197-210 | templates/step0/_generators/tpl_compare_version_diff.py:178-191 — 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 5 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–13 lines × 2) crates/op-design-lint/src/detectors/siblings.rs:79— crates/op-design-lint/src/detectors/siblings.rs:79-91 | crates/op-design-lint/src/detectors/siblings.rs:474-484 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-design-lint/src/detectors/siblings.rs:79` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–13 lines × 2) crates/op-editor-ui/src/widgets/home_surface_layout.rs:428— crates/op-editor-ui/src/widgets/home_surface_layout.rs:428-438 | crates/op-editor-ui/src/widgets/home_surface_layout_compact.rs:188-200 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/home_surface_layout.rs:428` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 4) crates/op-mcp/src/batch_get.rs:240— crates/op-mcp/src/batch_get.rs:240-251 | crates/op-mcp/src/read_nodes.rs:103-114 | crates/op-mcp/src/style_ops_tools.rs:158-169 | crates/op-mcp/src/style_ops_tools.rs:174-185 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 4) crates/op-mcp/src/import_common.rs:62— crates/op-mcp/src/import_common.rs:62-73 | crates/op-mcp/src/write_tools.rs:106-117 | crates/op-mcp/src/write_tools.rs:175-186 | crates/op-mcp/src/write_tools_import_svg.rs:58-69 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (8–11 lines × 3) crates/op-host-services/src/chat_spawn.rs:179— crates/op-host-services/src/chat_spawn.rs:179-186 | crates/op-host-services/src/cli_probe_support.rs:115-125 | crates/op-host-services/src/provider_probe.rs:340-347 — before extracting anything, compare `crates/op-host-services/src/chat_spawn.rs` and `crates/op-host-services/src/provider_probe.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-services/src/chat_spawn.rs:179` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–11 lines × 3) crates/op-pen-loader/src/adapter/entry.rs:127— crates/op-pen-loader/src/adapter/entry.rs:127-136 | crates/op-pen-loader/src/adapter/pages.rs:40-50 | crates/op-pen-loader/src/adapter/pages.rs:58-65 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-pen-loader/src/adapter/pages.rs:40` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–11 lines × 2) crates/op-host-native/src/backend/skia/gradient.rs:46— crates/op-host-native/src/backend/skia/gradient.rs:46-56 | crates/op-host-native/src/backend/skia/gradient.rs:101-109 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-native/src/backend/skia/gradient.rs:46` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–11 lines × 2) crates/op-host-services/src/import_html_url.rs:53— crates/op-host-services/src/import_html_url.rs:53-63 | crates/op-mcp/src/import_common.rs:130-138 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/op-host-services/src/import_html_url.rs:65` calls `insert`, `into`, `to_string` and `crates/op-mcp/src/import_common.rs:140` 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 × 4) crates/op-ai-skills/src/style_guide/token_table.rs:496— crates/op-ai-skills/src/style_guide/token_table.rs:496-505 | crates/op-orchestrator/src/design_type.rs:162-171 | crates/op-orchestrator/src/plan.rs:528-537 | crates/op-orchestrator/src/plan_fallback_card.rs:26-35 — before extracting anything, compare `crates/op-orchestrator/src/plan.rs` and `crates/op-orchestrator/src/plan_fallback_card.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-ai-skills/src/style_guide/token_table.rs:496` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 4) crates/op-html/src/mapper_box.rs:146— crates/op-html/src/mapper_box.rs:146-155 | crates/op-html/src/mapper_margin.rs:357-366 | crates/op-html/src/mapper_margin.rs:666-675 | crates/op-html/src/mapper_wrap.rs:198-207 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (8–10 lines × 2) crates/op-editor-core/src/svg_import/path_data.rs:144— crates/op-editor-core/src/svg_import/path_data.rs:144-151 | crates/op-editor-core/src/svg_import/path_data.rs:168-177 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/svg_import/path_data.rs:144` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/op-editor-core/src/svg_import/path_data.rs:152` calls `abs_pt`, `quad_to_cubic`, `emit_cubic` and `crates/op-editor-core/src/svg_import/path_data.rs:178` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8–10 lines × 2) crates/op-host-desktop/src/figma_import_session/publish.rs:178— crates/op-host-desktop/src/figma_import_session/publish.rs:178-185 | crates/op-host-desktop/src/figma_import_session/publish.rs:200-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.
Duplicated block (9 lines × 6) crates/op-design-lint/src/node_util.rs:395— crates/op-design-lint/src/node_util.rs:395-403 | crates/op-orchestrator/src/validation_dump.rs:224-232 | crates/op-orchestrator/src/validation_dump.rs:374-382 | crates/op-pen-loader/src/adapter/geometry.rs:32-40 | crates/op-pen-loader/src/authored_geometry.rs:90-98 | crates/op-pen-loader/src/layout_repair.rs:738-746 — before extracting anything, compare `crates/op-design-lint/src/node_util.rs` and `crates/op-orchestrator/src/validation_dump.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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, `crates/op-design-lint/src/node_util.rs:393` calls `Image`, `IconFont` and `crates/op-orchestrator/src/validation_dump.rs:223` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 6) templates/step0/_generators/tpl_cards.py:87— templates/step0/_generators/tpl_cards.py:87-95 | templates/step0/_generators/tpl_journal_card.py:192-201 | templates/step0/_generators/tpl_lecture_light.py:156-165 | templates/step0/_generators/tpl_pitch_dark.py:144-153 | templates/step0/_generators/tpl_quote_card.py:90-99 | templates/step0/_generators/tpl_quote_card.py:108-116 — there are 6 copies across 5 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (9 lines × 5) crates/op-design-lint/src/node_util.rs:384— crates/op-design-lint/src/node_util.rs:384-392 | crates/op-orchestrator/src/validation_dump.rs:215-223 | crates/op-orchestrator/src/validation_dump.rs:365-373 | crates/op-pen-loader/src/adapter/geometry.rs:23-31 | crates/op-pen-loader/src/authored_geometry.rs:81-89 — before extracting anything, compare `crates/op-design-lint/src/node_util.rs` and `crates/op-orchestrator/src/validation_dump.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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, `crates/op-design-lint/src/node_util.rs:393` calls `Image`, `IconFont` and `crates/op-orchestrator/src/validation_dump.rs:224` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 5) crates/op-pen-loader/src/widget_payload.rs:30— crates/op-pen-loader/src/widget_payload.rs:30-38 | crates/op-pen-loader/src/widget_payload.rs:50-58 | crates/op-pen-loader/src/widget_payload.rs:70-78 | crates/op-pen-loader/src/widget_payload.rs:140-148 | crates/op-pen-loader/src/widget_payload.rs:197-205 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-pen-loader/src/widget_payload.rs:30` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/op-pen-loader/src/widget_payload.rs:79` calls `clone` and `crates/op-pen-loader/src/widget_payload.rs:149` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7–9 lines × 2) crates/op-config-store/src/lib.rs:308— crates/op-config-store/src/lib.rs:308-314 | crates/op-git/src/lib.rs:166-174 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–9 lines × 2) crates/op-pen-loader/src/editor_scene.rs:31— crates/op-pen-loader/src/editor_scene.rs:31-39 | crates/op-pen-loader/src/layout_scene.rs:82-88 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-pen-loader/src/editor_scene.rs:31` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–8 lines × 4) crates/op-editor-core/src/image_crop.rs:225— crates/op-editor-core/src/image_crop.rs:225-232 | crates/op-editor-core/src/property_edit_mutators.rs:668-674 | crates/op-editor-core/src/property_edit_mutators.rs:704-710 | crates/op-editor-core/src/property_edit_mutators.rs:723-729 — 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 that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–8 lines × 4) templates/step0/_generators/tpl_infographic_blank_vs_example.py:136— templates/step0/_generators/tpl_infographic_blank_vs_example.py:136-142 | templates/step0/_generators/tpl_infographic_idea_flow.py:121-127 | templates/step0/_generators/tpl_infographic_steps.py:133-140 | templates/step0/_generators/tpl_infographic_weekly_review.py:142-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 all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `templates/step0/_generators/tpl_infographic_steps.py:133` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 5) crates/op-editor-core/src/property_edit_mutators.rs:502— crates/op-editor-core/src/property_edit_mutators.rs:502-508 | crates/op-editor-core/src/property_edit_mutators.rs:513-519 | crates/op-editor-core/src/property_edit_mutators.rs:524-530 | crates/op-editor-core/src/property_edit_mutators.rs:535-541 | crates/op-editor-core/src/property_edit_mutators.rs:602-608 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. 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 × 5) crates/op-codegen/src/codegen_tailwind_style.rs:116— crates/op-codegen/src/codegen_tailwind_style.rs:116-122 | crates/op-codegen/src/lib.rs:257-263 | crates/op-design-lint/src/node_util.rs:415-421 | crates/op-editor-core/src/fills/access.rs:14-20 | crates/op-mcp/src/style_ops_tools.rs:434-440 — before extracting anything, compare `crates/op-codegen/src/codegen_tailwind_style.rs` and `crates/op-mcp/src/style_ops_tools.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (6–7 lines × 2) crates/op-host-web/src/web_fonts.rs:354— crates/op-host-web/src/web_fonts.rs:354-359 | crates/op-host-web/src/web_fonts.rs:362-368 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-web/src/web_fonts.rs:362` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6–7 lines × 2) crates/op-orchestrator/src/radial_repair_preinsert_normalize.rs:210— crates/op-orchestrator/src/radial_repair_preinsert_normalize.rs:210-215 | crates/op-orchestrator/src/radial_repair_preinsert_normalize.rs:262-268 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-orchestrator/src/radial_repair_preinsert_normalize.rs:261` calls `get`, `and_then`, `Some` and `crates/op-orchestrator/src/radial_repair_preinsert_normalize.rs:209` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5–6 lines × 2) crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs:356— crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs:356-361 | crates/op-editor-ui/src/widgets/home_surface_paint_panels.rs:72-76 — before extracting anything, compare `crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs` and `crates/op-editor-ui/src/widgets/home_surface_paint_panels.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 197 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs:356` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5–6 lines × 2) crates/op-editor-ui/src/widgets/home_surface_paint_works_grid.rs:21— crates/op-editor-ui/src/widgets/home_surface_paint_works_grid.rs:21-25 | crates/op-editor-ui/src/widgets/home_works_list.rs:174-179 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/home_surface_paint_works_grid.rs:21` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 × 16) crates/op-chat-agent/src/design_agent_diagnostics.rs:449— crates/op-chat-agent/src/design_agent_diagnostics.rs:449-456 | crates/op-codegen/src/codegen_tailwind_style.rs:69-76 | crates/op-editor-core/src/uikit_io.rs:309-316 | crates/op-mcp/src/batch_program_exec_ops.rs:431-438 | crates/op-mcp/src/style_ops_tools.rs:480-487 | crates/op-orchestrator/src/cleanup_desktop_dashboard.rs:176-183 | crates/op-orchestrator/src/cleanup_equalize_siblings.rs:550-557 | crates/op-orchestrator/src/cleanup_layout.rs:86-93 | crates/op-orchestrator/src/cleanup_mobile_dense.rs:249-256 | crates/op-orchestrator/src/cleanup_root_and_nav.rs:222-229 | crates/op-orchestrator/src/cleanup_section_margins.rs:272-279 | crates/op-orchestrator/src/cleanup_slide_padding.rs:412-419 | crates/op-orchestrator/src/mobile_content_rail_detect.rs:277-284 | crates/op-orchestrator/src/mobile_reflow.rs:345-352 | crates/op-pen-loader/src/full_content_snapshot.rs:32-39 | crates/op-pen-loader/src/layout_repair.rs:757-764 — before extracting anything, compare `crates/op-codegen/src/codegen_tailwind_style.rs` and `crates/op-mcp/src/style_ops_tools.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (8 lines × 16) templates/step0/_generators/tpl_compare_myth_truth.py:152— templates/step0/_generators/tpl_compare_myth_truth.py:152-159 | templates/step0/_generators/tpl_compare_scenario_guide.py:156-163 | templates/step0/_generators/tpl_compare_spec_table.py:176-184 | templates/step0/_generators/tpl_compare_three_way.py:163-170 | templates/step0/_generators/tpl_infographic_blank_vs_example.py:176-185 | templates/step0/_generators/tpl_infographic_challenge.py:176-183 | templates/step0/_generators/tpl_infographic_concept.py:178-185 | templates/step0/_generators/tpl_infographic_data.py:145-152 | templates/step0/_generators/tpl_infographic_faq.py:189-196 | templates/step0/_generators/tpl_infographic_idea_flow.py:145-158 | templates/step0/_generators/tpl_infographic_idea_flow.py:228-242 | templates/step0/_generators/tpl_infographic_list.py:171-178 | templates/step0/_generators/tpl_infographic_map.py:173-180 | templates/step0/_generators/tpl_infographic_steps.py:159-166 | templates/step0/_generators/tpl_infographic_steps.py:238-246 | templates/step0/_generators/tpl_infographic_weekly_review.py:181-191 — there are 16 copies across 14 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 16 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.
Duplicated block (6 lines × 4) crates/op-editor-ui/src/widgets/drag_flow.rs:496— crates/op-editor-ui/src/widgets/drag_flow.rs:496-501 | crates/op-editor-ui/src/widgets/drag_flow_index.rs:386-391 | crates/op-editor-ui/src/widgets/slides_panel.rs:688-693 | crates/op-editor-ui/src/widgets/slideshow_toolbar.rs:221-226 — before extracting anything, compare `crates/op-editor-ui/src/widgets/drag_flow.rs` and `crates/op-editor-ui/src/widgets/drag_flow_index.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 4) crates/op-orchestrator/src/mobile_content_rail_header.rs:209— crates/op-orchestrator/src/mobile_content_rail_header.rs:209-214 | crates/op-orchestrator/src/mobile_content_rail_header.rs:216-221 | crates/op-orchestrator/src/reference_skeleton.rs:412-417 | crates/op-orchestrator/src/reference_skeleton.rs:419-424 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 5) crates/op-editor-ui/src/widgets/prompt_center_panel.rs:681— crates/op-editor-ui/src/widgets/prompt_center_panel.rs:681-685 | crates/op-editor-ui/src/widgets/variables_panel/geometry.rs:84-88 | crates/op-editor-ui/src/widgets/works_reader.rs:94-98 | crates/op-host-native/src/widget_host/variables_preset_press.rs:267-271 | crates/op-host-web/src/widget_host/variables_preset_press.rs:169-173 — before extracting anything, compare `crates/op-host-native/src/widget_host/variables_preset_press.rs` and `crates/op-host-web/src/widget_host/variables_preset_press.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 111 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 (5 lines × 5) crates/op-orchestrator/src/geometry_diagnostics_collect.rs:116— crates/op-orchestrator/src/geometry_diagnostics_collect.rs:116-120 | crates/op-orchestrator/src/sidebar_archetype.rs:486-490 | crates/op-orchestrator/src/square_ring_repair.rs:202-206 | crates/op-orchestrator/src/stacked_text_repair.rs:147-151 | crates/op-orchestrator/src/stub_repair.rs:283-287 — before extracting anything, compare `crates/op-orchestrator/src/square_ring_repair.rs` and `crates/op-orchestrator/src/stub_repair.rs` as WHOLE FILES: this scan already matched 5 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 4) crates/op-codegen/src/codegen_tailwind_style.rs:148— crates/op-codegen/src/codegen_tailwind_style.rs:148-152 | crates/op-codegen/src/lib.rs:300-304 | crates/op-editor-core/src/fills/access.rs:98-102 | crates/op-mcp/src/style_ops_tools.rs:465-469 — before extracting anything, compare `crates/op-codegen/src/codegen_tailwind_style.rs` and `crates/op-mcp/src/style_ops_tools.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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, `crates/op-codegen/src/codegen_tailwind_style.rs:147` calls `Line`, `as_ref` and `crates/op-mcp/src/style_ops_tools.rs:464` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 4) crates/op-design-lint/src/node_util.rs:556— crates/op-design-lint/src/node_util.rs:556-560 | crates/op-editor-core/src/property_edit_mutators.rs:744-748 | crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:281-285 | crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:301-305 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-design-lint/src/node_util.rs:556` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/op-design-lint/src/node_util.rs:561` calls `Ellipse`, `unwrap_or`, `Polygon` and `crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:306` 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 × 8) templates/step0/_generators/tpl_bookreview_carousel.py:251— templates/step0/_generators/tpl_bookreview_carousel.py:251-255 | templates/step0/_generators/tpl_cityguide_carousel.py:287-291 | templates/step0/_generators/tpl_datareport_carousel.py:217-221 | templates/step0/_generators/tpl_qa_carousel.py:268-272 | templates/step0/_generators/tpl_story_carousel.py:230-234 | templates/step0/_generators/tpl_toolkit_carousel.py:248-252 | templates/step0/_generators/tpl_tutorial_carousel.py:306-310 | templates/step0/_generators/tpl_yearreview_carousel.py:333-337 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 8 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 (5 lines × 8) templates/step0/_generators/tpl_compare_myth_truth.py:104— templates/step0/_generators/tpl_compare_myth_truth.py:104-108 | templates/step0/_generators/tpl_compare_scenario_guide.py:108-112 | templates/step0/_generators/tpl_compare_spec_table.py:128-132 | templates/step0/_generators/tpl_compare_three_way.py:133-137 | templates/step0/_generators/tpl_infographic_blank_vs_example.py:106-110 | templates/step0/_generators/tpl_infographic_idea_flow.py:91-95 | templates/step0/_generators/tpl_infographic_weekly_review.py:117-121 | templates/step0/_generators/tpl_tutorial_workout.py:137-141 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 8 call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (17 lines × 2 locations) crates/op-host-web/src/op_ck_bridge.js:1266— crates/op-host-web/src/op_ck_bridge.js:1266 · crates/op-host-web/src/op_ck_bridge.js:1285 — both copies are in the same file, so extract the block into 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 locations) packages/op-chrome-extension/design-capture.js:606— packages/op-chrome-extension/design-capture.js:606 · packages/op-chrome-extension/design-evidence.js:233 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication· Duplicated block with local edits (16 matched lines × 2 locations) · ×2
Duplicated block with local edits (16 matched lines × 2 locations) packages/op-chrome-extension/capture.js:210— packages/op-chrome-extension/capture.js:210 · packages/op-chrome-extension/picker.js:294 — the two spans are one implementation copied and then locally edited — 149 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (16 matched lines × 2 locations) packages/op-chrome-extension/popup.js:187— packages/op-chrome-extension/popup.js:187 · packages/op-chrome-extension/popup.js:214 — the two spans are one implementation copied and then locally edited — 80 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (13 lines × 2 locations) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:380— crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:380 · crates/op-host-web/src/op_ck_bridge.js:977 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (13 lines × 2 locations) crates/op-host-web/src/op_ck_bridge.js:761— crates/op-host-web/src/op_ck_bridge.js:761 · crates/op-host-web/src/op_ck_bridge.js:783 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (12 lines × 2 locations) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:253— crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:253 · crates/op-host-web/src/op_ck_bridge.js:1124 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (12 lines × 2 locations) crates/op-host-web/src/op_ck_bridge.js:1778— crates/op-host-web/src/op_ck_bridge.js:1778 · crates/op-host-web/src/op_ck_bridge.js:1791 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication· Duplicated block with local edits (12 matched lines × 2 locations) · ×2
Duplicated block with local edits (12 matched lines × 2 locations) packages/op-web-sdk-react/src/design-view.tsx:25— packages/op-web-sdk-react/src/design-view.tsx:25 · packages/op-web-sdk-vue/src/design-view.ts:21 — the two spans are one implementation copied and then locally edited — 67 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (12 matched lines × 2 locations) packages/scripts/sync-version.mjs:258— packages/scripts/sync-version.mjs:258 · packages/scripts/sync-version.mjs:281 — the two spans are one implementation copied and then locally edited — 90 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Dead file (~6 LoC) packaging/harmony/entry/hvigorfile.ts— no import path from any entry point (19 application, 15 tooling, 35 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~6 LoC) packaging/harmony/hvigorfile.ts— no import path from any entry point (19 application, 15 tooling, 35 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Low contrast colour pair in CSS (3.6:1) packages/op-chrome-extension/popup.css:291— `.btn-primary` sets color: #ffffff on background-color: #1b8fc4 — 3.6:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
op_host_web.__wbg_get_imports (cyclomatic 69) crates/op-host-web/pkg-webgl/op_host_web.js:66— op_host_web.__wbg_get_imports has cyclomatic complexity 69 (threshold 15). Most of this is not in the body itself: 1 of the 69 points is its own statement and the rest belongs to 60 function literals inside it that branch (lines 69, 89, 95, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
SubprocessProvider::send_inner (cyclomatic 61) crates/op-host-services/src/chat_subprocess.rs:294— SubprocessProvider::send_inner has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HomeSurface::hit_test_layout (cyclomatic 54) crates/op-editor-ui/src/widgets/home_surface.rs:405— HomeSurface::hit_test_layout has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Orchestrator::run (cyclomatic 48) crates/op-orchestrator/src/run_orchestrator.rs:23— Orchestrator::run has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_host_web.__wbg_get_imports (cyclomatic 47) crates/op-host-web/pkg-ck/op_host_web.js:31— op_host_web.__wbg_get_imports has cyclomatic complexity 47 (threshold 15). Most of this is not in the body itself: 1 of the 47 points is its own statement and the rest belongs to 40 function literals inside it that branch (lines 49, 55, 783, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
design-capture.collectDesignEvidenceInPage (cyclomatic 47) packages/op-chrome-extension/design-capture.js:19— design-capture.collectDesignEvidenceInPage 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. This shape REPEATS in the file: 2 other methods here (design-capture.collectDesignEvidenceInPage::toHex, design-capture.collectDesignEvidenceInPage::walkRules) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
VariablesPanel::hit_test (cyclomatic 46) crates/op-editor-ui/src/widgets/variables_panel/hit.rs:11— VariablesPanel::hit_test 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.
RuntimeError::safe_diagnostic (cyclomatic 45) crates/op-collab-transport/src/error.rs:305— RuntimeError::safe_diagnostic has cyclomatic complexity 45 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
WorkspaceSurface::hit_test_layout (cyclomatic 42) crates/op-editor-ui/src/widgets/workspace_surface.rs:581— WorkspaceSurface::hit_test_layout 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.
deckkit.audit_document (cyclomatic 39) templates/step0/_generators/deckkit.py:240— deckkit.audit_document 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.
op_ck_bridge.opCkInit.measureParagraph (cyclomatic 39) crates/op-host-web/src/op_ck_bridge.js:1609— op_ck_bridge.opCkInit.measureParagraph 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.
opCkInit.measureParagraph (cyclomatic 39) crates/op-host-web/src/op_ck_bridge.js:1609— opCkInit.measureParagraph 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.
CanvasViewport::paint (cyclomatic 38) crates/op-editor-ui/src/widgets/canvas_viewport.rs:170— CanvasViewport::paint 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.
snapshot-extractor.vectorizeSvg (cyclomatic 38) crates/op-html/assets/snapshot-extractor.js:586— snapshot-extractor.vectorizeSvg 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.
op_preview_core::binding_overlay_apply::apply_value (cyclomatic 37) crates/op-preview-core/src/binding_overlay_apply.rs:12— op_preview_core::binding_overlay_apply::apply_value 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.
op_ck_bridge.opCkInit.drawImageWithOptions (cyclomatic 34) crates/op-host-web/src/op_ck_bridge.js:1353— op_ck_bridge.opCkInit.drawImageWithOptions 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.
opCkInit.drawImageWithOptions (cyclomatic 34) crates/op-host-web/src/op_ck_bridge.js:1353— opCkInit.drawImageWithOptions 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.
design-evidence.sanitizeDesignEvidence (cyclomatic 31) packages/op-chrome-extension/design-evidence.js:125— design-evidence.sanitizeDesignEvidence has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 10 of the 31 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 213, 146, 180, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
bridge.parseInboundFromPage (cyclomatic 29) packages/op-vscode/src/protocol/bridge.ts:58— bridge.parseInboundFromPage 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.
op_ck_bridge.opCkInit.textFirstBaseline (cyclomatic 28) crates/op-host-web/src/op_ck_bridge.js:1504— op_ck_bridge.opCkInit.textFirstBaseline has cyclomatic complexity 28 (threshold 15). Of this number, 16 points are the body's own statements and 12 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
opCkInit.textFirstBaseline (cyclomatic 28) crates/op-host-web/src/op_ck_bridge.js:1504— opCkInit.textFirstBaseline has cyclomatic complexity 28 (threshold 15). Of this number, 16 points are the body's own statements and 12 belong to 4 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ConfiguredBuiltinProvider::send_inner (cyclomatic 26) crates/op-host-services/src/chat_builtin_http.rs:273— ConfiguredBuiltinProvider::send_inner has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
op_opmerge::merge_core (cyclomatic 26) crates/op-opmerge/src/lib.rs:167— op_opmerge::merge_core 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.
BrowserState::handle_action (cyclomatic 25) crates/op-collab-transport/src/discovery_bonjour_browser.rs:251— BrowserState::handle_action 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.
op_engine_napi::action::printable_char (cyclomatic 25) crates/op-engine-napi/src/action.rs:324— op_engine_napi::action::printable_char has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
OpSurfaceViewShellBridge.pollShellAction (cyclomatic 25) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/OpSurfaceViewShellBridge.kt:207— OpSurfaceViewShellBridge.pollShellAction 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.
freshcheck.audit (cyclomatic 25) templates/step0/_generators/qa/freshcheck.py:150— freshcheck.audit 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.
CollabRuntime::route_guest_output_inner (cyclomatic 24) crates/op-collab-host/src/runtime/effects.rs:348— CollabRuntime::route_guest_output_inner has cyclomatic complexity 24 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
SceneTemplatePanel::hit_test (cyclomatic 24) crates/op-editor-ui/src/widgets/scene_template_hit.rs:100— SceneTemplatePanel::hit_test 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.
WriteEvidence::defer_action (cyclomatic 24) crates/op-orchestrator/src/initial_binding_check_actions.rs:215— WriteEvidence::defer_action 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.
generateDesignMd (cyclomatic 24) packages/op-chrome-extension/client.js:287— generateDesignMd has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op_collab::ticket_json::decode_ticket_string (cyclomatic 23) crates/op-collab/src/ticket_json.rs:127— op_collab::ticket_json::decode_ticket_string 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.
ImageSearchSession::poll_into_with_optional_scene (cyclomatic 23) crates/op-host-desktop/src/image_search_session.rs:514— ImageSearchSession::poll_into_with_optional_scene 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.
OpSurfaceViewEditorTouch.editorTouch (cyclomatic 23) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/OpSurfaceViewEditorTouch.kt:45— OpSurfaceViewEditorTouch.editorTouch 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.
op_ck_image_cache.jpegFitsThumbnailBounds (cyclomatic 23) crates/op-host-web/src/op_ck_image_cache.js:22— op_ck_image_cache.jpegFitsThumbnailBounds 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.
AnnotateImage::call (cyclomatic 22) crates/op-mcp/src/image_annotation.rs:36— AnnotateImage::call 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.
cjkcheck.main (cyclomatic 22) templates/step0/_generators/qa/cjkcheck.py:77— cjkcheck.main 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.
picker.startPick (cyclomatic 22) packages/op-chrome-extension/picker.js:46— picker.startPick has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 5 of the 22 points are its own statements and the rest belongs to 6 function items inside it that branch (elementAt, draw, teardown, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
verify-rate-rules.verify_rules (cyclomatic 21) deploy/collab-relay-edge/verify-rate-rules.py:53— verify-rate-rules.verify_rules 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.
figma_temp_worker.opStartFigmaTempImport (cyclomatic 21) crates/op-host-web/src/figma_temp_worker.js:344— figma_temp_worker.opStartFigmaTempImport has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 10 of the 21 points are its own statements and the rest belongs to 3 function items inside it that branch (finish, a function literal at line 388, releaseWorker). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
op_collab_relay_client::session::pump (cyclomatic 20) crates/op-collab-relay-client/src/session.rs:191— op_collab_relay_client::session::pump 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.
op_collab_smoke::fault_owner::retry_exactly_once (cyclomatic 20) crates/op-collab-smoke/src/fault_owner.rs:47— op_collab_smoke::fault_owner::retry_exactly_once has cyclomatic complexity 20 (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.
BuiltInProvider::send (cyclomatic 20) crates/op-host-services/src/chat_runtime.rs:91— BuiltInProvider::send 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.
Validator::action_list (cyclomatic 20) crates/op-orchestrator/src/generated_expression_validation.rs:244— Validator::action_list 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.
TransportConfig::validate (cyclomatic 19) crates/op-collab-transport/src/config.rs:183— TransportConfig::validate 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.
CollabGatePolicy::check (cyclomatic 19) crates/op-editor-core/src/collab_gate.rs:290— CollabGatePolicy::check 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. This is NOT this file's highest cyclomatic complexity: EditorCommand::collab_gate_action (cyclomatic 46) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
OpEngineHost.drainShellActions (cyclomatic 19) packaging/ios/Sources/OpEngineHost.swift:442— OpEngineHost.drainShellActions 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.
collectDesignEvidenceInPage::componentSample (cyclomatic 19) packages/op-chrome-extension/design-capture.js:311— collectDesignEvidenceInPage::componentSample 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.
AnthropicToolCollector::handle (cyclomatic 18) crates/op-ai/src/chat_tool_sse.rs:194— AnthropicToolCollector::handle 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.
ProviderLlm::call (cyclomatic 18) crates/op-engine-ffi/src/editor_chat_hosted_design_llm.rs:50— ProviderLlm::call 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.
ClaudeCodeProvider::send_inner (cyclomatic 18) crates/op-host-services/src/chat_claude.rs:116— ClaudeCodeProvider::send_inner has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
scene_preview_cards.main (cyclomatic 18) templates/step0/_generators/scene_preview_cards.py:313— scene_preview_cards.main 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.
codegen-prompt.parseCodegenOutput (cyclomatic 18) packages/op-vscode/src/vscode/codegen-prompt.ts:36— codegen-prompt.parseCodegenOutput has cyclomatic complexity 18 (threshold 15). Of this number, 9 points are the body's own statements and 9 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
capturePage (cyclomatic 18) packages/op-chrome-extension/capture.js:233— capturePage 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.
SheetParser::at_block (cyclomatic 17) crates/op-html/src/css/cascade_parser.rs:256— SheetParser::at_block 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.
BatchGet::call (cyclomatic 17) crates/op-mcp/src/batch_get.rs:38— BatchGet::call has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: op_mcp::batch_get::node_type (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
op_ck_bridge.opCkMakeRuntimeShader (cyclomatic 17) crates/op-host-web/src/op_ck_bridge.js:178— op_ck_bridge.opCkMakeRuntimeShader has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
snapshot-extractor.inlineSegments (cyclomatic 17) crates/op-html/assets/snapshot-extractor.js:968— snapshot-extractor.inlineSegments has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to one function item inside it that branches (addText). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
i18n.t (cyclomatic 17) packages/op-chrome-extension/i18n.js:242— i18n.t 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.
OpenAiToolCollector::handle (cyclomatic 16) crates/op-ai/src/chat_tool_sse.rs:78— OpenAiToolCollector::handle 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.
MobileHostedDesignHost::pump (cyclomatic 16) crates/op-engine-ffi/src/editor_chat_hosted_design.rs:287— MobileHostedDesignHost::pump 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.
ExportItem::call (cyclomatic 16) crates/op-host-services/src/mcp_serve/export_item_tool.rs:21— ExportItem::call has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Parser::parse_compound (cyclomatic 16) crates/op-html/src/css/selectors_parser.rs:145— Parser::parse_compound has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: op_html::css::selectors_parser::parse_simple_pseudo (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
op_i18n::i18n::plural_category (cyclomatic 16) crates/op-i18n/src/i18n/mod.rs:405— op_i18n::i18n::plural_category 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.
AccountDeletionCoordinator.retry (cyclomatic 16) packaging/ios/Sources/AccountDeletionCoordinator.swift:141— AccountDeletionCoordinator.retry 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.
snapshot-extractor.shapeToPathData (cyclomatic 16) crates/op-html/assets/snapshot-extractor.js:485— snapshot-extractor.shapeToPathData has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
(anonymous) (cyclomatic 16) packages/op-chrome-extension/background.js:431— (anonymous) has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 442, 464). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest. This is NOT this file's highest cyclomatic complexity: failureMessage (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
Orchestrator::run (cognitive 114) crates/op-orchestrator/src/run_orchestrator.rs:23— Orchestrator::run has cognitive complexity 114 (threshold 15). Drivers by points: if/else 39 (76 pts), loops 7 (17 pts), match/switch 5 (15 pts), boolean chains 6 (nesting depth added 57). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VariablesPanel::hit_test (cognitive 96) crates/op-editor-ui/src/widgets/variables_panel/hit.rs:11— VariablesPanel::hit_test has cognitive complexity 96 (threshold 15). Drivers by points: if/else 37 (84 pts), loops 4 (7 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 52). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
opCkInit.measureParagraph (cognitive 92) crates/op-host-web/src/op_ck_bridge.js:1609— opCkInit.measureParagraph has cognitive complexity 92 (threshold 15). Drivers by points: if/else 19 (49 pts), loops 8 (20 pts), ternaries 6 (15 pts), boolean chains 8 (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SubprocessProvider::send_inner (cognitive 82) crates/op-host-services/src/chat_subprocess.rs:294— SubprocessProvider::send_inner has cognitive complexity 82 (threshold 15). Drivers by points: if/else 26 (50 pts), match/switch 14 (23 pts), boolean chains 7, loops 2 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_ck_bridge.opCkInit.measureParagraph (cognitive 78) crates/op-host-web/src/op_ck_bridge.js:1609— op_ck_bridge.opCkInit.measureParagraph has cognitive complexity 78 (threshold 15). Drivers by points: if/else 19 (49 pts), loops 8 (20 pts), boolean chains 8, ternaries 1 (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
collectDesignEvidenceInPage (cognitive 78) packages/op-chrome-extension/design-capture.js:19— collectDesignEvidenceInPage has cognitive complexity 78 (threshold 15). Drivers by points: if/else 76 (143 pts), boolean chains 65, ternaries 15 (26 pts), loops 9 (15 pts), error handling 3 (6 pts), other 2 (nesting depth added 87). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
deckkit.audit_document (cognitive 75) templates/step0/_generators/deckkit.py:240— deckkit.audit_document has cognitive complexity 75 (threshold 15). Drivers by points: if/else 21 (53 pts), boolean chains 12, loops 5 (10 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
design-capture.collectDesignEvidenceInPage::walkRules (cognitive 71) packages/op-chrome-extension/design-capture.js:363— design-capture.collectDesignEvidenceInPage::walkRules has cognitive complexity 71 (threshold 15). Drivers by points: if/else 20 (56 pts), boolean chains 9, loops 2 (4 pts), error handling 1 (2 pts) (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HomeSurface::hit_test_layout (cognitive 70) crates/op-editor-ui/src/widgets/home_surface.rs:405— HomeSurface::hit_test_layout has cognitive complexity 70 (threshold 15). Drivers by points: if/else 36 (49 pts), boolean chains 9, loops 7 (9 pts), match/switch 1 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_web.__wbg_get_imports (cognitive 68) crates/op-host-web/pkg-webgl/op_host_web.js:66— op_host_web.__wbg_get_imports has cognitive complexity 68 (threshold 15). Drivers by points: ternaries 49 (50 pts), error handling 18 (nesting depth added 1). None of this is in the body itself: all 68 points belong to 60 function literals inside it that branch (lines 69, 89, 95, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
op_ck_bridge.opCkInit.drawImageWithOptions (cognitive 53) crates/op-host-web/src/op_ck_bridge.js:1353— op_ck_bridge.opCkInit.drawImageWithOptions has cognitive complexity 53 (threshold 15). Drivers by points: if/else 15 (24 pts), ternaries 6 (13 pts), boolean chains 9, loops 2 (7 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
opCkInit.drawImageWithOptions (cognitive 53) crates/op-host-web/src/op_ck_bridge.js:1353— opCkInit.drawImageWithOptions has cognitive complexity 53 (threshold 15). Drivers by points: if/else 15 (24 pts), ternaries 6 (13 pts), boolean chains 9, loops 2 (7 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
snapshot-extractor.vectorizeSvg (cognitive 49) crates/op-html/assets/snapshot-extractor.js:586— snapshot-extractor.vectorizeSvg has cognitive complexity 49 (threshold 15). Drivers by points: if/else 20 (37 pts), boolean chains 10, loops 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.
ImageSearchSession::poll_into_with_optional_scene (cognitive 48) crates/op-host-desktop/src/image_search_session.rs:514— ImageSearchSession::poll_into_with_optional_scene has cognitive complexity 48 (threshold 15). Drivers by points: if/else 12 (35 pts), boolean chains 7, match/switch 2 (5 pts), loops 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
freshcheck.audit (cognitive 47) templates/step0/_generators/qa/freshcheck.py:150— freshcheck.audit has cognitive complexity 47 (threshold 15). Drivers by points: if/else 12 (33 pts), boolean chains 5, ternaries 3 (5 pts), loops 3 (4 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_host_web.__wbg_get_imports (cognitive 46) crates/op-host-web/pkg-ck/op_host_web.js:31— op_host_web.__wbg_get_imports has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 30, error handling 16. None of this is in the body itself: all 46 points belong to 40 function literals inside it that branch (lines 49, 55, 783, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
OpSurfaceViewEditorTouch.editorTouch (cognitive 40) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/OpSurfaceViewEditorTouch.kt:45— OpSurfaceViewEditorTouch.editorTouch has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (36 pts), boolean chains 3, match/switch 1 (nesting depth added 21). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
OpenAiToolCollector::handle (cognitive 37) crates/op-ai/src/chat_tool_sse.rs:78— OpenAiToolCollector::handle has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (34 pts), loops 1 (3 pts) (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
cjkcheck.main (cognitive 36) templates/step0/_generators/qa/cjkcheck.py:77— cjkcheck.main has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 5 (8 pts), boolean chains 6, ternaries 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.
ConfiguredBuiltinProvider::send_inner (cognitive 34) crates/op-host-services/src/chat_builtin_http.rs:273— ConfiguredBuiltinProvider::send_inner has cognitive complexity 34 (threshold 15). Drivers by points: if/else 20 (23 pts), match/switch 7 (10 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
opCkInit.textFirstBaseline (cognitive 33) crates/op-host-web/src/op_ck_bridge.js:1504— opCkInit.textFirstBaseline has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (15 pts), ternaries 8, boolean chains 7, loops 2 (3 pts) (nesting depth added 4). Of this number, 20 points are the body's own statements and 13 belong to 4 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
design-evidence.sanitizeDesignEvidence (cognitive 32) packages/op-chrome-extension/design-evidence.js:125— design-evidence.sanitizeDesignEvidence has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 12, ternaries 11 (12 pts), if/else 4 (7 pts), loops 1 (nesting depth added 4). Most of this is not in the body itself: 10 of the 32 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 213, 146, 180, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
generateDesignMd (cognitive 32) packages/op-chrome-extension/client.js:287— generateDesignMd has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 6, other 3, ternaries 1 (2 pts), loops 1 (nesting depth added 8). Of this number, 30 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccountDeletionCoordinator.retry (cognitive 31) packaging/ios/Sources/AccountDeletionCoordinator.swift:141— AccountDeletionCoordinator.retry has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (19 pts), ternaries 1 (4 pts), error handling 2 (3 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BatchGet::call (cognitive 29) crates/op-mcp/src/batch_get.rs:38— BatchGet::call has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 7 (9 pts), loops 3 (6 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.
BoundedDocumentReader.read (cognitive 29) packaging/ios/Sources/BoundedDocumentReader.swift:45— BoundedDocumentReader.read has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (24 pts), ternaries 1 (3 pts), boolean chains 1, 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.
op_ck_bridge.opCkInit.textFirstBaseline (cognitive 29) crates/op-host-web/src/op_ck_bridge.js:1504— op_ck_bridge.opCkInit.textFirstBaseline has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 7, ternaries 4, loops 2 (3 pts) (nesting depth added 4). Of this number, 20 points are the body's own statements and 9 belong to 3 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
AnthropicToolCollector::handle (cognitive 28) crates/op-ai/src/chat_tool_sse.rs:194— AnthropicToolCollector::handle has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (23 pts), match/switch 3 (5 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.
op_cli::parse_args (cognitive 28) crates/op-cli/src/main.rs:306— op_cli::parse_args has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 4 (14 pts), if/else 9 (13 pts), loops 1 (nesting depth added 14). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ClaudeCodeProvider::send_inner (cognitive 27) crates/op-host-services/src/chat_claude.rs:116— ClaudeCodeProvider::send_inner has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 6 (10 pts), loops 3 (5 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_util::image_dimensions::xml_attribute (cognitive 27) crates/op-util/src/image_dimensions.rs:234— op_util::image_dimensions::xml_attribute has cognitive complexity 27 (threshold 15). Drivers by points: loops 7 (15 pts), if/else 4 (8 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 13). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
OpSurfaceViewShellBridge.pollShellAction (cognitive 27) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/OpSurfaceViewShellBridge.kt:207— OpSurfaceViewShellBridge.pollShellAction has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 2, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
scene_preview_cards.main (cognitive 27) templates/step0/_generators/scene_preview_cards.py:313— scene_preview_cards.main has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (15 pts), ternaries 3 (6 pts), loops 2 (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.
OpEngineHost.drainShellActions (cognitive 27) packaging/ios/Sources/OpEngineHost.swift:442— OpEngineHost.drainShellActions has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16 (25 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.
Toolbar::hit_test (cognitive 26) crates/op-editor-ui/src/widgets/toolbar.rs:241— Toolbar::hit_test has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (22 pts), match/switch 1 (2 pts), boolean chains 1, 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.
ListUiKits::call (cognitive 26) crates/op-mcp/src/ui_kit_tool.rs:45— ListUiKits::call has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (17 pts), boolean chains 4, loops 2 (3 pts), match/switch 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.
op_ck_image_cache.jpegFitsThumbnailBounds (cognitive 26) crates/op-host-web/src/op_ck_image_cache.js:22— op_ck_image_cache.jpegFitsThumbnailBounds has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 7, loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
capturePage (cognitive 26) packages/op-chrome-extension/capture.js:233— capturePage has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 6 (8 pts), error handling 3 (5 pts), boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check-sw-imports.stripComments (cognitive 25) packages/op-chrome-extension/scripts/check-sw-imports.mjs:44— check-sw-imports.stripComments has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (14 pts), ternaries 2 (6 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous) (cognitive 25) packages/op-chrome-extension/background.js:431— (anonymous) has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 4, error handling 2 (4 pts), ternaries 2 (4 pts) (nesting depth added 6). Most of this is not in the body itself: 7 of the 25 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 442, 464). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
t (cognitive 25) packages/op-chrome-extension/i18n.js:242— t has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 4 (7 pts), boolean chains 4, 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.
CssVariables::generate (cognitive 24) crates/op-codegen/src/lib.rs:61— CssVariables::generate has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 6 (10 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.
GestureTracker::handle (cognitive 24) crates/op-engine-ffi/src/input.rs:208— GestureTracker::handle has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 3 (5 pts), boolean chains 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
AnnotateImage::call (cognitive 24) crates/op-mcp/src/image_annotation.rs:36— AnnotateImage::call has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16 (19 pts), loops 2 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
AuthCodeFormOverlay.submit (cognitive 24) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AuthCodeFormOverlay.kt:324— AuthCodeFormOverlay.submit has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (23 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.
bridge.parseInboundFromPage (cognitive 24) packages/op-vscode/src/protocol/bridge.ts:58— bridge.parseInboundFromPage has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 5, error handling 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuiltInProvider::send (cognitive 23) crates/op-host-services/src/chat_runtime.rs:91— BuiltInProvider::send has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 3 (4 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.
LineStreamChild::kill_graceful (cognitive 23) crates/op-process-io/src/lib.rs:202— LineStreamChild::kill_graceful has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 2 (4 pts) (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
startPick (cognitive 23) packages/op-chrome-extension/picker.js:46— startPick has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 6, loops 3, error handling 1, ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 4 of the 23 points are its own statements and the rest belongs to 9 function items inside it that branch (elementAt, draw, teardown, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
op_hosted_models::stream::pump (cognitive 22) crates/op-hosted-models/src/stream.rs:11— op_hosted_models::stream::pump has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
oplib.text (cognitive 22) templates/step0/_generators/oplib.py:183— oplib.text has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 7 (9 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.
op_ck_bridge.opCkInit.registeredCoverageSegments (cognitive 22) crates/op-host-web/src/op_ck_bridge.js:917— op_ck_bridge.opCkInit.registeredCoverageSegments has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 1 (3 pts), error handling 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.
background.chrome.runtime.onMessage.addListener() (cognitive 22) packages/op-chrome-extension/background.js:431— background.chrome.runtime.onMessage.addListener() has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 4, ternaries 2 (4 pts), error handling 1 (nesting depth added 4). Most of this is not in the body itself: 7 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 442). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
sync-version.skipJsoncValue (cognitive 22) packages/scripts/sync-version.mjs:179— sync-version.skipJsoncValue has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (3 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
opStartFigmaTempImport (cognitive 22) crates/op-host-web/src/figma_temp_worker.js:344— opStartFigmaTempImport has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 8, if/else 8, ternaries 2 (4 pts), error handling 2 (nesting depth added 2). Most of this is not in the body itself: 3 of the 22 points are its own statements and the rest belongs to 9 function items inside it that branch (onmessage, finish, releaseWorker, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
opCkInit.registeredCoverageSegments (cognitive 22) crates/op-host-web/src/op_ck_bridge.js:917— opCkInit.registeredCoverageSegments has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 1 (3 pts), error handling 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.
ThemeTables::build (cognitive 21) crates/op-codegen/src/codegen_tailwind_theme.rs:236— ThemeTables::build has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 3 (4 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.
op_engine_jni::engine_thread::run_loop (cognitive 21) crates/op-engine-jni/src/engine_thread.rs:448— op_engine_jni::engine_thread::run_loop has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (6 pts), match/switch 2 (6 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DependencyState::resolve (cognitive 21) crates/op-mcp/src/codegen_plan_store_dependencies.rs:19— DependencyState::resolve has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 3 (7 pts), match/switch 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
snapshot-extractor.buildImage (cognitive 21) crates/op-html/assets/snapshot-extractor.js:776— snapshot-extractor.buildImage has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 2, loops 1 (2 pts), 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.
snapshot-extractor.inlineSegments (cognitive 21) crates/op-html/assets/snapshot-extractor.js:968— snapshot-extractor.inlineSegments has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 4). Most of this is not in the body itself: 10 of the 21 points are its own statements and the rest belongs to one function item inside it that branches (addText). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
snapshot-extractor.buildInlineRun (cognitive 21) crates/op-html/assets/snapshot-extractor.js:1054— snapshot-extractor.buildInlineRun has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (5 pts), boolean chains 4, 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.
TruncationScanner::step (cognitive 20) crates/op-chrome-extension-core/src/transfer.rs:254— TruncationScanner::step has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (19 pts), match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
UndoLedger::record_commit (cognitive 20) crates/op-collab/src/undo_ledger.rs:92— UndoLedger::record_commit has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Reassembler::push_inner (cognitive 20) crates/op-collab-transport/src/chunk.rs:354— Reassembler::push_inner has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (17 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IncrementalRecordDecoder::poll (cognitive 20) crates/op-collab-transport/src/driver_io.rs:53— IncrementalRecordDecoder::poll has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (13 pts), match/switch 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SecureConnection::receive_transfer_inner (cognitive 20) crates/op-collab-transport/src/runtime.rs:262— SecureConnection::receive_transfer_inner has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 3 (6 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.
MissingFontsPanel::hit_test (cognitive 20) crates/op-editor-ui/src/widgets/missing_fonts_panel.rs:131— MissingFontsPanel::hit_test has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 2 (7 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.
ProviderLlm::call (cognitive 20) crates/op-engine-ffi/src/editor_chat_hosted_design_llm.rs:50— ProviderLlm::call has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, loops 2, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op_render_export::scene_painter::ensure_images_decoded (cognitive 20) crates/op-render-export/src/scene_painter.rs:109— op_render_export::scene_painter::ensure_images_decoded has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (5 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.
verify-rate-rules.verify_rules (cognitive 20) deploy/collab-relay-edge/verify-rate-rules.py:53— verify-rate-rules.verify_rules has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11, boolean chains 5, loops 2, 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.
snapshot-extractor.shapeToPathData (cognitive 20) crates/op-html/assets/snapshot-extractor.js:485— snapshot-extractor.shapeToPathData has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, ternaries 3 (5 pts) (nesting depth added 5). Of this number, 19 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TransportConfig::validate (cognitive 19) crates/op-collab-transport/src/config.rs:183— TransportConfig::validate has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 8 (9 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.
ComponentBrowserPanel::filtered (cognitive 19) crates/op-editor-ui/src/widgets/component_browser_panel.rs:290— ComponentBrowserPanel::filtered has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
McpLiveServer::pump (cognitive 19) crates/op-host-services/src/mcp_live.rs:239— McpLiveServer::pump has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (16 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CreateGenerator::call (cognitive 19) crates/op-mcp/src/generator_tools.rs:142— CreateGenerator::call has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 7 (13 pts), if/else 3 (6 pts) (nesting depth added 9). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Kit.chart_bars (cognitive 19) templates/step0/_generators/appkit.py:250— Kit.chart_bars has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 6 (14 pts), boolean chains 2, if/else 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.
popup.onDownload (cognitive 19) packages/op-chrome-extension/popup.js:308— popup.onDownload has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 7, ternaries 1 (3 pts), 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.
SignerConfig::validate (cognitive 18) crates/op-collab-relay-locator-hsm/src/config.rs:63— SignerConfig::validate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, 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.
CkInner::repaint (cognitive 18) crates/op-host-web/src/canvaskit/inner.rs:34— CkInner::repaint has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (18 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SearchAllUniqueProperties::call (cognitive 18) crates/op-mcp/src/style_ops_tools.rs:37— SearchAllUniqueProperties::call has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (4 pts), match/switch 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpSurfaceView.surfaceCreated (cognitive 18) packaging/android/app/src/main/kotlin/tech/zseven/openpencil/OpSurfaceView.kt:243— OpSurfaceView.surfaceCreated has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 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.
snapshot-extractor.buildTextLines (cognitive 18) crates/op-html/assets/snapshot-extractor.js:359— snapshot-extractor.buildTextLines has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 5, 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.
client.readBoundedDesignResponse (cognitive 18) packages/op-chrome-extension/client.js:180— client.readBoundedDesignResponse has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5, loops 1, 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.
CollabJwksCache::verification_key_locked (cognitive 17) crates/op-auth-bridge/src/collab_jwks_cache.rs:276— CollabJwksCache::verification_key_locked has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 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.
op_builtin_model_discovery::parse_catalog (cognitive 17) crates/op-builtin-model-discovery/src/lib.rs:320— op_builtin_model_discovery::parse_catalog has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, loops 1, match/switch 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.
GuestRelayRuntime::start (cognitive 17) crates/op-collab-host/src/runtime/relay/guest_runtime.rs:112— GuestRelayRuntime::start has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), match/switch 3 (5 pts), loops 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CollabGatePolicy::check (cognitive 17) crates/op-editor-core/src/collab_gate.rs:290— CollabGatePolicy::check has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 2, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MobileDock::paint (cognitive 17) crates/op-editor-ui/src/widgets/mobile_chrome.rs:388— MobileDock::paint has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Emitter::emit (cognitive 17) crates/op-host-services/src/export_pptx.rs:212— Emitter::emit has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 3 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConnectionDriver::poll_write_once (cognitive 16) crates/op-collab-transport/src/driver.rs:389— ConnectionDriver::poll_write_once has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileMenu::hit (cognitive 16) crates/op-editor-ui/src/widgets/file_menu.rs:309— FileMenu::hit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4, 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.
MobileChatHost::launch_if_pending (cognitive 16) crates/op-engine-ffi/src/editor_chat.rs:238— MobileChatHost::launch_if_pending has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MobileCodegenHost::launch_if_pending (cognitive 16) crates/op-engine-ffi/src/editor_codegen.rs:178— MobileCodegenHost::launch_if_pending has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), match/switch 3 (7 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Session::new (cognitive 16) crates/op-engine-ffi/src/lifecycle.rs:93— Session::new has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
op_git::remote::build_callbacks (cognitive 16) crates/op-git/src/remote.rs:456— op_git::remote::build_callbacks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 2 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ImageDecodeHost::pump (cognitive 16) crates/op-host-desktop/src/image_decode_host.rs:122— ImageDecodeHost::pump has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (3 pts), match/switch 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.
ChatVisionJudge::judge_one (cognitive 16) crates/op-host-services/src/image_relevance_judge.rs:355— ChatVisionJudge::judge_one has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), match/switch 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
AccountDeletionStore.validateLocation (cognitive 16) packaging/ios/Sources/AccountDeletionState.swift:134— AccountDeletionStore.validateLocation has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, error handling 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.
op_ck_bridge.opCkParseFontFamilyStack (cognitive 16) crates/op-host-web/src/op_ck_bridge.js:74— op_ck_bridge.opCkParseFontFamilyStack has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, loops 1 (nesting depth added 3). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
op_ck_bridge.opCkMakeRuntimeShader (cognitive 16) crates/op-host-web/src/op_ck_bridge.js:178— op_ck_bridge.opCkMakeRuntimeShader has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (6 pts), boolean chains 3, if/else 2 (3 pts), loops 2 (3 pts), 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.
codegen-prompt.parseCodegenOutput (cognitive 16) packages/op-vscode/src/vscode/codegen-prompt.ts:36— codegen-prompt.parseCodegenOutput has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 4, error handling 1, ternaries 1. Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 53). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D4 · Code Duplication· Near-duplicate member family (5 members, 11 shared lines) · ×1
Near-duplicate member family (5 members, 11 shared lines) crates/op-codegen/src/codegen_tailwind_style.rs:114— crates/op-codegen/src/codegen_tailwind_style.rs:114-137 | crates/op-codegen/src/lib.rs:255-277 | crates/op-design-lint/src/node_util.rs:413-435 | crates/op-editor-core/src/fills/access.rs:12-34 | crates/op-mcp/src/style_ops_tools.rs:432-454 — These 5 members are variants of one another: a block of 11 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 3 shared lines) · ×1
Near-duplicate member family (3 members, 3 shared lines) crates/op-editor-ui/src/svg_export/transform.rs:142— crates/op-editor-ui/src/svg_export/transform.rs:142-155 | crates/op-editor-ui/src/widgets/canvas_viewport_layer_bounds.rs:325-369 | crates/op-editor-ui/src/widgets/canvas_viewport_layer_bounds.rs:375-430 — These 3 members are variants of one another: a block of 3 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 (153 shared lines) crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:83— crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:83-412 | crates/op-chat-agent/src/chat_agent_loop/openai.rs:40-375 — These two members are variants of one another: 153 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 (64 shared lines) crates/op-collab-host/src/runtime/network/connection.rs:48— crates/op-collab-host/src/runtime/network/connection.rs:48-186 | crates/op-collab-host/src/runtime/network/connection.rs:195-353 — These two members are variants of one another: 64 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (47 shared lines) crates/op-host-native/src/widget_host/variables_panel_row_press.rs:243— crates/op-host-native/src/widget_host/variables_panel_row_press.rs:243-361 | crates/op-host-web/src/widget_host/variables_panel_rows.rs:218-311 — These two members are variants of one another: 47 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (41 shared lines) crates/op-editor-core/src/svg_import/path_data.rs:12— crates/op-editor-core/src/svg_import/path_data.rs:12-192 | crates/op-editor-core/src/svg_path_data.rs:55-168 — These two members are variants of one another: 41 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (35 shared lines) crates/op-codegen/src/codegen_html.rs:40— crates/op-codegen/src/codegen_html.rs:40-134 | crates/op-codegen/src/codegen_targets.rs:294-381 — These two members are variants of one another: 35 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (34 shared lines) crates/op-html/src/project_zip.rs:190— crates/op-html/src/project_zip.rs:190-287 | crates/op-html/src/project_zip_range.rs:163-326 — These two members are variants of one another: 34 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 (33 shared lines) crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:34— crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:34-137 | crates/op-editor-ui/src/widgets/property_panel_stroke.rs:299-362 — These two members are variants of one another: 33 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 (31 shared lines) crates/op-editor-core/src/instance_override.rs:91— crates/op-editor-core/src/instance_override.rs:91-154 | crates/op-editor-core/src/ref_resolve.rs:225-321 — These two members are variants of one another: 31 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Edited copy of a member (160 corresponding lines) · ×1
Edited copy of a member (160 corresponding lines) crates/op-engine-ffi/src/editor_chat.rs:491— crates/op-engine-ffi/src/editor_chat.rs:491-650 | crates/op-host-desktop/src/chat_session.rs:295-494 — These two members are one piece of code written twice and then edited apart: 160 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (127 corresponding lines) · ×1
Edited copy of a member (127 corresponding lines) crates/op-host-native/src/widget_host/workspace.rs:124— crates/op-host-native/src/widget_host/workspace.rs:124-276 | crates/op-host-web/src/widget_host/studio_workspace.rs:107-233 — These two members are one piece of code written twice and then edited apart: 127 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (99 corresponding lines) · ×1
Edited copy of a member (99 corresponding lines) crates/op-figma/src/image_resolver.rs:220— crates/op-figma/src/image_resolver.rs:220-326 | crates/op-host-desktop/src/figma_import_session/image_sources.rs:152-250 — These two members are one piece of code written twice and then edited apart: 99 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (109 corresponding lines) · ×1
Edited copy of a member (109 corresponding lines) crates/op-editor-core/src/prompt_center_catalog.rs:287— crates/op-editor-core/src/prompt_center_catalog.rs:287-395 | crates/op-editor-core/src/scene_template_catalog.rs:456-572 — These two members are one piece of code written twice and then edited apart: 109 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (86 corresponding lines) · ×1
Edited copy of a member (86 corresponding lines) crates/op-ai-skills/src/resolve.rs:51— crates/op-ai-skills/src/resolve.rs:51-161 | crates/op-orchestrator/src/prompt_style_skills.rs:283-368 — These two members are one piece of code written twice and then edited apart: 86 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (84 corresponding lines) · ×1
Edited copy of a member (84 corresponding lines) crates/op-editor-ui/src/widgets/collab_panel_interaction.rs:11— crates/op-editor-ui/src/widgets/collab_panel_interaction.rs:11-111 | crates/op-editor-ui/src/widgets/collab_panel_interaction.rs:115-198 — These two members are one piece of code written twice and then edited apart: 84 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (51 corresponding lines) · ×1
Edited copy of a member (51 corresponding lines) crates/op-host-services/src/doc_io/clean_copy.rs:20— crates/op-host-services/src/doc_io/clean_copy.rs:20-70 | crates/op-host-services/src/doc_io/clean_copy.rs:81-132 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (67 corresponding lines) · ×1
Edited copy of a member (67 corresponding lines) crates/op-host-services/src/chat_spawn.rs:130— crates/op-host-services/src/chat_spawn.rs:130-196 | crates/op-host-services/src/cli_probe_support.rs:50-131 — These two members are one piece of code written twice and then edited apart: 67 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 70+ corresponding lines) · ×1
Edited copies of one member (3 members, 70+ corresponding lines) crates/op-editor-ui/src/widgets/property_panel_inputs.rs:230— crates/op-editor-ui/src/widgets/property_panel_inputs.rs:230-303 | crates/op-editor-ui/src/widgets/property_panel_inputs.rs:344-413 | crates/op-editor-ui/src/widgets/property_panel_inputs.rs:459-546 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 70 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (53 corresponding lines) · ×1
Edited copy of a member (53 corresponding lines) crates/op-host-native/src/widget_host/workspace.rs:627— crates/op-host-native/src/widget_host/workspace.rs:627-699 | crates/op-host-web/src/widget_host/studio_workspace_run.rs:226-278 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (46 corresponding lines) · ×1
Edited copy of a member (46 corresponding lines) crates/op-orchestrator/src/finalize_enforce_status_bar.rs:97— crates/op-orchestrator/src/finalize_enforce_status_bar.rs:97-144 | crates/op-orchestrator/src/unify_shared_status_bar.rs:160-205 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (49 corresponding lines) · ×1
Edited copy of a member (49 corresponding lines) crates/op-orchestrator/src/finalize_enforce_status_bar.rs:184— crates/op-orchestrator/src/finalize_enforce_status_bar.rs:184-232 | crates/op-orchestrator/src/finalize_enforce_status_bar.rs:235-297 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (54 corresponding lines) · ×1
Edited copy of a member (54 corresponding lines) crates/op-host-native/src/widget_host/slides_panel.rs:333— crates/op-host-native/src/widget_host/slides_panel.rs:333-386 | crates/op-host-web/src/widget_host/slides_panel.rs:242-311 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 43+ corresponding lines) · ×1
Edited copies of one member (3 members, 43+ corresponding lines) crates/op-chat-agent/src/chat_agent_loop.rs:399— crates/op-chat-agent/src/chat_agent_loop.rs:399-441 | crates/op-engine-ffi/src/editor_chat_turn.rs:246-293 | crates/op-host-services/src/chat_builtin_http_wire.rs:34-86 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 43 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 41+ corresponding lines) · ×1
Edited copies of one member (3 members, 41+ corresponding lines) packaging/ios/Sources/DocumentExportCoordinator.swift:226— packaging/ios/Sources/DocumentExportCoordinator.swift:226-266 | packaging/ios/Sources/DocumentSaveCoordinator.swift:389-429 | packaging/ios/Sources/ImageImportCoordinator.swift:144-193 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 41 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (45 corresponding lines) · ×1
Edited copy of a member (45 corresponding lines) crates/op-editor-core/src/command_layout_prop.rs:543— crates/op-editor-core/src/command_layout_prop.rs:543-587 | crates/op-editor-core/src/command_layout_prop.rs:589-633 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 25+ corresponding lines) · ×1
Edited copies of one member (5 members, 25+ corresponding lines) crates/op-host-services/src/chat_system_prompt.rs:193— crates/op-host-services/src/chat_system_prompt.rs:193-218 | crates/op-mcp/src/batch_get.rs:434-458 | crates/op-mcp/src/open_document.rs:161-185 | crates/op-orchestrator/src/validation_dump.rs:241-265 | crates/op-orchestrator/src/validation_fixes_b3.rs:489-513 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 22+ corresponding lines) · ×1
Edited copies of one member (6 members, 22+ corresponding lines) crates/op-engine-jni/src/bindings_editor.rs:65— crates/op-engine-jni/src/bindings_editor.rs:65-89 | crates/op-engine-jni/src/bindings_editor.rs:109-131 | crates/op-engine-jni/src/bindings_editor.rs:142-172 | crates/op-engine-jni/src/bindings_editor.rs:193-217 | crates/op-engine-jni/src/bindings_editor.rs:361-382 | crates/op-engine-jni/src/bindings_editor.rs:417-439 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 36+ corresponding lines) · ×1
Edited copies of one member (3 members, 36+ corresponding lines) crates/op-host-services/src/design_session.rs:54— crates/op-host-services/src/design_session.rs:54-91 | crates/op-host-services/src/design_session.rs:313-348 | crates/op-host-services/src/design_variants.rs:43-78 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 36 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 39+ corresponding lines) · ×1
Edited copies of one member (3 members, 39+ corresponding lines) crates/op-host-services/src/cli_provider_probe.rs:54— crates/op-host-services/src/cli_provider_probe.rs:54-104 | crates/op-host-services/src/cli_provider_probe.rs:112-157 | crates/op-host-services/src/cli_provider_probe.rs:219-257 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 39 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 35+ corresponding lines) · ×1
Edited copies of one member (3 members, 35+ corresponding lines) crates/op-host-services/src/cli_model_discovery.rs:59— crates/op-host-services/src/cli_model_discovery.rs:59-93 | crates/op-host-services/src/cli_model_discovery.rs:134-168 | crates/op-host-services/src/model_discovery.rs:383-421 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 35 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 31+ corresponding lines) · ×1
Edited copies of one member (4 members, 31+ corresponding lines) templates/step0/_generators/tpl_tutorial_photo.py:308— templates/step0/_generators/tpl_tutorial_photo.py:308-348 | templates/step0/_generators/tpl_tutorial_skincare.py:259-289 | templates/step0/_generators/tpl_tutorial_storage.py:168-209 | templates/step0/_generators/tpl_tutorial_storage.py:269-299 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 31 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 26+ corresponding lines) · ×1
Edited copies of one member (3 members, 26+ corresponding lines) crates/op-editor-ui/src/widgets/design_md_line_cache.rs:74— crates/op-editor-ui/src/widgets/design_md_line_cache.rs:74-102 | crates/op-editor-ui/src/widgets/icon_catalog.rs:173-203 | crates/op-editor-ui/src/widgets/layer_panel_cache.rs:201-226 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 23+ corresponding lines) · ×1
Edited copies of one member (5 members, 23+ corresponding lines) crates/op-mcp/src/scalar_vars.rs:30— crates/op-mcp/src/scalar_vars.rs:30-64 | crates/op-mcp/src/scalar_vars.rs:99-121 | crates/op-mcp/src/scalar_vars.rs:141-176 | crates/op-mcp/src/write_tools_variables.rs:26-54 | crates/op-mcp/src/write_tools_variables.rs:67-98 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 25+ corresponding lines) · ×1
Edited copies of one member (4 members, 25+ corresponding lines) crates/op-host-web/src/live_sync.rs:92— crates/op-host-web/src/live_sync.rs:92-116 | crates/op-host-web/src/live_sync.rs:121-145 | crates/op-host-web/src/live_sync.rs:151-176 | crates/op-host-web/src/web_image_panel.rs:376-401 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 30+ corresponding lines) · ×1
Edited copies of one member (3 members, 30+ corresponding lines) templates/step0/_generators/tpl_story_carousel.py:342— templates/step0/_generators/tpl_story_carousel.py:342-378 | templates/step0/_generators/tpl_tutorial_carousel.py:362-391 | templates/step0/_generators/tpl_yearreview_carousel.py:508-539 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 30 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 21+ corresponding lines) · ×1
Edited copies of one member (4 members, 21+ corresponding lines) crates/op-engine-ffi/src/editor.rs:280— crates/op-engine-ffi/src/editor.rs:280-303 | crates/op-engine-ffi/src/editor.rs:316-339 | crates/op-engine-ffi/src/editor_pointer.rs:132-152 | crates/op-engine-ffi/src/editor_transform.rs:77-103 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 34+ corresponding lines) · ×1
Edited copies of one member (3 members, 34+ corresponding lines) templates/step0/_generators/tpl_cityguide_carousel.py:336— templates/step0/_generators/tpl_cityguide_carousel.py:336-371 | templates/step0/_generators/tpl_story_carousel.py:391-426 | templates/step0/_generators/tpl_yearreview_carousel.py:470-503 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 34 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 9+ corresponding lines) · ×1
Edited copies of one member (6 members, 9+ corresponding lines) templates/step0/_generators/tpl_card_daily.py:148— templates/step0/_generators/tpl_card_daily.py:148-166 | templates/step0/_generators/tpl_card_notice.py:206-220 | templates/step0/_generators/tpl_card_price.py:187-196 | templates/step0/_generators/tpl_card_quote.py:161-172 | templates/step0/_generators/tpl_card_spine.py:213-221 | templates/step0/_generators/tpl_quote_card.py:171-198 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (8 members, 6+ corresponding lines) · ×1
Edited copies of one member (8 members, 6+ corresponding lines) templates/step0/_generators/tpl_compare_do_dont.py:293— templates/step0/_generators/tpl_compare_do_dont.py:293-298 | templates/step0/_generators/tpl_compare_pricing_tiers.py:247-252 | templates/step0/_generators/tpl_compare_time_shift.py:229-235 | templates/step0/_generators/tpl_compare_tradeoff_scale.py:214-219 | templates/step0/_generators/tpl_compare_version_diff.py:195-200 | templates/step0/_generators/tpl_tutorial_onboarding.py:216-221 | templates/step0/_generators/tpl_tutorial_recipe.py:223-228 | templates/step0/_generators/tpl_tutorial_software.py:221-226 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 22+ corresponding lines) · ×1
Edited copies of one member (3 members, 22+ corresponding lines) crates/op-editor-core/src/state.rs:362— crates/op-editor-core/src/state.rs:362-383 | crates/op-figma/src/clipboard.rs:709-730 | crates/op-figma/src/node_mapper.rs:46-67 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 17+ corresponding lines) · ×1
Edited copies of one member (6 members, 17+ corresponding lines) crates/op-editor-core/src/command_layout_prop.rs:374— crates/op-editor-core/src/command_layout_prop.rs:374-391 | crates/op-editor-core/src/command_layout_prop.rs:393-409 | crates/op-editor-core/src/command_layout_prop.rs:411-427 | crates/op-editor-core/src/command_layout_prop.rs:429-445 | crates/op-editor-core/src/command_layout_prop.rs:447-463 | crates/op-editor-core/src/command_layout_prop.rs:465-481 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 8+ corresponding lines) · ×1
Edited copies of one member (5 members, 8+ corresponding lines) crates/op-editor-ui/src/widgets/agent_settings_account.rs:278— crates/op-editor-ui/src/widgets/agent_settings_account.rs:278-286 | crates/op-editor-ui/src/widgets/ai_chat_mcp_notice.rs:84-91 | crates/op-editor-ui/src/widgets/login_modal.rs:166-174 | crates/op-editor-ui/src/widgets/panel_control_metrics.rs:114-122 | crates/op-preview-core/src/mode_transition.rs:182-190 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 11+ corresponding lines) · ×1
Edited copies of one member (5 members, 11+ corresponding lines) crates/op-ai-skills/src/color/oklch.rs:108— crates/op-ai-skills/src/color/oklch.rs:108-119 | crates/op-design-lint/src/color.rs:17-28 | crates/op-editor-ui/src/widgets/canvas_agent_cursor.rs:280-291 | crates/op-orchestrator/src/cleanup_root_and_nav.rs:383-395 | crates/op-orchestrator/src/role_defaults.rs:143-153 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 16+ corresponding lines) · ×1
Edited copies of one member (5 members, 16+ corresponding lines) crates/op-host-web/src/canvaskit/ops.rs:68— crates/op-host-web/src/canvaskit/ops.rs:68-83 | crates/op-host-web/src/canvaskit/ops.rs:175-195 | crates/op-host-web/src/canvaskit/ops.rs:231-250 | crates/op-host-web/src/canvaskit/ops.rs:290-311 | crates/op-host-web/src/canvaskit/ops.rs:334-350 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 17+ corresponding lines) · ×1
Edited copies of one member (4 members, 17+ corresponding lines) crates/op-host-web/src/canvaskit/ops.rs:116— crates/op-host-web/src/canvaskit/ops.rs:116-134 | crates/op-host-web/src/canvaskit/ops.rs:146-163 | crates/op-host-web/src/canvaskit/ops.rs:481-497 | crates/op-host-web/src/canvaskit/ops.rs:510-528 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 7+ corresponding lines) · ×1
Edited copies of one member (5 members, 7+ corresponding lines) crates/op-orchestrator/src/geometry_value_readers.rs:83— crates/op-orchestrator/src/geometry_value_readers.rs:83-89 | crates/op-orchestrator/src/role_layout_post_pass.rs:8-14 | crates/op-orchestrator/src/role_layout_post_pass.rs:24-30 | crates/op-orchestrator/src/spacing_repair.rs:282-288 | crates/op-orchestrator/src/stacked_text_repair.rs:123-130 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 6+ corresponding lines) · ×1
Edited copies of one member (6 members, 6+ corresponding lines) crates/op-editor-ui/src/widgets/agent_settings_panel_geometry.rs:156— crates/op-editor-ui/src/widgets/agent_settings_panel_geometry.rs:156-165 | crates/op-editor-ui/src/widgets/ai_chat_model_picker.rs:341-349 | crates/op-editor-ui/src/widgets/ai_chat_panel.rs:356-363 | crates/op-editor-ui/src/widgets/missing_fonts_panel.rs:76-81 | crates/op-editor-ui/src/widgets/mobile_chrome.rs:537-543 | crates/op-editor-ui/src/widgets/slides_panel_tabs.rs:272-278 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 4+ corresponding lines) · ×1
Edited copies of one member (7 members, 4+ corresponding lines) templates/step0/_generators/tpl_card_daily.py:81— templates/step0/_generators/tpl_card_daily.py:81-84 | templates/step0/_generators/tpl_card_metric.py:94-97 | templates/step0/_generators/tpl_card_notice.py:98-101 | templates/step0/_generators/tpl_card_price.py:101-104 | templates/step0/_generators/tpl_card_quote.py:84-87 | templates/step0/_generators/tpl_carousel_coffee_world.py:116-119 | templates/step0/_generators/tpl_tutorial_focus_mode.py:105-108 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (8 members, 3+ corresponding lines) · ×1
Edited copies of one member (8 members, 3+ corresponding lines) templates/step0/_generators/tpl_bookreview_carousel.py:146— templates/step0/_generators/tpl_bookreview_carousel.py:146-148 | templates/step0/_generators/tpl_cityguide_carousel.py:160-162 | templates/step0/_generators/tpl_datareport_carousel.py:151-153 | templates/step0/_generators/tpl_opinion_carousel.py:158-160 | templates/step0/_generators/tpl_qa_carousel.py:149-151 | templates/step0/_generators/tpl_story_carousel.py:151-153 | templates/step0/_generators/tpl_tutorial_carousel.py:148-150 | templates/step0/_generators/tpl_yearreview_carousel.py:198-200 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
Duplicated block (68–81 lines × 2) crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:104— crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:104-184 | crates/op-chat-agent/src/chat_agent_loop/openai.rs:67-134 — before extracting anything, compare `crates/op-chat-agent/src/chat_agent_loop/anthropic.rs` and `crates/op-chat-agent/src/chat_agent_loop/openai.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 175 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:104` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (54–58 lines × 2) crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs:389— crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs:389-442 | crates/op-editor-ui/src/widgets/home_surface_paint_panels.rs:123-180 — before extracting anything, compare `crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs` and `crates/op-editor-ui/src/widgets/home_surface_paint_panels.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 197 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs:389` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/op-editor-ui/src/widgets/home_surface_paint_panels.rs:181` calls `Some` and `crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs:443` 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 (43 lines × 2) crates/op-editor-ui/src/widgets/home_surface_paint.rs:270— crates/op-editor-ui/src/widgets/home_surface_paint.rs:270-312 | crates/op-editor-ui/src/widgets/workspace_surface_paint.rs:334-376 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/home_surface_paint.rs:270` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (41 lines × 2) crates/op-editor-ui/src/widgets/drag_flow.rs:454— crates/op-editor-ui/src/widgets/drag_flow.rs:454-494 | crates/op-editor-ui/src/widgets/drag_flow_index.rs:344-384 — before extracting anything, compare `crates/op-editor-ui/src/widgets/drag_flow.rs` and `crates/op-editor-ui/src/widgets/drag_flow_index.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/drag_flow.rs:454` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (39–41 lines × 2) crates/op-mcp/src/write_tools.rs:67— crates/op-mcp/src/write_tools.rs:67-105 | crates/op-mcp/src/write_tools.rs:541-581 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-mcp/src/write_tools.rs:67` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (39 lines × 2) crates/op-host-native/src/widget_host/preview_slideshow.rs:157— crates/op-host-native/src/widget_host/preview_slideshow.rs:157-195 | crates/op-host-web/src/widget_host/preview_slideshow.rs:312-350 — before extracting anything, compare `crates/op-host-native/src/widget_host/preview_slideshow.rs` and `crates/op-host-web/src/widget_host/preview_slideshow.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 171 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (35–36 lines × 3) crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:178— crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:178-212 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:301-336 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:367-401 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:178` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (34–36 lines × 2) crates/op-host-services/src/doc_io/clean_copy.rs:21— crates/op-host-services/src/doc_io/clean_copy.rs:21-56 | crates/op-host-services/src/doc_io/clean_copy.rs:82-115 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-services/src/doc_io/clean_copy.rs:21` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (33–35 lines × 2) crates/op-host-native/src/widget_host/input.rs:249— crates/op-host-native/src/widget_host/input.rs:249-283 | crates/op-host-web/src/widget_host/node_drag.rs:145-177 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-native/src/widget_host/input.rs:249` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (31–33 lines × 2) crates/op-host-native/src/widget_host/variables_preset_press.rs:138— crates/op-host-native/src/widget_host/variables_preset_press.rs:138-170 | crates/op-host-web/src/widget_host/variables_preset_press.rs:88-118 — before extracting anything, compare `crates/op-host-native/src/widget_host/variables_preset_press.rs` and `crates/op-host-web/src/widget_host/variables_preset_press.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-native/src/widget_host/variables_preset_press.rs:138` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (4–32 lines × 4) crates/op-editor-ui/src/widgets/property_panel_inputs.rs:272— crates/op-editor-ui/src/widgets/property_panel_inputs.rs:272-303 | crates/op-editor-ui/src/widgets/property_panel_inputs.rs:370-401 | crates/op-editor-ui/src/widgets/property_panel_inputs.rs:498-529 | crates/op-editor-ui/src/widgets/property_panel_layer.rs:237-240 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/property_panel_inputs.rs:272` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/op-editor-ui/src/widgets/property_panel_inputs.rs:530` calls `Some` and `crates/op-editor-ui/src/widgets/property_panel_inputs.rs:402` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (31–32 lines × 2) crates/op-collab-relay-server/src/connection.rs:546— crates/op-collab-relay-server/src/connection.rs:546-577 | crates/op-collab-relay-server/src/connection_wait.rs:97-127 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-collab-relay-server/src/connection.rs:546` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (27–32 lines × 2) crates/op-editor-ui/src/widgets/scene_template_card_paint.rs:90— crates/op-editor-ui/src/widgets/scene_template_card_paint.rs:90-121 | crates/op-editor-ui/src/widgets/scene_template_card_paint.rs:498-524 — both copies are in the same file, so extract the block into 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–32 lines × 2) crates/op-host-native/src/widget_host/workspace.rs:201— crates/op-host-native/src/widget_host/workspace.rs:201-232 | crates/op-host-web/src/widget_host/studio_workspace.rs:177-206 — before extracting anything, compare `crates/op-host-native/src/widget_host/workspace.rs` and `crates/op-host-web/src/widget_host/studio_workspace.rs` 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. 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 (17–32 lines × 2) crates/op-host-native/src/widget_host/workspace.rs:634— crates/op-host-native/src/widget_host/workspace.rs:634-665 | crates/op-host-web/src/widget_host/studio_workspace_run.rs:232-248 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-native/src/widget_host/workspace.rs:634` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (29–31 lines × 2) crates/op-orchestrator/src/finalize_enforce_status_bar.rs:98— crates/op-orchestrator/src/finalize_enforce_status_bar.rs:98-128 | crates/op-orchestrator/src/unify_shared_status_bar.rs:161-189 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-orchestrator/src/finalize_enforce_status_bar.rs:98` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (28–30 lines × 2) crates/op-editor-core/src/svg_import/lexer.rs:11— crates/op-editor-core/src/svg_import/lexer.rs:11-40 | crates/op-editor-core/src/svg_import/xml.rs:96-123 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/svg_import/lexer.rs:11` it does not close everything it opens, so those exact lines 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–30 lines × 2) crates/op-orchestrator/src/plan.rs:526— crates/op-orchestrator/src/plan.rs:526-555 | crates/op-orchestrator/src/plan_fallback_card.rs:24-52 — before extracting anything, compare `crates/op-orchestrator/src/plan.rs` and `crates/op-orchestrator/src/plan_fallback_card.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-orchestrator/src/plan.rs:526` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24–29 lines × 2) crates/op-engine-ffi/src/editor_chat_design.rs:100— crates/op-engine-ffi/src/editor_chat_design.rs:100-123 | crates/op-host-desktop/src/chat_session_launch.rs:692-720 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-engine-ffi/src/editor_chat_design.rs:100` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (27–29 lines × 2) crates/op-host-services/src/chat_builtin_http.rs:315— crates/op-host-services/src/chat_builtin_http.rs:315-341 | crates/op-host-services/src/chat_runtime.rs:106-134 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-services/src/chat_builtin_http.rs: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.
Duplicated block (29 lines × 2) crates/op-image-enrich/src/apply.rs:78— crates/op-image-enrich/src/apply.rs:78-106 | crates/op-image-enrich/src/apply.rs:108-136 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (20–28 lines × 2) crates/op-image-enrich/src/net/downscale.rs:196— crates/op-image-enrich/src/net/downscale.rs:196-215 | crates/op-image-enrich/src/net/downscale.rs:245-272 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-image-enrich/src/net/downscale.rs:196` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (22–27 lines × 2) crates/op-editor-ui/src/widgets/canvas_viewport_paint.rs:372— crates/op-editor-ui/src/widgets/canvas_viewport_paint.rs:372-393 | crates/op-editor-ui/src/widgets/canvas_viewport_paint.rs:477-503 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-editor-ui/src/widgets/canvas_viewport_paint.rs:475` calls `paint_widget_visual` and `crates/op-editor-ui/src/widgets/canvas_viewport_paint.rs:366` 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 (27 lines × 2) crates/op-host-desktop/src/app_handler/scheduling.rs:111— crates/op-host-desktop/src/app_handler/scheduling.rs:111-137 | crates/op-host-desktop/src/app_handler/scheduling.rs:190-216 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-host-desktop/src/app_handler/scheduling.rs:110` calls `has_pending_remote_image_requests` and `crates/op-host-desktop/src/app_handler/scheduling.rs:189` 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 (26 lines × 2) crates/op-auth-bridge/src/collab_claims.rs:354— crates/op-auth-bridge/src/collab_claims.rs:354-379 | crates/op-auth-bridge/src/collab_relay_token.rs:168-193 — 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 (24–26 lines × 2) crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs:362— crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs:362-385 | crates/op-editor-ui/src/widgets/home_surface_paint_panels.rs:81-106 — before extracting anything, compare `crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs` and `crates/op-editor-ui/src/widgets/home_surface_paint_panels.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 197 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs:362` it begins part-way through the construct above it, so those 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 (25–26 lines × 2) crates/op-editor-ui/src/widgets/property_panel_fill_image_body.rs:18— crates/op-editor-ui/src/widgets/property_panel_fill_image_body.rs:18-42 | crates/op-editor-ui/src/widgets/property_panel_image_node.rs:156-181 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/property_panel_fill_image_body.rs:18` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21–25 lines × 2) crates/op-editor-ui/src/widgets/property_panel_text.rs:168— crates/op-editor-ui/src/widgets/property_panel_text.rs:168-188 | crates/op-editor-ui/src/widgets/property_panel_text.rs:190-214 — both copies are in the same file, so extract the 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 (18–25 lines × 2) crates/op-host-desktop/src/chat_acp.rs:390— crates/op-host-desktop/src/chat_acp.rs:390-414 | crates/op-host-services/src/chat_http_server.rs:151-168 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-desktop/src/chat_acp.rs:390` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22–23 lines × 3) crates/op-editor-core/src/svg_import/lexer.rs:149— crates/op-editor-core/src/svg_import/lexer.rs:149-171 | crates/op-editor-core/src/svg_import/path_data.rs:280-301 | crates/op-editor-core/src/svg_path_data.rs:426-447 — before extracting anything, compare `crates/op-editor-core/src/svg_import/path_data.rs` and `crates/op-editor-core/src/svg_path_data.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/svg_import/lexer.rs:149` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (1–23 lines × 4) crates/op-editor-ui/src/svg_export/transform.rs:150— crates/op-editor-ui/src/svg_export/transform.rs:150-151 | crates/op-editor-ui/src/svg_export/transform.rs:152-152 | crates/op-editor-ui/src/widgets/canvas_viewport_layer_bounds.rs:337-358 | crates/op-editor-ui/src/widgets/canvas_viewport_layer_bounds.rs:394-416 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/canvas_viewport_layer_bounds.rs:337` it begins part-way through the construct above it, so those 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 (20–23 lines × 2) crates/op-editor-ui/src/widgets/property_panel_typography.rs:142— crates/op-editor-ui/src/widgets/property_panel_typography.rs:142-161 | crates/op-figma/src/clipboard.rs:472-494 — 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 (19–23 lines × 2) crates/op-host-web/src/web_settings_storage.rs:99— crates/op-host-web/src/web_settings_storage.rs:99-117 | crates/op-host-web/src/web_settings_storage.rs:137-159 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-web/src/web_settings_storage.rs:99` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19–22 lines × 2) crates/op-editor-ui/src/widgets/home_surface_paint.rs:190— crates/op-editor-ui/src/widgets/home_surface_paint.rs:190-211 | crates/op-editor-ui/src/widgets/home_surface_paint_compact_chrome.rs:102-120 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (18–22 lines × 2) crates/op-host-desktop/src/app_state.rs:452— crates/op-host-desktop/src/app_state.rs:452-473 | crates/op-host-desktop/src/app_state.rs:500-517 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-desktop/src/app_state.rs:452` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `crate) fn drain_opened_files(&mut` in one and `crate) fn drain_forwarded_files(&mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (21 lines × 3) crates/op-html/src/css/declaration_syntax.rs:178— crates/op-html/src/css/declaration_syntax.rs:178-198 | crates/op-html/src/css/declaration_syntax.rs:294-314 | crates/op-html/src/css/declaration_syntax.rs:353-373 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-html/src/css/declaration_syntax.rs:178` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–20 lines × 2) crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:268— crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:268-287 | crates/op-chat-agent/src/chat_agent_loop/openai.rs:218-233 — before extracting anything, compare `crates/op-chat-agent/src/chat_agent_loop/anthropic.rs` and `crates/op-chat-agent/src/chat_agent_loop/openai.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 175 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-chat-agent/src/chat_agent_loop/anthropic.rs:268` it begins part-way through the construct above it, so those 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–20 lines × 2) crates/op-pen-loader/src/adapter/entry.rs:35— crates/op-pen-loader/src/adapter/entry.rs:35-54 | crates/op-pen-loader/src/adapter/entry.rs:74-90 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-pen-loader/src/adapter/entry.rs:35` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-pen-loader/src/adapter/entry.rs:34` calls `clone` and `crates/op-pen-loader/src/adapter/entry.rs:73` 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 (18–19 lines × 2) crates/op-editor-ui/src/widgets/property_panel_compositing.rs:325— crates/op-editor-ui/src/widgets/property_panel_compositing.rs:325-343 | crates/op-editor-ui/src/widgets/property_panel_text.rs:498-515 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/property_panel_compositing.rs:325` it begins part-way through the construct above it, so those exact lines 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–19 lines × 2) crates/op-host-native/src/widget_host/variables_panel_row_press.rs:143— crates/op-host-native/src/widget_host/variables_panel_row_press.rs:143-161 | crates/op-host-web/src/widget_host/variables_panel_rows.rs:35-51 — before extracting anything, compare `crates/op-host-native/src/widget_host/variables_panel_row_press.rs` and `crates/op-host-web/src/widget_host/variables_panel_rows.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-native/src/widget_host/variables_panel_row_press.rs:143` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–18 lines × 2) crates/op-smoke/src/loop_seed.rs:73— crates/op-smoke/src/loop_seed.rs:73-90 | crates/op-smoke/src/loop_seed.rs:164-177 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–17 lines × 4) crates/op-editor-ui/src/widgets/property_panel_fill.rs:513— crates/op-editor-ui/src/widgets/property_panel_fill.rs:513-529 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:179-194 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:302-317 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:368-383 — before extracting anything, compare `crates/op-editor-ui/src/widgets/property_panel_fill.rs` and `crates/op-editor-ui/src/widgets/property_panel_fill_body.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 109 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/property_panel_fill.rs:513` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 4) crates/op-html/src/css/selectors_parser.rs:557— crates/op-html/src/css/selectors_parser.rs:557-573 | crates/op-html/src/css/selectors_parser.rs:600-616 | crates/op-html/src/mapper_grid.rs:572-588 | crates/op-html/src/mapper_visual_syntax.rs:52-68 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-html/src/css/selectors_parser.rs:557` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 5) crates/op-html/src/css/selectors_parser.rs:412— crates/op-html/src/css/selectors_parser.rs:412-427 | crates/op-html/src/css/selectors_parser.rs:560-575 | crates/op-html/src/css/selectors_parser.rs:603-618 | crates/op-html/src/mapper_visual_syntax.rs:19-34 | crates/op-html/src/mapper_visual_syntax.rs:55-70 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-html/src/css/selectors_parser.rs:412` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–16 lines × 4) crates/op-editor-ui/src/widgets/property_panel_fill.rs:542— crates/op-editor-ui/src/widgets/property_panel_fill.rs:542-556 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:214-228 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:338-353 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:403-417 — before extracting anything, compare `crates/op-editor-ui/src/widgets/property_panel_fill.rs` and `crates/op-editor-ui/src/widgets/property_panel_fill_body.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 109 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/property_panel_fill.rs:542` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–16 lines × 3) crates/op-editor-core/src/color_picker_snapshot.rs:119— crates/op-editor-core/src/color_picker_snapshot.rs:119-125 | crates/op-editor-core/src/scene_vars.rs:78-91 | crates/op-editor-core/src/variables.rs:63-78 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14–16 lines × 2) crates/op-editor-core/src/ref_resolve.rs:226— crates/op-editor-core/src/ref_resolve.rs:226-241 | crates/op-editor-core/src/ref_resolve.rs:380-393 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/ref_resolve.rs:226` it does not close everything it opens, so those 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–15 lines × 2) crates/op-engine-ffi/src/editor_chat.rs:508— crates/op-engine-ffi/src/editor_chat.rs:508-518 | crates/op-host-desktop/src/chat_session.rs:331-345 — before extracting anything, compare `crates/op-engine-ffi/src/editor_chat.rs` and `crates/op-host-desktop/src/chat_session.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-engine-ffi/src/editor_chat.rs:508` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–16 lines × 2) crates/op-orchestrator/src/geometry_buried_overlay.rs:648— crates/op-orchestrator/src/geometry_buried_overlay.rs:648-663 | crates/op-orchestrator/src/geometry_buried_overlay.rs:667-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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13–14 lines × 7) crates/op-host-services/src/chat_system_prompt.rs:204— crates/op-host-services/src/chat_system_prompt.rs:204-217 | crates/op-mcp/src/batch_get.rs:444-457 | crates/op-mcp/src/open_document.rs:171-184 | crates/op-mcp/src/tools.rs:44-57 | crates/op-orchestrator/src/validation_dump.rs:251-264 | crates/op-orchestrator/src/validation_fixes_apply.rs:649-661 | crates/op-orchestrator/src/validation_fixes_b3.rs:499-512 — before extracting anything, compare `crates/op-host-services/src/chat_system_prompt.rs` and `crates/op-mcp/src/batch_get.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-mcp/src/batch_get.rs:444` it begins part-way through the construct above it, so those exact lines 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 × 6) crates/op-editor-ui/src/widgets/property_panel_fill.rs:543— crates/op-editor-ui/src/widgets/property_panel_fill.rs:543-556 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:111-124 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:215-228 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:340-353 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:404-417 | crates/op-editor-ui/src/widgets/property_panel_stroke.rs:348-361 — before extracting anything, compare `crates/op-editor-ui/src/widgets/property_panel_fill.rs` and `crates/op-editor-ui/src/widgets/property_panel_fill_body.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 109 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/property_panel_fill.rs:543` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:109` calls `is_none` and `crates/op-editor-ui/src/widgets/property_panel_fill.rs:541` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13–14 lines × 6) crates/op-engine-jni/src/bindings_editor.rs:76— crates/op-engine-jni/src/bindings_editor.rs:76-89 | crates/op-engine-jni/src/bindings_editor.rs:119-131 | crates/op-engine-jni/src/bindings_editor.rs:159-172 | crates/op-engine-jni/src/bindings_editor.rs:204-217 | crates/op-engine-jni/src/bindings_editor.rs:370-382 | crates/op-engine-jni/src/bindings_editor.rs:427-439 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-engine-jni/src/bindings_editor.rs:76` it begins part-way through the construct above it, so those exact lines 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 × 5) crates/op-host-desktop/src/git_jobs.rs:95— crates/op-host-desktop/src/git_jobs.rs:95-107 | crates/op-host-desktop/src/git_jobs.rs:289-301 | crates/op-host-desktop/src/git_jobs.rs:345-357 | crates/op-host-desktop/src/iconify_host.rs:67-79 | crates/op-host-services/src/provider_probe_host.rs:69-81 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (11–13 lines × 4) crates/op-editor-ui/src/widgets/property_panel_icon.rs:110— crates/op-editor-ui/src/widgets/property_panel_icon.rs:110-120 | crates/op-editor-ui/src/widgets/property_panel_inputs.rs:554-564 | crates/op-editor-ui/src/widgets/property_panel_text.rs:297-309 | crates/op-editor-ui/src/widgets/property_panel_text.rs:334-346 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/property_panel_icon.rs:110` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–13 lines × 3) crates/op-host-web/src/agent_indicator_sync.rs:71— crates/op-host-web/src/agent_indicator_sync.rs:71-83 | crates/op-host-web/src/preview_pump.rs:66-75 | crates/op-host-web/src/tooltip_pump.rs:50-61 — before extracting anything, compare `crates/op-host-web/src/preview_pump.rs` and `crates/op-host-web/src/tooltip_pump.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-web/src/agent_indicator_sync.rs:71` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–13 lines × 2) crates/op-host-native/src/widget_host/workspace.rs:385— crates/op-host-native/src/widget_host/workspace.rs:385-397 | crates/op-host-web/src/widget_host/studio_workspace.rs:289-296 — before extracting anything, compare `crates/op-host-native/src/widget_host/workspace.rs` and `crates/op-host-web/src/widget_host/studio_workspace.rs` 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-native/src/widget_host/workspace.rs:385` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 5) crates/op-editor-ui/src/widgets/home_surface_connect.rs:124— crates/op-editor-ui/src/widgets/home_surface_connect.rs:124-134 | crates/op-editor-ui/src/widgets/home_surface_paint.rs:557-567 | crates/op-editor-ui/src/widgets/home_surface_paint_cards.rs:270-280 | crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs:303-313 | crates/op-editor-ui/src/widgets/home_surface_paint_panels.rs:36-46 — before extracting anything, compare `crates/op-editor-ui/src/widgets/home_surface_paint_compact.rs` and `crates/op-editor-ui/src/widgets/home_surface_paint_panels.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 197 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10–11 lines × 4) crates/op-editor-ui/src/widgets/property_panel_fill.rs:547— crates/op-editor-ui/src/widgets/property_panel_fill.rs:547-557 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:219-229 | crates/op-editor-ui/src/widgets/property_panel_fill_body.rs:408-418 | crates/op-editor-ui/src/widgets/property_panel_inputs.rs:393-402 — before extracting anything, compare `crates/op-editor-ui/src/widgets/property_panel_fill.rs` and `crates/op-editor-ui/src/widgets/property_panel_fill_body.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 109 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/property_panel_fill.rs:547` it begins part-way through the construct above it, so those exact lines 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–11 lines × 3) crates/op-editor-core/src/instance_override.rs:130— crates/op-editor-core/src/instance_override.rs:130-136 | crates/op-editor-core/src/ref_resolve.rs:257-267 | crates/op-editor-core/src/ref_resolve.rs:405-410 — before extracting anything, compare `crates/op-editor-core/src/instance_override.rs` and `crates/op-editor-core/src/ref_resolve.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 lines × 6) crates/op-orchestrator/src/absolute_child_clamp.rs:172— crates/op-orchestrator/src/absolute_child_clamp.rs:172-181 | crates/op-orchestrator/src/absolute_child_clamp.rs:314-323 | crates/op-orchestrator/src/chip_label_adopt.rs:61-70 | crates/op-orchestrator/src/none_stack_inset.rs:27-36 | crates/op-orchestrator/src/section_shell_fill_repair.rs:145-154 | crates/op-orchestrator/src/text_fit.rs:203-212 — there are 6 copies across 5 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9–10 lines × 4) crates/op-collab-smoke/src/fault_guest.rs:82— crates/op-collab-smoke/src/fault_guest.rs:82-91 | crates/op-collab-smoke/src/fault_guest.rs:157-166 | crates/op-collab-smoke/src/fault_guest.rs:395-404 | crates/op-collab-smoke/src/fault_guest.rs:460-468 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-collab-smoke/src/fault_guest.rs:82` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-collab-smoke/src/fault_guest.rs:394` calls `default` and `crates/op-collab-smoke/src/fault_guest.rs:81` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9–10 lines × 3) crates/op-editor-core/src/instance_override.rs:121— crates/op-editor-core/src/instance_override.rs:121-129 | crates/op-editor-core/src/ref_resolve.rs:246-255 | crates/op-editor-core/src/ref_resolve.rs:395-404 — before extracting anything, compare `crates/op-editor-core/src/instance_override.rs` and `crates/op-editor-core/src/ref_resolve.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/instance_override.rs:121` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–10 lines × 3) crates/op-host-native/src/backend/skia.rs:390— crates/op-host-native/src/backend/skia.rs:390-397 | crates/op-host-native/src/backend/skia.rs:537-546 | crates/op-host-native/src/backend/skia.rs:566-573 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-native/src/backend/skia.rs:390` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–9 lines × 10) crates/op-collab/src/diff_index.rs:122— crates/op-collab/src/diff_index.rs:122-130 | crates/op-editor-core/src/command_refine.rs:181-189 | crates/op-editor-core/src/export_name.rs:163-171 | crates/op-host-services/src/chat_system_prompt.rs:195-203 | crates/op-mcp/src/batch_get.rs:435-443 | crates/op-mcp/src/open_document.rs:162-170 | crates/op-orchestrator/src/validation_dump.rs:242-250 | crates/op-orchestrator/src/validation_fixes_apply.rs:641-648 | crates/op-orchestrator/src/validation_fixes_b3.rs:490-498 | crates/op-smoke/src/audit_rubric.rs:245-253 — before extracting anything, compare `crates/op-collab/src/diff_index.rs` and `crates/op-editor-core/src/command_refine.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-collab/src/diff_index.rs:122` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `&PenNode` in one and `&jian_ops_schema::node::PenNode` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/op-collab/src/diff_index.rs:132` calls `Image`, `IconFont` and `crates/op-editor-core/src/export_name.rs:173` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8–9 lines × 4) crates/op-host-native/src/widget_host/variables_panel_row_press.rs:262— crates/op-host-native/src/widget_host/variables_panel_row_press.rs:262-270 | crates/op-host-native/src/widget_host/variables_panel_row_press.rs:323-330 | crates/op-host-web/src/widget_host/variables_panel_rows.rs:225-233 | crates/op-host-web/src/widget_host/variables_panel_rows.rs:277-285 — before extracting anything, compare `crates/op-host-native/src/widget_host/variables_panel_row_press.rs` and `crates/op-host-web/src/widget_host/variables_panel_rows.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-host-native/src/widget_host/variables_panel_row_press.rs:323` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8–9 lines × 3) crates/op-collab/src/diff.rs:128— crates/op-collab/src/diff.rs:128-136 | crates/op-collab/src/guest_pending.rs:313-320 | crates/op-collab/src/reapply.rs:44-51 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (7 lines × 9) crates/op-mcp/src/import_common.rs:68— crates/op-mcp/src/import_common.rs:68-74 | crates/op-mcp/src/write_tools.rs:112-118 | crates/op-mcp/src/write_tools.rs:181-187 | crates/op-mcp/src/write_tools.rs:219-225 | crates/op-mcp/src/write_tools.rs:267-273 | crates/op-mcp/src/write_tools.rs:462-468 | crates/op-mcp/src/write_tools.rs:516-522 | crates/op-mcp/src/write_tools.rs:586-592 | crates/op-mcp/src/write_tools_import_svg.rs:64-70 — there are 9 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 9 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-mcp/src/write_tools.rs:217` calls `ts_update_patch_json`, `Ok`, `Some` and `crates/op-mcp/src/write_tools.rs:461` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 4) crates/op-editor-core/src/host_image_panel_transitions.rs:257— crates/op-editor-core/src/host_image_panel_transitions.rs:257-263 | crates/op-editor-core/src/host_image_panel_transitions.rs:279-285 | crates/op-editor-core/src/host_image_panel_transitions.rs:304-310 | crates/op-editor-core/src/host_image_panel_transitions.rs:323-329 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/host_image_panel_transitions.rs:257` it does not close everything it opens, so those exact lines 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–7 lines × 3) crates/op-host-web/src/canvaskit/mount.rs:387— crates/op-host-web/src/canvaskit/mount.rs:387-392 | crates/op-host-web/src/canvaskit/mount.rs:453-459 | crates/op-host-web/src/canvaskit/mount.rs:485-490 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/op-host-web/src/canvaskit/mount.rs:392` calls `set_clocks`, `now_ms_perf`, `now_unix_secs` and `crates/op-host-web/src/canvaskit/mount.rs:459` 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 (3–7 lines × 3) crates/op-orchestrator/src/radial_repair_preinsert_normalize.rs:219— crates/op-orchestrator/src/radial_repair_preinsert_normalize.rs:219-225 | crates/op-orchestrator/src/radial_repair_preinsert_normalize.rs:283-289 | crates/op-orchestrator/src/ring_repair.rs:259-261 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-orchestrator/src/radial_repair_preinsert_normalize.rs:219` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (4–6 lines × 5) crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:168— crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:168-171 | crates/op-orchestrator/src/cleanup_desktop_dashboard.rs:205-208 | crates/op-orchestrator/src/cleanup_mobile_dense.rs:232-235 | crates/op-orchestrator/src/validation_dump.rs:276-281 | crates/op-orchestrator/src/validation_fixes_apply.rs:568-573 — before extracting anything, compare `crates/op-orchestrator/src/cleanup_desktop_dashboard.rs` and `crates/op-orchestrator/src/cleanup_mobile_dense.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-orchestrator/src/validation_dump.rs:276` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-orchestrator/src/validation_dump.rs:274` calls `TextArea`, `as_ref`, `Select` and `crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:168` 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 (4–6 lines × 4) crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:193— crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:193-196 | crates/op-html/src/mapper_node_access.rs:99-102 | crates/op-orchestrator/src/validation_dump.rs:292-297 | crates/op-orchestrator/src/validation_fixes_apply.rs:587-592 — before extracting anything, compare `crates/op-orchestrator/src/validation_dump.rs` and `crates/op-orchestrator/src/validation_fixes_apply.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-orchestrator/src/validation_dump.rs:292` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-orchestrator/src/validation_dump.rs:290` calls `TextArea`, `as_ref`, `Select` and `crates/op-editor-ui/src/widgets/property_panel_snapshot/node_props.rs:193` 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 × 7) crates/op-mcp/src/reparent_tools.rs:78— crates/op-mcp/src/reparent_tools.rs:78-82 | crates/op-mcp/src/write_tools.rs:116-120 | crates/op-mcp/src/write_tools.rs:223-227 | crates/op-mcp/src/write_tools.rs:466-470 | crates/op-mcp/src/write_tools.rs:520-524 | crates/op-mcp/src/write_tools.rs:590-594 | crates/op-mcp/src/write_tools_import_svg.rs:68-72 — there are 7 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 7 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-mcp/src/reparent_tools.rs:78` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-mcp/src/write_tools.rs:114` calls `or_else`, `get` and `crates/op-mcp/src/reparent_tools.rs:77` 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 × 6) crates/op-editor-core/src/svg_import/path_data.rs:124— crates/op-editor-core/src/svg_import/path_data.rs:124-128 | crates/op-editor-core/src/svg_import/path_data.rs:148-152 | crates/op-editor-core/src/svg_path_data.rs:126-130 | crates/op-editor-core/src/svg_path_data.rs:134-138 | crates/op-editor-core/src/svg_path_data.rs:141-145 | crates/op-editor-core/src/svg_path_data.rs:146-151 — before extracting anything, compare `crates/op-editor-core/src/svg_import/path_data.rs` and `crates/op-editor-core/src/svg_path_data.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-core/src/svg_import/path_data.rs:124` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/op-editor-core/src/svg_import/path_data.rs:147` calls `Some` and `crates/op-editor-core/src/svg_path_data.rs:134` 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 lines × 3) crates/op-editor-core/src/fills/access.rs:183— crates/op-editor-core/src/fills/access.rs:183-206 | crates/op-html/src/mapper_node_access.rs:62-85 | crates/op-orchestrator/src/variable_binding.rs:400-423 — before extracting anything, compare `crates/op-editor-core/src/fills/access.rs` and `crates/op-orchestrator/src/variable_binding.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 10) crates/op-editor-ui/src/widgets/agent_settings_builtin_parts.rs:484— crates/op-editor-ui/src/widgets/agent_settings_builtin_parts.rs:484-493 | crates/op-editor-ui/src/widgets/agent_settings_form_actions.rs:164-173 | crates/op-editor-ui/src/widgets/ai_chat_panel_controls.rs:128-137 | crates/op-editor-ui/src/widgets/ai_chat_transcript.rs:566-575 | crates/op-editor-ui/src/widgets/ai_chat_transcript_tools.rs:529-538 | crates/op-editor-ui/src/widgets/component_browser_panel.rs:723-732 | crates/op-editor-ui/src/widgets/property_panel_code_generating.rs:300-309 | crates/op-editor-ui/src/widgets/property_panel_image_fill.rs:641-650 | crates/op-editor-ui/src/widgets/settings_form.rs:24-33 | crates/op-editor-ui/src/widgets/variables_preset_menu.rs:399-408 — 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 10 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-editor-ui/src/widgets/ai_chat_panel_controls.rs:128` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 8) crates/op-orchestrator/src/chip_label_adopt.rs:277— crates/op-orchestrator/src/chip_label_adopt.rs:277-283 | crates/op-orchestrator/src/chip_repair.rs:31-37 | crates/op-orchestrator/src/radial_repair.rs:549-555 | crates/op-orchestrator/src/ring_repair.rs:358-364 | crates/op-orchestrator/src/sidebar_archetype.rs:467-473 | crates/op-orchestrator/src/square_ring_repair.rs:187-193 | crates/op-orchestrator/src/stacked_text_repair.rs:139-145 | crates/op-orchestrator/src/stub_repair.rs:268-274 — before extracting anything, compare `crates/op-orchestrator/src/square_ring_repair.rs` and `crates/op-orchestrator/src/stub_repair.rs` as WHOLE FILES: this scan already matched 5 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. If that is what happened, the fix is to keep one copy and have the 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 × 5) crates/op-collab-relay-protocol/src/locator.rs:99— crates/op-collab-relay-protocol/src/locator.rs:99-104 | crates/op-collab-relay-protocol/src/sensitive.rs:14-19 | crates/op-collab-relay-protocol/src/sensitive.rs:43-48 | crates/op-collab-relay-protocol/src/sensitive.rs:84-89 | crates/op-collab-relay-protocol/src/sensitive.rs:106-111 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 6) crates/op-engine-napi/src/bindings_editor.rs:146— crates/op-engine-napi/src/bindings_editor.rs:146-152 | crates/op-engine-napi/src/bindings_editor.rs:185-191 | crates/op-engine-napi/src/bindings_editor.rs:194-200 | crates/op-engine-napi/src/bindings_media.rs:26-32 | crates/op-engine-napi/src/bindings_text.rs:43-49 | crates/op-engine-napi/src/bindings_text.rs:58-64 — there are 6 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 6 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9 lines × 7) crates/op-mcp/src/node_attr_tools.rs:32— crates/op-mcp/src/node_attr_tools.rs:32-40 | crates/op-mcp/src/node_attr_tools.rs:102-110 | crates/op-mcp/src/node_attr_tools.rs:140-148 | crates/op-mcp/src/node_attr_tools.rs:178-188 | crates/op-mcp/src/node_attr_tools.rs:255-263 | crates/op-mcp/src/node_attr_tools.rs:313-323 | crates/op-mcp/src/scalar_vars.rs:48-58 — there are 7 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 7 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/op-mcp/src/node_attr_tools.rs:32` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (23–25 lines × 2) templates/step0/_generators/tpl_tutorial_skincare.py:220— templates/step0/_generators/tpl_tutorial_skincare.py:220-242 | templates/step0/_generators/tpl_tutorial_storage.py:215-239 — before extracting anything, compare `templates/step0/_generators/tpl_tutorial_skincare.py` and `templates/step0/_generators/tpl_tutorial_storage.py` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `templates/step0/_generators/tpl_tutorial_skincare.py:220` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19–20 lines × 2) templates/step0/_generators/tpl_deck_dossier.py:164— templates/step0/_generators/tpl_deck_dossier.py:164-183 | templates/step0/_generators/tpl_deck_ledger.py:159-177 — 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 (11–17 lines × 9) templates/step0/_generators/tpl_infographic_challenge.py:252— templates/step0/_generators/tpl_infographic_challenge.py:252-265 | templates/step0/_generators/tpl_infographic_concept.py:301-317 | templates/step0/_generators/tpl_infographic_data.py:292-305 | templates/step0/_generators/tpl_infographic_faq.py:239-251 | templates/step0/_generators/tpl_infographic_map.py:248-264 | templates/step0/_generators/tpl_infographic_ranking.py:275-287 | templates/step0/_generators/tpl_infographic_steps.py:223-233 | templates/step0/_generators/tpl_infographic_timeline.py:274-286 | templates/step0/_generators/tpl_infographic_weekly_review.py:329-339 — 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 9 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `templates/step0/_generators/tpl_infographic_challenge.py:250` calls `rect`, `solid` and `templates/step0/_generators/tpl_infographic_concept.py:300` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13–16 lines × 3) templates/step0/_generators/tpl_tutorial_onboarding.py:117— templates/step0/_generators/tpl_tutorial_onboarding.py:117-132 | templates/step0/_generators/tpl_tutorial_recipe.py:117-129 | templates/step0/_generators/tpl_tutorial_software.py:132-146 — 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 (10 lines × 5) templates/step0/_generators/tpl_journal_card.py:191— templates/step0/_generators/tpl_journal_card.py:191-200 | templates/step0/_generators/tpl_lecture_light.py:155-164 | templates/step0/_generators/tpl_pitch_dark.py:143-152 | templates/step0/_generators/tpl_quote_card.py:89-98 | templates/step0/_generators/tpl_quote_card.py:103-115 — there are 5 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 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, `templates/step0/_generators/tpl_pitch_dark.py:136` calls `neon_rule`, `rect`, `linear` and `templates/step0/_generators/tpl_quote_card.py:85` 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 × 13) templates/step0/_generators/tpl_bookreview_carousel.py:137— templates/step0/_generators/tpl_bookreview_carousel.py:137-141 | templates/step0/_generators/tpl_cityguide_carousel.py:151-155 | templates/step0/_generators/tpl_compare_myth_truth.py:122-126 | templates/step0/_generators/tpl_compare_scenario_guide.py:126-130 | templates/step0/_generators/tpl_compare_time_shift.py:118-122 | templates/step0/_generators/tpl_compare_tradeoff_scale.py:108-112 | templates/step0/_generators/tpl_datareport_carousel.py:142-146 | templates/step0/_generators/tpl_opinion_carousel.py:140-144 | templates/step0/_generators/tpl_qa_carousel.py:140-144 | templates/step0/_generators/tpl_story_carousel.py:142-146 | templates/step0/_generators/tpl_toolkit_carousel.py:144-148 | templates/step0/_generators/tpl_tutorial_carousel.py:139-143 | templates/step0/_generators/tpl_yearreview_carousel.py:189-193 — 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 13 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 (8 lines × 22) templates/step0/_generators/tpl_brand_concept_sheet.py:71— templates/step0/_generators/tpl_brand_concept_sheet.py:71-79 | templates/step0/_generators/tpl_compare_do_dont.py:136-143 | templates/step0/_generators/tpl_compare_myth_truth.py:130-137 | templates/step0/_generators/tpl_compare_pricing_tiers.py:122-129 | templates/step0/_generators/tpl_compare_scenario_guide.py:134-141 | templates/step0/_generators/tpl_compare_spec_table.py:154-161 | templates/step0/_generators/tpl_compare_three_way.py:141-148 | templates/step0/_generators/tpl_compare_time_shift.py:126-133 | templates/step0/_generators/tpl_compare_tradeoff_scale.py:116-123 | templates/step0/_generators/tpl_infographic_challenge.py:153-160 | templates/step0/_generators/tpl_infographic_concept.py:155-162 | templates/step0/_generators/tpl_infographic_data.py:121-128 | templates/step0/_generators/tpl_infographic_faq.py:150-157 | templates/step0/_generators/tpl_infographic_list.py:148-155 | templates/step0/_generators/tpl_infographic_map.py:150-157 | templates/step0/_generators/tpl_infographic_story.py:150-157 | templates/step0/_generators/tpl_infographic_timeline.py:151-158 | templates/step0/_generators/tpl_tutorial_photo.py:160-167 | templates/step0/_generators/tpl_tutorial_skincare.py:149-156 | templates/step0/_generators/tpl_tutorial_software.py:120-127 | templates/step0/_generators/tpl_tutorial_storage.py:156-163 | templates/step0/_generators/tpl_tutorial_workout.py:145-152 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 22 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 (5 lines × 42) templates/step0/_generators/tpl_card_daily.py:72— templates/step0/_generators/tpl_card_daily.py:72-76 | templates/step0/_generators/tpl_card_metric.py:76-80 | templates/step0/_generators/tpl_card_metric.py:85-89 | templates/step0/_generators/tpl_card_notice.py:80-84 | templates/step0/_generators/tpl_card_notice.py:89-93 | templates/step0/_generators/tpl_card_price.py:83-87 | templates/step0/_generators/tpl_card_price.py:92-96 | templates/step0/_generators/tpl_card_quote.py:75-79 | templates/step0/_generators/tpl_card_spine.py:89-93 | templates/step0/_generators/tpl_compare_do_dont.py:119-123 | templates/step0/_generators/tpl_compare_do_dont.py:128-132 | templates/step0/_generators/tpl_compare_myth_truth.py:113-117 | templates/step0/_generators/tpl_compare_pricing_tiers.py:105-109 | templates/step0/_generators/tpl_compare_pricing_tiers.py:114-118 | templates/step0/_generators/tpl_compare_scenario_guide.py:117-121 | templates/step0/_generators/tpl_compare_spec_table.py:137-141 | templates/step0/_generators/tpl_compare_spec_table.py:146-150 | templates/step0/_generators/tpl_compare_three_way.py:116-120 | templates/step0/_generators/tpl_compare_three_way.py:125-129 | templates/step0/_generators/tpl_compare_time_shift.py:109-113 | templates/step0/_generators/tpl_compare_tradeoff_scale.py:99-103 | templates/step0/_generators/tpl_compare_version_diff.py:99-103 | templates/step0/_generators/tpl_compare_version_diff.py:108-112 | templates/step0/_generators/tpl_infographic_blank_vs_example.py:123-127 | templates/step0/_generators/tpl_infographic_challenge.py:145-149 | templates/step0/_generators/tpl_infographic_concept.py:147-151 | templates/step0/_generators/tpl_infographic_data.py:104-108 | templates/step0/_generators/tpl_infographic_data.py:113-117 | templates/step0/_generators/tpl_infographic_faq.py:142-146 | templates/step0/_generators/tpl_infographic_idea_flow.py:108-112 | templates/step0/_generators/tpl_infographic_list.py:131-135 | templates/step0/_generators/tpl_infographic_list.py:140-144 | templates/step0/_generators/tpl_infographic_map.py:142-146 | templates/step0/_generators/tpl_infographic_ranking.py:146-150 | templates/step0/_generators/tpl_infographic_steps.py:116-120 | templates/step0/_generators/tpl_infographic_steps.py:125-129 | templates/step0/_generators/tpl_infographic_story.py:142-146 | templates/step0/_generators/tpl_infographic_timeline.py:143-147 | templates/step0/_generators/tpl_infographic_weekly_review.py:134-138 | templates/step0/_generators/tpl_journal_card.py:124-128 | templates/step0/_generators/tpl_tutorial_software.py:103-107 | templates/step0/_generators/tpl_tutorial_software.py:112-116 — there are 42 copies across 30 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 42 sites; resolving a subset leaves the remainder to drift apart. 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, `templates/step0/_generators/tpl_infographic_blank_vs_example.py:130` calls `label`, `text` and `templates/step0/_generators/tpl_infographic_ranking.py:153` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 9) templates/step0/_generators/tpl_compare_scenario_guide.py:184— templates/step0/_generators/tpl_compare_scenario_guide.py:184-190 | templates/step0/_generators/tpl_compare_spec_table.py:205-211 | templates/step0/_generators/tpl_infographic_blank_vs_example.py:206-211 | templates/step0/_generators/tpl_infographic_blank_vs_example.py:286-290 | templates/step0/_generators/tpl_infographic_concept.py:230-238 | templates/step0/_generators/tpl_infographic_steps.py:251-259 | templates/step0/_generators/tpl_infographic_story.py:204-212 | templates/step0/_generators/tpl_infographic_story.py:278-293 | templates/step0/_generators/tpl_tutorial_workout.py:274-279 — there are 9 copies across 7 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 9 sites; resolving a subset leaves the remainder to drift apart. 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 × 10) templates/step0/_generators/tpl_infographic_challenge.py:127— templates/step0/_generators/tpl_infographic_challenge.py:127-132 | templates/step0/_generators/tpl_infographic_concept.py:129-134 | templates/step0/_generators/tpl_infographic_data.py:94-99 | templates/step0/_generators/tpl_infographic_faq.py:124-129 | templates/step0/_generators/tpl_infographic_list.py:121-126 | templates/step0/_generators/tpl_infographic_map.py:124-129 | templates/step0/_generators/tpl_infographic_ranking.py:128-133 | templates/step0/_generators/tpl_infographic_steps.py:106-111 | templates/step0/_generators/tpl_infographic_story.py:124-129 | templates/step0/_generators/tpl_infographic_timeline.py:125-130 — 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 10 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 (43–44 lines × 2) packaging/ios/Sources/AuthCodeFormViewController.swift:68— packaging/ios/Sources/AuthCodeFormViewController.swift:68-110 | packaging/ios/Sources/NativeLoginViewController.swift:106-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. Read the line range as the matched WINDOW rather than a finished unit: at `packaging/ios/Sources/AuthCodeFormViewController.swift:68` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication· Near-duplicate member family (5 members, 15 shared lines) · ×1
Near-duplicate member family (5 members, 15 shared lines) crates/op-preview-core/src/tests_animation.rs:42— crates/op-preview-core/src/tests_animation.rs:42-59 | crates/op-preview-core/src/tests_debug_controls.rs:82-99 | crates/op-preview-core/src/tests_debug_trace.rs:69-89 | crates/op-preview-core/src/tests_effects.rs:219-238 | crates/op-preview-core/src/tests_ui_actions.rs:29-47 — These 5 members are variants of one another: a block of 15 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Duplicated block (15–16 lines × 5) crates/op-preview-core/src/tests_animation.rs:43— crates/op-preview-core/src/tests_animation.rs:43-57 | crates/op-preview-core/src/tests_debug_controls.rs:83-97 | crates/op-preview-core/src/tests_debug_trace.rs:70-84 | crates/op-preview-core/src/tests_effects.rs:220-234 | crates/op-preview-core/src/tests_ui_actions.rs:30-45 — 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 5 call sites, so a change lands once.
Duplicated block (11–12 lines × 3) crates/op-preview-core/src/tests_local_pagination.rs:28— crates/op-preview-core/src/tests_local_pagination.rs:28-38 | crates/op-preview-core/src/tests_table_filter.rs:38-49 | crates/op-preview-core/src/tests_table_search.rs:32-43 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
End-of-life runtime: Rust 1.94 rust-toolchain.toml:1— rust-toolchain.toml declares Rust 1.94 as this project's toolchain file, and Rust 1.94, superseded by 1.95 on 2026-04-16 (the Rust project patches only the current stable). An unsupported runtime receives no security patches, so every vulnerability disclosed in it since 2026-04-16 is present and unfixable without moving off it. This is a migration rather than an upgrade: there is no newer release of a runtime that has ended.
Unstable project op-host-web — op-host-web has instability 0.92 with 1 dependents.
P12 · CI test-gate honesty· Coverage collected but not gated · ×1
Coverage collected but not gated — CI collects a coverage report but no step enforces a minimum — coverage could halve and CI stays green. Add a step that fails the build when coverage drops below a floor (your coverage tool's minimum-threshold flag, or a coverage-gate action) so the number guards something. What was searched, so you can tell an absence from a miss: this repository's CI files AND its coverage configuration — the well-known coverage and test-runner config files, read at the repository root and inside workspace package directories two levels down, so a floor declared beside the tests rather than in the pipeline is credited — matched against the threshold settings this check knows by name. A floor set in your coverage service's web UI rather than in a committed file, or under a setting whose name is not one of those, is not seen here.
Duplication concentrated across 2 sibling directories (13 clone groups) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:41— 13 of the duplicated blocks reported below have copies in at least two of the sibling directories pkg-ck, src under crates/op-host-web/. That concentration is one structural fact, not 13 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 13 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplicated block (68 lines × 2 locations) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:41— crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:41 · crates/op-host-web/src/op_ck_bridge.js:367 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (32 lines × 2 locations) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:202— crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:202 · crates/op-host-web/src/op_ck_bridge.js:838 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (20 lines × 2 locations) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:340— crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:340 · crates/op-host-web/src/op_ck_bridge.js:1308 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (19 lines × 2 locations) packages/op-chrome-extension/i18n.js:210— packages/op-chrome-extension/i18n.js:210 · packages/op-chrome-extension/i18n.js:255 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication· Duplicated block with local edits (17 matched lines × 2 locations) · ×1
Duplicated block with local edits (17 matched lines × 2 locations) packages/op-vscode/src/vscode/configure-command.ts:52— packages/op-vscode/src/vscode/configure-command.ts:52 · packages/op-vscode/src/vscode/configure-command.ts:102 — the two spans are one implementation copied and then locally edited — 109 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (16 lines × 2 locations) crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:118— crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:118 · crates/op-host-web/src/op_ck_bridge.js:444 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (14 lines × 2 locations) crates/op-host-web/src/op_ck_image_cache.js:142— crates/op-host-web/src/op_ck_image_cache.js:142 · crates/op-host-web/src/op_ck_image_cache.js: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.
R10 · Code Duplication· Duplicated block with local edits (13 matched lines × 2 locations) · ×1
Duplicated block with local edits (13 matched lines × 2 locations) packages/op-vscode/src/session/pen-session.ts:412— packages/op-vscode/src/session/pen-session.ts:412 · packages/op-vscode/src/session/pen-session.ts:583 — the two spans are one implementation copied and then locally edited — 102 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (11 matched lines × 2 locations) · ×1
Duplicated block with local edits (11 matched lines × 2 locations) packages/op-web-sdk-react/vitest.config.ts:1— packages/op-web-sdk-react/vitest.config.ts:1 · packages/op-web-sdk-vue/vitest.config.ts:2 — the two spans are one implementation copied and then locally edited — 80 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (8 matched lines × 2 locations) · ×1
Duplicated block with local edits (8 matched lines × 2 locations) packages/op-chrome-extension/capture.js:90— packages/op-chrome-extension/capture.js:90 · packages/op-chrome-extension/capture.js:193 — the two spans are one implementation copied and then locally edited — 59 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Complex function collectDesignEvidenceInPage (cyclomatic 47, cognitive 78) packages/op-chrome-extension/design-capture.js:19— collectDesignEvidenceInPage has cyclomatic complexity 47 and cognitive complexity 78; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function measureParagraph (cyclomatic 39, cognitive 92) crates/op-host-web/src/op_ck_bridge.js:1609— measureParagraph has cyclomatic complexity 39 and cognitive complexity 92; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function vectorizeSvg (cyclomatic 38, cognitive 49) crates/op-html/assets/snapshot-extractor.js:586— vectorizeSvg has cyclomatic complexity 38 and cognitive complexity 49; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function drawImageWithOptions (cyclomatic 34, cognitive 53) crates/op-host-web/src/op_ck_bridge.js:1353— drawImageWithOptions has cyclomatic complexity 34 and cognitive complexity 53; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function walkRules (cyclomatic 31, cognitive 71) packages/op-chrome-extension/design-capture.js:363— walkRules has cyclomatic complexity 31 and cognitive complexity 71; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function parseInboundFromPage (cyclomatic 29, cognitive 25) packages/op-vscode/src/protocol/bridge.ts:58— parseInboundFromPage has cyclomatic complexity 29 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function generateDesignMd (cyclomatic 23, cognitive 30) packages/op-chrome-extension/client.js:287— generateDesignMd has cyclomatic complexity 23 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function jpegFitsThumbnailBounds (cyclomatic 23, cognitive 26) crates/op-host-web/src/op_ck_image_cache.js:22— jpegFitsThumbnailBounds has cyclomatic complexity 23 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function toHex (cyclomatic 19, cognitive 24) packages/op-chrome-extension/design-capture.js:104— toHex has cyclomatic complexity 19 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function componentSample (cyclomatic 19, cognitive 16) packages/op-chrome-extension/design-capture.js:311— componentSample has cyclomatic complexity 19 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function capturePage (cyclomatic 18, cognitive 26) packages/op-chrome-extension/capture.js:233— capturePage has cyclomatic complexity 18 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity· Complex function t (cyclomatic 17, cognitive 25) · ×1
Complex function t (cyclomatic 17, cognitive 25) packages/op-chrome-extension/i18n.js:242— t has cyclomatic complexity 17 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function opCkMakeRuntimeShader (cyclomatic 17, cognitive 16) crates/op-host-web/src/op_ck_bridge.js:178— opCkMakeRuntimeShader has cyclomatic complexity 17 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function textFirstBaseline (cyclomatic 16, cognitive 20) crates/op-host-web/src/op_ck_bridge.js:1504— textFirstBaseline has cyclomatic complexity 16 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function buildImage (cyclomatic 15, cognitive 21) crates/op-html/assets/snapshot-extractor.js:776— buildImage has cyclomatic complexity 15 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function buildInlineRun (cyclomatic 15, cognitive 21) crates/op-html/assets/snapshot-extractor.js:1054— buildInlineRun has cyclomatic complexity 15 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function shapeToPathData (cyclomatic 15, cognitive 19) crates/op-html/assets/snapshot-extractor.js:485— shapeToPathData has cyclomatic complexity 15 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function onDownload (cyclomatic 15, cognitive 19) packages/op-chrome-extension/popup.js:308— onDownload has cyclomatic complexity 15 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function buildTextLines (cyclomatic 15, cognitive 18) crates/op-html/assets/snapshot-extractor.js:359— buildTextLines has cyclomatic complexity 15 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function readBoundedDesignResponse (cyclomatic 15, cognitive 18) packages/op-chrome-extension/client.js:180— readBoundedDesignResponse has cyclomatic complexity 15 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function parseShellExternalUrl (cyclomatic 15, cognitive 12) packages/op-vscode/src/vscode/shell-messages.ts:57— parseShellExternalUrl has cyclomatic complexity 15 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function skipJsoncValue (cyclomatic 14, cognitive 21) packages/scripts/sync-version.mjs:179— skipJsoncValue has cyclomatic complexity 14 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function browserTextImage (cyclomatic 14, cognitive 13) crates/op-host-web/src/op_ck_bridge.js:530— browserTextImage has cyclomatic complexity 14 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function stripComments (cyclomatic 13, cognitive 28) packages/op-chrome-extension/scripts/check-sw-imports.mjs:44— stripComments has cyclomatic complexity 13 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function deliver (cyclomatic 13, cognitive 14) packages/op-chrome-extension/background.js:218— deliver has cyclomatic complexity 13 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function showPendingWorkerResult (cyclomatic 13, cognitive 12) packages/op-chrome-extension/popup-worker-actions.js:24— showPendingWorkerResult has cyclomatic complexity 13 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function opCkRuntimeEffectLocalMatrix (cyclomatic 13, cognitive 9) crates/op-host-web/src/op_ck_bridge.js:211— opCkRuntimeEffectLocalMatrix has cyclomatic complexity 13 and cognitive complexity 9; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function pathsFromBody (cyclomatic 12, cognitive 14) packages/scripts/generate-iconify-catalog.mjs:69— pathsFromBody has cyclomatic complexity 12 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function sdkVersionMatches (cyclomatic 12, cognitive 14) packages/scripts/sync-version.mjs:44— sdkVersionMatches has cyclomatic complexity 12 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 12, cognitive 12) crates/op-html/assets/snapshot-extractor.js:1— (anonymous) has cyclomatic complexity 12 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function buildText (cyclomatic 12, cognitive 12) crates/op-html/assets/snapshot-extractor.js:241— buildText has cyclomatic complexity 12 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function fitPathToRect (cyclomatic 12, cognitive 11) crates/op-host-web/src/op_ck_bridge.js:997— fitPathToRect has cyclomatic complexity 12 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function designFallbackReason (cyclomatic 12, cognitive 9) packages/op-chrome-extension/design-md.js:9— designFallbackReason has cyclomatic complexity 12 and cognitive complexity 9; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function parseHandshake (cyclomatic 12, cognitive 9) packages/op-vscode/src/daemon/daemon-client.ts:234— parseHandshake has cyclomatic complexity 12 and cognitive complexity 9; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function registeredCoverageSegments (cyclomatic 11, cognitive 22) crates/op-host-web/src/op_ck_bridge.js:917— registeredCoverageSegments has cyclomatic complexity 11 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function opCkParseFontFamilyStack (cyclomatic 11, cognitive 15) crates/op-host-web/src/op_ck_bridge.js:74— opCkParseFontFamilyStack has cyclomatic complexity 11 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function onDesignMd (cyclomatic 11, cognitive 14) packages/op-chrome-extension/popup.js:395— onDesignMd has cyclomatic complexity 11 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function configureMcpCommand (cyclomatic 11, cognitive 13) packages/op-vscode/src/vscode/configure-command.ts:47— configureMcpCommand has cyclomatic complexity 11 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function pointsToPathData (cyclomatic 11, cognitive 12) crates/op-html/assets/snapshot-extractor.js:466— pointsToPathData has cyclomatic complexity 11 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function addText (cyclomatic 11, cognitive 11) crates/op-html/assets/snapshot-extractor.js:971— addText has cyclomatic complexity 11 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files· crates/op-host-web/src/op_ck_bridge.js · ×1
crates/op-host-web/src/op_ck_bridge.js: 1873 lines of code crates/op-host-web/src/op_ck_bridge.js:1— crates/op-host-web/src/op_ck_bridge.js has 1873 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· crates/op-html/assets/snapshot-extractor.js · ×1
crates/op-html/assets/snapshot-extractor.js: 1193 lines of code crates/op-html/assets/snapshot-extractor.js:1— crates/op-html/assets/snapshot-extractor.js has 1193 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/op-chrome-extension/popup.js · ×1
packages/op-chrome-extension/popup.js: 697 lines of code packages/op-chrome-extension/popup.js:1— packages/op-chrome-extension/popup.js has 697 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/op-chrome-extension/design-capture.js · ×1
packages/op-chrome-extension/design-capture.js: 628 lines of code packages/op-chrome-extension/design-capture.js:1— packages/op-chrome-extension/design-capture.js has 628 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/op-vscode/src/vscode/pen-editor-provider.ts · ×1
packages/op-vscode/src/vscode/pen-editor-provider.ts: 581 lines of code packages/op-vscode/src/vscode/pen-editor-provider.ts:1— packages/op-vscode/src/vscode/pen-editor-provider.ts has 581 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/op-vscode/src/session/pen-session.ts · ×1
packages/op-vscode/src/session/pen-session.ts: 571 lines of code packages/op-vscode/src/session/pen-session.ts:1— packages/op-vscode/src/session/pen-session.ts has 571 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/op-chrome-extension/client.js · ×1
packages/op-chrome-extension/client.js: 496 lines of code packages/op-chrome-extension/client.js:1— packages/op-chrome-extension/client.js has 496 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· crates/op-host-web/src/figma_temp_worker.js · ×1
crates/op-host-web/src/figma_temp_worker.js: 465 lines of code crates/op-host-web/src/figma_temp_worker.js:1— crates/op-host-web/src/figma_temp_worker.js has 465 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/op-chrome-extension/background.js · ×1
packages/op-chrome-extension/background.js: 452 lines of code packages/op-chrome-extension/background.js:1— packages/op-chrome-extension/background.js has 452 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js · ×1
crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js: 428 lines of code crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js:1— crates/op-host-web/pkg-ck/snippets/op-host-web-c0696e2efbd71421/src/op_ck_bridge.js has 428 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
Dead file (~404 LoC) crates/op-host-web/src/op_ck_image_cache.js— no import path from any entry point (19 application, 15 tooling, 35 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Unused dependency '@iconify-json/feather' — Declared in packages/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency '@iconify-json/lucide' — Declared in packages/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency '@iconify-json/simple-icons' — Declared in packages/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Duplicated predicate packages/op-chrome-extension/background.js:259— `(error && (error.detail || error.message)) || error` appears character-identically in 2 files — packages/op-chrome-extension/background.js, packages/op-chrome-extension/popup-status.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/op-host-web/pkg-ck/op_host_web.js:964— `builtInMatches && builtInMatches.length > 1` appears character-identically in 2 files — crates/op-host-web/pkg-ck/op_host_web.js, crates/op-host-web/pkg-webgl/op_host_web.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/op-host-web/pkg-ck/op_host_web.js:1000— `cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && …` appears character-identically in 2 files — crates/op-host-web/pkg-ck/op_host_web.js, crates/op-host-web/pkg-webgl/op_host_web.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/op-host-web/pkg-ck/op_host_web.js:1008— `cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0` appears character-identically in 2 files — crates/op-host-web/pkg-ck/op_host_web.js, crates/op-host-web/pkg-webgl/op_host_web.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/op-host-web/pkg-ck/op_host_web.js:1021— `cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0` appears character-identically in 2 files — crates/op-host-web/pkg-ck/op_host_web.js, crates/op-host-web/pkg-webgl/op_host_web.js. 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 packages/op-chrome-extension/design-capture.js:602— `left.name.localeCompare(right.name) || left.value.localeCompare(right.value)` appears character-identically in 2 files — packages/op-chrome-extension/design-capture.js, packages/op-chrome-extension/design-evidence.js. 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 packages/op-chrome-extension/capture.js:63— `pick && typeof pick.teardown === 'function'` appears character-identically in 2 files — packages/op-chrome-extension/capture.js, packages/op-chrome-extension/design-capture.js. 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 packages/op-chrome-extension/design-capture.js:554— `right.count - left.count || JSON.stringify(left).localeCompare(JSON.stringify(right))` appears character-identically in 2 files — packages/op-chrome-extension/design-capture.js, packages/op-chrome-extension/design-evidence.js. 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 packages/op-chrome-extension/design-capture.js:595— `right.count - left.count || left.kind.localeCompare(right.kind)` appears character-identically in 2 files — packages/op-chrome-extension/design-capture.js, packages/op-chrome-extension/design-evidence.js. 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 packages/op-chrome-extension/account.js:205— `typeof csrfToken !== 'string' || csrfToken === ''` appears character-identically in 2 files — packages/op-chrome-extension/account.js, packages/op-chrome-extension/client.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/op-host-web/pkg-ck/op_host_web.js:1223— `typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && …` appears character-identically in 2 files — crates/op-host-web/pkg-ck/op_host_web.js, crates/op-host-web/pkg-webgl/op_host_web.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/op-host-web/pkg-ck/op_host_web.js:942— `typeof name == 'string' && name.length > 0` appears character-identically in 2 files — crates/op-host-web/pkg-ck/op_host_web.js, crates/op-host-web/pkg-webgl/op_host_web.js. 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 packaging/android/app/src/main/kotlin/tech/zseven/openpencil/OpSurfaceViewImeCoordinator.kt:37— `!view.editorMode() || view.editorEngine() == 0L` appears character-identically in 2 files — packaging/android/app/src/main/kotlin/tech/zseven/openpencil/OpSurfaceViewImeCoordinator.kt, packaging/android/app/src/main/kotlin/tech/zseven/openpencil/OpSurfaceViewShellBridge.kt. 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 packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AndroidAuthRuntime.kt:65— `status != 0 && status != OpNative.STATUS_CLOSING` appears character-identically in 4 files — packaging/android/app/src/main/kotlin/tech/zseven/openpencil/AndroidAuthRuntime.kt, packaging/android/app/src/main/kotlin/tech/zseven/openpencil/DocumentSaveBridge.kt, packaging/android/app/src/main/kotlin/tech/zseven/openpencil/DocumentSaveCoordinator.kt, packaging/android/app/src/main/kotlin/tech/zseven/openpencil/OpSurfaceViewShellBridge.kt. 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 templates/step0/_generators/qa/cjkcheck.py:85— `doc.get("children") or doc["pages"][0]["children"]` appears character-identically in 2 files — templates/step0/_generators/qa/cjkcheck.py, templates/step0/_generators/qa/freshcheck.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 templates/step0/_generators/tpl_deck_dossier.py:173— `not isinstance(width, (int, float)) or not isinstance(content, str)` appears character-identically in 2 files — templates/step0/_generators/tpl_deck_dossier.py, templates/step0/_generators/tpl_deck_ledger.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 tools/check-android-packaged-native.py:30— `path.is_file() and not path.is_symlink()` appears character-identically in 2 files — tools/check-android-packaged-native.py, tools/check-local-full-auth.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 templates/step0/_generators/deckkit.py:332— `soft and line and line[0] in NO_LINE_START` appears character-identically in 2 files — templates/step0/_generators/deckkit.py, templates/step0/_generators/qa/cjkcheck.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 crates/op-host-native/src/backend/skia/path.rs:724— `!bounds.is_finite() || !rect.size.x.is_finite() || !rect.size.y.is_finite() || rect.size.x <= 0.0 || rect.size.y <= 0.0` appears character-identically in 2 files — crates/op-host-native/src/backend/skia/path.rs, crates/op-host-native/src/boolean_ops.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/op-mcp/src/batch_design_dsl.rs:153— `!call.starts_with("I(") || !call.ends_with(')')` appears character-identically in 2 files — crates/op-mcp/src/batch_design_dsl.rs, crates/op-mcp/src/batch_program_objects.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/op-host-native/src/widget_host/scroll.rs:71— `!chat.transcript_pinned || chat.transcript_scroll.offset != 0.0` appears character-identically in 2 files — crates/op-host-native/src/widget_host/scroll.rs, crates/op-host-web/src/widget_host/wheel_pan.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/op-engine-ffi/src/editor_chat.rs:506— `!check_only && !allow_ai_bulk_write(host)` appears character-identically in 2 files — crates/op-engine-ffi/src/editor_chat.rs, crates/op-host-desktop/src/chat_session.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/op-host-native/src/widget_host/input.rs:214— `!drag.moved && (x - drag.press_screen_x).abs() <= NODE_DRAG_THRESHOLD_PX && (y - drag.press_screen_y).abs() <= NODE_DRAG_THRESHOLD_PX` appears character-identically in 2 files — crates/op-host-native/src/widget_host/input.rs, crates/op-host-web/src/widget_host/node_drag.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/op-orchestrator/src/text_fit.rs:80— `!font_size.is_finite() || font_size <= 0.0` appears character-identically in 2 files — crates/op-orchestrator/src/text_fit.rs, crates/op-orchestrator/src/text_fit_amount.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/op-orchestrator/src/concurrent_echo_copy.rs:82— `!is_node_visible(node) || opacity(node) <= 0.0` appears character-identically in 2 files — crates/op-orchestrator/src/concurrent_echo_copy.rs, crates/op-orchestrator/src/source_copy_visible.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Silent fallback default on Err crates/op-ai/src/chat_tool_sse.rs:82— `handle` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/op-ai/src/chat_tool_sse.rs:195— `handle` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/op-chat-agent/src/chat_canvas_tools.rs:316— `parse_design_modification_ops_arg` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/op-chat-agent/src/design_agent_tools/root_seed.rs:316— `apply_mobile_status_bar` turns every `Err` into `MobileStatusBarChange::default()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/op-cli/src/skill_install_cli.rs:459— `timestamp_string` turns every `Err` into `"0".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/op-editor-core/src/clipboard.rs:60— `paste_clipboard` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/op-editor-core/src/page_mutators.rs:236— `append_components_page_masters` turns every `Err` into `0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/op-editor-core/src/svg_import.rs:180— `import_svg_named` turns every `Err` into `0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/op-editor-core/src/scene_template_palette.rs:108— `extract_palette` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/op-editor-core/src/theme_presets.rs:211— `presets_from_json` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/op-editor-core/src/theme_presets.rs:235— `preset_file_to_json` turns every `Err` into `"{}".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/op-editor-core/src/web_sync.rs:536— `selection_push_body` turns every `Err` into `r#"{"selectedIds":[]}"#.to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/op-editor-host-core/src/chat.rs:80— `unfilled_report_from_ack` turns every `Err` into `UnfilledScreensReport::default()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/op-editor-host-core/src/chat.rs:101— `quality_summary_from_ack` turns every `Err` into `QualitySummary::default()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/op-editor-host-core/src/chat.rs:165— `blocker_report_from_ack` turns every `Err` into `BlockerReport::default()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/op-editor-host-core/src/codegen.rs:138— `input_from_nodes` turns every `Err` into `"{}".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/op-editor-ui/src/widgets/canvas_viewport_image.rs:159— `take_remote_image_requests` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/op-editor-ui/src/widgets/canvas_viewport_image/decode_registry.rs:54— `take_pending_decodes` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/op-engine-jni/src/callbacks.rs:303— `credential_load` turns every `Err` into `-1` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/op-engine-jni/src/callbacks.rs:362— `credential_store_if_absent` turns every `Err` into `-1` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/op-git/src/merge.rs:218— `conflict_stages` turns every `Err` into `ConflictStages::default()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/op-git/src/remote.rs:343— `auth_env` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/op-host-desktop/src/agent_connect_store.rs:44— `load` turns every `Err` into `Vec::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/op-host-desktop/src/update_check.rs:359— `parts` (in `is_newer`) turns every `Err` into `0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/op-host-services/src/web_canvas_server/tenant_store.rs:237— `load_acl` turns every `Err` into `BTreeSet::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Subsumed condition operand crates/op-orchestrator/src/cleanup_root_and_nav.rs:279— `hay.contains("bottom-navigation")` can never decide this `||` — every value satisfying `hay.contains("bottom-navigation")` also satisfies `hay.contains("bottom-nav")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/op-orchestrator/src/cleanup_root_and_nav.rs:344— `hay.contains("bottom-navigation")` can never decide this `||` — every value satisfying `hay.contains("bottom-navigation")` also satisfies `hay.contains("bottom-nav")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/op-orchestrator/src/dashboard_columns.rs:169— `text.contains("navigation")` can never decide this `||` — every value satisfying `text.contains("navigation")` also satisfies `text.contains("nav")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/op-orchestrator/src/dashboard_columns.rs:282— `text.contains("topheader")` can never decide this `||` — every value satisfying `text.contains("topheader")` also satisfies `text.contains("header")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/op-orchestrator/src/mobile_content_rail_detect.rs:87— `name.contains("bottom navigation")` can never decide this `||` — every value satisfying `name.contains("bottom navigation")` also satisfies `name.contains("bottom nav")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/op-orchestrator/src/plan_normalize_nav.rs:27— `hay.contains("without bottom navigation")` can never decide this `||` — every value satisfying `hay.contains("without bottom navigation")` also satisfies `hay.contains("without bottom nav")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/op-orchestrator/src/plan_normalize_nav.rs:48— `hay.contains("bottom-navigation")` can never decide this `||` — every value satisfying `hay.contains("bottom-navigation")` also satisfies `hay.contains("bottom-nav")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/op-orchestrator/src/plan_normalize_nav.rs:54— `hay.contains("bottom-tab-bar")` can never decide this `||` — every value satisfying `hay.contains("bottom-tab-bar")` also satisfies `hay.contains("bottom-tab")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/op-orchestrator/src/subtask_completeness_semantic_items.rs:22— `text.contains("bottom navigation")` can never decide this `||` — every value satisfying `text.contains("bottom navigation")` also satisfies `text.contains("bottom nav")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/op-orchestrator/src/role_post_pass/mobile_cards.rs:242— `label.contains("shopping cart")` can never decide this `||` — every value satisfying `label.contains("shopping cart")` also satisfies `label.contains("cart")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/op-orchestrator/src/role_post_pass/mobile_search_header.rs:44— `label.contains("sliders")` can never decide this `||` — every value satisfying `label.contains("sliders")` also satisfies `label.contains("slider")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/op-host-services/src/chat_intent.rs:308— `upper.contains("DESIGN_NEW")` can never decide this `||` — every value satisfying `upper.contains("DESIGN_NEW")` also satisfies `upper.contains("DESIGN")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/op-host-services/src/provider_probe_copilot.rs:91— `lower.contains("authenticate first")` can never decide this `||` — every value satisfying `lower.contains("authenticate first")` also satisfies `lower.contains("auth")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/op-host-services/src/provider_probe_copilot.rs:93— `lower.contains("unauthenticated")` can never decide this `||` — every value satisfying `lower.contains("unauthenticated")` also satisfies `lower.contains("auth")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/op-design-lint/src/detectors/structure.rs:250— `label.contains("activity graph")` can never decide this `||` — every value satisfying `label.contains("activity graph")` also satisfies `label.contains("graph")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/op-ai-skills/src/lib_tests.rs:303— `content.contains("events.onTap")` can never decide this `||` — every value satisfying `content.contains("events.onTap")` also satisfies `content.contains("onTap")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/op-ai-skills/src/style_guide/parser.rs:131— `l.contains("card surface")` can never decide this `||` — every value satisfying `l.contains("card surface")` also satisfies `l.contains("surface")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/op-ai-skills/src/style_guide/parser.rs:134— `l.contains("default border")` can never decide this `||` — every value satisfying `l.contains("default border")` also satisfies `l.contains("border")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand crates/op-ai-skills/src/style_guide/parser.rs:143— `l.contains("primary accent")` can never decide this `||` — every value satisfying `l.contains("primary accent")` also satisfies `l.contains("accent")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×9
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 487 significant file(s) lose their only recent owner: crates/op-orchestrator/src/prompt_subagent.rs, crates/op-orchestrator/src/cleanup.rs, crates/op-orchestrator/src/run_orchestrator.rs, crates/op-preview-core/src/session.rs, crates/op-preview-core/src/input.rs, crates/op-host-native/src/widget_host/home.rs, crates/op-host-services/src/validation_providers.rs, crates/op-host-web/src/widget_host/preview_slideshow.rs (+479 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 388 significant file(s) lose their only recent owner: crates/op-html/src/import_warning.rs, crates/op-html/src/css/selectors.rs, crates/op-figma/src/instance.rs, crates/op-collab-host/src/runtime.rs, crates/op-host-web/src/collab_sync.rs, crates/op-collab-host/src/runtime/relay.rs, crates/op-html/src/snapshot.rs, crates/op-host-services/src/web_canvas_server/online_run_loop.rs (+380 more). Pair on, review, or document these before any departure.
Orphaned file crates/op-host-native/src/backend/skia/shaped_text.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file crates/op-editor-core/src/text_script.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
P2 · Observability· Console output used as the logging channel · ×2
Console output used as the logging channel packages/op-vscode/src/extension.ts:49— `packages/op-vscode/src/extension.ts` reports through `console.*` at line 49 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/op-vscode/src/extension.ts:53— `packages/op-vscode/src/extension.ts` reports through `console.*` at line 53 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 2 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (877 single-owned of 2595 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 2595 of the 2953 production source files in this repository met that bar). They are anonymized user #3 (1 file(s)), anonymized user #4 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: crates/op-host-services/src/web_image_generate_atlas.rs, crates/op-host-desktop/src/window_resize.rs.
No ADRs found packaging/android/app/build.gradle.kts:2— No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `packaging/android/app/build.gradle.kts` makes this repository a deployable product (line 2).
D21 · Naming Consistency· `avatarUrl` spells `Url` where 26 names in the project spell it `URL` · ×1
`avatarUrl` spells `Url` where 26 names in the project spell it `URL` packaging/ios/Sources/AccountCenterViewController.swift:9— 26 of 27 names in project packaging~ios spell the token `URL` (26 of 27; unit: names in project packaging~ios containing `URL`). Peers: AccountDeletionRecoveryView.verificationURL (packaging/ios/Sources/AccountDeletionRecoveryView.swift:7); AccountDeletionReceipt.deletionURL (packaging/ios/Sources/AccountDeletionState.swift:24); AccountDeletionReceipt.isDeletionURL (packaging/ios/Sources/AccountDeletionState.swift:49); AccountDeletionResponse.deletionURL (packaging/ios/Sources/AccountDeletionState.swift:72); AccountDeletionResponse.decode(responseURL) (packaging/ios/Sources/AccountDeletionState.swift:87). Rename to `avatarURL`. [rule N6]
D21 · Naming Consistency· `deviceId` spells `Id` where 24 names in the project spell it `ID` · ×1
`deviceId` spells `Id` where 24 names in the project spell it `ID` packaging/ios/Sources/AccountCenterViewController.swift:10— 24 of 25 names in project packaging~ios spell the token `ID` (24 of 25; unit: names in project packaging~ios containing `ID`). Peers: AccountDeletionCoordinator.begin(deviceID) (packaging/ios/Sources/AccountDeletionCoordinator.swift:79); AccountDeletionReceipt.requestID (packaging/ios/Sources/AccountDeletionState.swift:20); AccountDeletionReceipt.deviceID (packaging/ios/Sources/AccountDeletionState.swift:21); AccountDeletionReceipt.isDeletionURL(requestID) (packaging/ios/Sources/AccountDeletionState.swift:49); AccountDeletionResponse.requestID (packaging/ios/Sources/AccountDeletionState.swift:68). Rename to `deviceID`. [rule N6]
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 8 of 60 project(s) overshoot their size bounds, lowering Project Cohesion to 7.3/10. The most over is `crates/op-editor-ui` (131245 LoC, 586 module-visible types across 17 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.
D30 · Dependency Vulnerabilities· Medium vulnerability · ×1
REDACTED
D34 · Knowledge Freshness· Orphaned files with no living knowledge · ×1
Orphaned files with no living knowledge — 2 of 2595 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 2595 of the 2953 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: crates/op-host-native/src/backend/skia/shaped_text.rs, crates/op-editor-core/src/text_script.rs. 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.
Logging is not universal — Only 14/26 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `crates/op-chat-agent`, `crates/op-cli`, `crates/op-collab-host`, `crates/op-collab-relay-client` and 7 more.
No dependency-update automation REDACTED:121— `REDACTED` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
No security response headers detected deploy/collab-relay-locator-edge/cn-federation-nginx.conf:32— None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `cn-federation-nginx.conf` is committed to this repository and declares the server that serves it, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.)
No app-layer HTTPS enforcement detected — This repository starts an HTTP server and nothing in its Rust source or committed `Rocket.toml` secures the transport: no TLS served (actix-web `bind_rustls`/`bind_openssl`, axum-server `bind_rustls` with a `RustlsConfig`, tonic `ServerTlsConfig`, a `TlsAcceptor`, Rocket's `[default.tls]`), no `Strict-Transport-Security` header, no `X-Forwarded-Proto` read from a TLS-terminating proxy — so its traffic may cross the network in clear text. (−2.0 on this card.) The server: `.serve_connection(` (crates/op-collab-relay-locator-server/src/http.rs:301).
X2 · Cancellation propagation· Not all async functions that make a request accept an AbortSignal · ×1
Not all async functions that make a request accept an AbortSignal — Only 5/8 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
Off the main sequence: op-preview-contracts — op-preview-contracts: abstractness 0.00, instability 0.00, distance 1.00 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
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.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
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 01a1db4e-b560-72de-a268-32c9d6a26272 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 92 · Warnings: 4318 · Recommendations: 143 · Info: 1 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 14-11-2026 @ 18:25 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.